fix(cluster_setup): stop reverting artifacts.yaml on repeat installs,…#134
fix(cluster_setup): stop reverting artifacts.yaml on repeat installs,…#134kupratyu-splunk wants to merge 1 commit into
Conversation
… warn on mutable image tags configure_images() snapshotted artifacts.yaml/splunk-operator-cluster.yaml to a .original file on first run and restored from it on every subsequent run before re-injecting image values. Since .original was never refreshed, any legitimate change to those manifests (new operator release, new env var, new sidecar) was silently reverted on every re-install after the first. Drop the snapshot/restore step; the sed substitutions already only touch their own named fields, so rewriting in place is idempotent. Also warn in validate_image_config() when a configured image has no tag or uses a mutable tag (:latest, :preview, :stable*, :dev, :nightly), since imagePullPolicy: IfNotPresent means re-running install without a new distinct tag will not actually upgrade the running image.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4b8c88dd52
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # refreshed. The sed patterns below only ever touch their own named | ||
| # RELATED_IMAGE_*/image: fields, so re-running against an already-updated | ||
| # file is idempotent and safe. |
There was a problem hiding this comment.
Preserve idempotent rewrites for operator image lines
With the backup/restore removed here, the image: substitutions below are not actually idempotent for configured operator image names that do not contain the original splunk...ai...operator or splunk...operator substrings. For example, after a first run sets images.operator.image to registry.example.com/team/platform:v1, a later run with :v2 leaves the manifest at :v1 because s|image: .*splunk.*ai.*operator.*|...| no longer matches; the same applies to the Splunk Operator manifest in internal mode. Previously restoring the original manifest made those regexes match on every run, so repeat installs/upgrades can now silently keep the stale operator image.
Useful? React with 👍 / 👎.
… warn on mutable image tags
configure_images() snapshotted artifacts.yaml/splunk-operator-cluster.yaml to a .original file on first run and restored from it on every subsequent run before re-injecting image values. Since .original was never refreshed, any legitimate change to those manifests (new operator release, new env var, new sidecar) was silently reverted on every re-install after the first. Drop the snapshot/restore step; the sed substitutions already only touch their own named fields, so rewriting in place is idempotent.
Also warn in validate_image_config() when a configured image has no tag or uses a mutable tag (:latest, :preview, :stable*, :dev, :nightly), since imagePullPolicy: IfNotPresent means re-running install without a new distinct tag will not actually upgrade the running image.
Description
Related Issues
Type of Change
Changes Made
Testing Performed
make test)make lint)Test Environment
Test Steps
Documentation
Checklist
Breaking Changes
Impact:
Migration Path:
Screenshots/Recordings
Additional Notes
Reviewer Notes
Please pay special attention to:
Commit Message Convention: This PR follows Conventional Commits