Repository navigation
Conversation
Compare the Kong changes of a Route or Consumer with the current Kong state before writing them, so the switch from the legacy operator cannot change Kong unnoticed. - --migration-mode=off|on|strict: on blocks unexpected diffs, strict requires an approval for every change. - Plan the whole bundle (upstream, targets, service, route, plugins, consumer, group, deletes) without writing, decide once, then apply. - Diff normalized JSON by path; expected diffs come from an ignore list (--migration-ignore-config) with kind, name pattern and JSON paths. - Show blocked changes in the temporary status.migration field and approve them with gateway.cp.ei.telekom.de/migration-approved-hash. - Metrics gateway_kong_migration_checks_total and gateway_kong_migration_diffs_total. - Docs and ADRs 0001-0011 under docs/adrs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #816 (
feat/gateway-realm-naming). Merge that first; GitHub then retargets this PR tomain.What
Adds Migration Mode to the Gateway operator. While the legacy Java operator still manages Kong, it checks the operator's Kong changes before writing them. An unexpected change is blocked, and a human can review it and approve it.
--migration-mode=off|on|strict(defaultoff)on: the changes are written only if every diff is on the ignore list, or if they are approved.strict: every change needs an approval, even if all diffs are ignored.planned--placeholder IDs, so the entities that depend on them can be planned too.$.tags,$.config.minute, …).--migration-ignore-config, a YAML file withkind, an optionalnameregex andpaths(.*and[*]are wildcards). A sample is ingateway/config/samples/migration_ignore_configmap.yaml.status.migration, which lists every change with its desired and current values and the hash.gateway.cp.ei.telekom.de/migration-approved-hash=<status.migration.hash>. The next reconcile plans again and writes only if the hash is unchanged. Any other change (to the Route, to Kong or to the ignore list) is blocked again.gateway_kong_migration_checks_totalandgateway_kong_migration_diffs_total.Docs
docs/docs/architecture/gateway-realm-migration.mdx: new "Migration Mode" section with the flow, review and approval steps.docs/adrs/: new ADRs 0001–0011 covering the feat(gateway): realm-prefixed Kong entity names with legacy migration #816 decisions and Migration Mode. 0008 (approval by generation) is superseded by 0010 (approval by hash).Testing
make test: unit tests for the plan, hash, decision, modes and ignore rules. Fake-Kong tests plan the adoption of a real Java route snapshot without writing and then apply it, plan a delete, and plan a new service, route and plugin as one bundle. Handler tests cover a blocked change with the status set, then its approval with the status removed, for both create and delete.make lint: no new findings.Known limits