All checks were successful
deploy / deploy (push) Successful in 21s
Proof: Strategy and executor arm state now survives pod restarts through durable control-state files mounted in their service state directories. Assumptions: The strategy-state PVC can be seeded before the first rollout restart, and both service state directories remain writable on the cluster. Still fake: Armed-state durability is local to the cluster volumes; there is no cross-cluster or database-backed operator control-state replication.
34 lines
742 B
JavaScript
34 lines
742 B
JavaScript
import { createJsonStateStore } from './json-state-store.mjs';
|
|
|
|
export function createArmedStateStore({
|
|
stateDir,
|
|
fileName = 'armed-state.json',
|
|
initialArmed = false,
|
|
}) {
|
|
const store = createJsonStateStore({
|
|
stateDir,
|
|
fileName,
|
|
initialState: {
|
|
armed: Boolean(initialArmed),
|
|
updated_at: null,
|
|
},
|
|
});
|
|
|
|
return {
|
|
getState() {
|
|
return store.getState();
|
|
},
|
|
isArmed() {
|
|
return Boolean(store.getState().armed);
|
|
},
|
|
setArmed(armed) {
|
|
const nextArmed = Boolean(armed);
|
|
const nextState = store.update((state) => {
|
|
state.armed = nextArmed;
|
|
state.updated_at = new Date().toISOString();
|
|
return state;
|
|
});
|
|
return nextState;
|
|
},
|
|
};
|
|
}
|