Repository navigation
fix(kustomize): match image names using SplitImageName to support registry ports and digests (#29970) - #29978
Conversation
❌ Preview Environment deleted from BunnyshellAvailable commands (reply to this comment):
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthrough
ChangesKustomize image matching
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: Merge Risk: ⚪ Minimal · up to The change aligns image updates and unsets with the intended image-name matching behavior. No concrete merge-blocking risk is evident from the reviewed changes. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 3 systems. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 3 files. (1 skipped: 1 unsupported.)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment ✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
|
Bundle ReportBundle size has no change ✅ |
…istry ports and digests Previously, KustomizeImage.Match used delim() which cut at the first colon, treating registry host:port addresses as image names and misidentifying sha256 digests. This caused app set and unset --kustomize-image to overwrite or remove unrelated images from the same registry port, and prevented digest overrides from replacing tags. This fix compares the old image name prefix when '=' is present, and otherwise uses kutil.SplitImageName to accurately extract the image repository name. Signed-off-by: jdymitarai <o10040115@gmail.com>
77fc02c to
ab2be6e
Compare
crenshaw-dev
left a comment
There was a problem hiding this comment.
lgtm! Can you merge and fix the go.mod conflict?
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #29978 +/- ##
=========================================
Coverage ? 72.32%
=========================================
Files ? 434
Lines ? 56289
Branches ? 0
=========================================
Hits ? 40709
Misses ? 15580
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
…-kustomize-image-match-registry-port
|
@crenshaw-dev Merged upstream/master and resolved the go.mod conflict (kept controller-runtime v0.25.2 from master and ran go mod tidy). Ready for merge, thank you! |
|
❌ Cherry-pick failed for 3.3. Please check the workflow logs for details. |
|
❌ Cherry-pick failed for 3.6. Please check the workflow logs for details. |
|
❌ Cherry-pick failed for 3.4. Please check the workflow logs for details. |
|
❌ Cherry-pick failed for 3.5. Please check the workflow logs for details. |
Fixes #29970
Previously,
KustomizeImage.Matchuseddelim()which split on the first colon, causing images with registry ports (e.g.,registry.example.com:5000/team/foo:1.0) to be truncated to just the registry host (registry.example.com). As a result,argocd app setorunset --kustomize-imageincorrectly matched and overwritten or deleted unrelated images sharing the same registry port, and digest overrides failed to replace existing tags. This fix compares the old image name prefix when=is present, and otherwise useskutil.SplitImageNamefromsigs.k8s.io/kustomize/apito accurately extract the image name without tags, digests, or port truncation. Unit tests covering registry ports, tags, digests, and CLI unsetting have been added.Checklist:
Summary by CodeRabbit