feat: region auto-discovery and simplified gitops configuration#137
Draft
michikrug wants to merge 2 commits into
Draft
feat: region auto-discovery and simplified gitops configuration#137michikrug wants to merge 2 commits into
michikrug wants to merge 2 commits into
Conversation
Introduce gitops-updates and gitops-namespace inputs so service repos no longer need to enumerate every region explicitly. The action discovers regions from the checked-out mops directory structure at runtime, making new regions (e.g. me1) pick up automatically without any service repo changes. - gitops-updates replaces the three per-env inputs; environment is derived from GITHUB_REF as before (dev branch → dev, main → stage, tag → prod) - gitops-namespace enables shorthand path format: just the CR filename, optionally followed by a container name or full yq field path - Field resolution: no field → spec.template.spec.containers.<ns>.image; bare name → spec.template.spec.containers.<name>.image; dotted path → as-is - Legacy gitops-dev/stage/prod inputs remain fully supported; gitops-updates takes precedence when set - Without gitops-namespace all lines pass through unchanged, preserving 100% backward compatibility for external repos with different structures Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
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.
Type of Change
Description
Problem
Every service repo must explicitly list each region in its
gitops-prod(andgitops-dev,gitops-stage) inputs:Adding a new production region (e.g.
xy1) requires touching every single service repo. There are 150+ services.Solution
Two new inputs enable a much simpler configuration:
gitops-namespace— the Kubernetes namespace to look up in the GitOps repogitops-updates— the files to update; environment (dev/stage/prod) is derived fromGITHUB_REFautomatically, replacing the three separate per-env inputsThe action discovers regions at runtime by listing subdirectories of
kubernetes/namespaces/<namespace>/<env>/in the checked-out GitOps repo. Adding a new region to the GitOps repo is all that is needed — zero service repo changes.The same config now looks like:
Field resolution
The field specifier in
gitops-updatesis optional and resolved progressively:my-service-cr.yamlspec.template.spec.containers.<namespace>.imagemy-service-cr.yaml authenticationspec.template.spec.containers.authentication.imagemy-service-cr.yaml spec.template.spec.initContainers.migrate.imageRegion scoping via directory existence
No explicit region-group configuration is needed. A service deployed only to
prod/corewill only update that directory. A customer-facing service withprod/ab1,prod/cd1,prod/ef1will update all of them. Addingprod/xy1to the GitOps repo automatically picks it up for every service using the new format.Backward compatibility
This change is fully backward compatible on three levels:
gitops-updatesvs legacy inputs —gitops-dev,gitops-stage, andgitops-prodcontinue to work exactly as before.gitops-updatestakes precedence only when explicitly set.gitops-namespaceis set, any line starting withkubernetes/is passed through unchanged. Mixed explicit and shorthand lines in the same input block are supported.gitops-namespaceis not set, every line passes through unchanged without any shorthand detection. No risk of breakage for users of this action with a non-kubernetes/GitOps structure.Checklist