Improve local rules persistence and dirty-state handling
All checks were successful
Build and Deploy Gateway / build-and-push (push) Successful in 20s
Build and Deploy Gateway / deploy (push) Successful in 7s

This commit is contained in:
2026-07-11 22:37:04 +03:00
parent 1304a22f1f
commit 387cc273e8
9 changed files with 256 additions and 38 deletions

View File

@@ -20,6 +20,7 @@ export function normalizeStoredState(value) {
appliedTag: Object.hasOwn(state, 'appliedTag') ? text(state.appliedTag) : selectedTag,
servers: Array.isArray(state.servers) ? state.servers : [],
routeRules: normalizeRouteRules(state.routeRules),
routeRulesPendingRestart: state.routeRulesPendingRestart === true,
};
}
@@ -84,6 +85,7 @@ export function createStateSnapshot({
lastVerifiedAt: null,
reason: mode === 'client' && stored.gatewayAutoEnabled !== false ? 'auto' : 'manual',
localRules: stored.routeRules,
localRulesPendingRestart: stored.routeRulesPendingRestart,
},
operation: {
kind: nullableText(operation.kind),
@@ -177,6 +179,7 @@ export function assertStateSnapshot(snapshot) {
typeof snapshot.route.reason !== 'string' ||
!Array.isArray(snapshot.route.localRules) ||
!snapshot.route.localRules.every(validRouteRule) ||
typeof snapshot.route.localRulesPendingRestart !== 'boolean' ||
!snapshot.operation ||
!nullableString(snapshot.operation.kind) ||
!OPERATION_STATES.has(snapshot.operation.status) ||

View File

@@ -1,7 +1,7 @@
export const HARBOR_VERSIONS = Object.freeze({
macClient: '0.4.0',
gatewayClient: '0.4.0',
gatewayBackend: '0.4.0',
macClient: '0.5.0',
gatewayClient: '0.5.0',
gatewayBackend: '0.5.0',
});
export function parseVersion(value) {