fix(kubernetes): extract images from initContainers and CronJob templates - #7374
fix(kubernetes): extract images from initContainers and CronJob templates#7374faizanfirdousi wants to merge 1 commit into
Conversation
…ates Bring the standard kubernetes plugin to parity with kubernetes_multicluster (pipe-cd#6808). Signed-off-by: faizanfirdousi <faizanfirdousi.official@gmail.com>
|
👋 Hi @faizanfirdousi, welcome to PipeCD and thanks for opening your first pull request! We’re really happy to have you here Before your PR gets merged, please check a few important things below. Helpful resources
DCO Sign-offAll commits must include a In case you forget to sign-off your commit(s), follow these steps: For the last commit: git commit --amend --signoff
git push --force-with-leaseFor multiple commits: git rebase --signoff origin/master
git push --force-with-leaseRun checks locallyBefore pushing updates, please run: make checkThis runs the same checks as CI and helps catch issues early. 💬 Need help?If anything is unclear, feel free to ask in this PR or join us on the CNCF Slack in the #pipecd channel. Thanks for contributing to PipeCD! ❤️ |
✅ Deploy Preview for pipecd-site canceled.
|
There was a problem hiding this comment.
🟢 Approval recommended
The implementation is straightforward, matches the stated requirements, and is backed by targeted tests for the new manifest paths.
Pull request overview
This PR updates the PipeCD pipedv1 Kubernetes plugin to improve artifact version tracking by ensuring FindContainerImages detects container images not only in standard workload containers, but also in initContainers and CronJob jobTemplate pod specs—bringing the standard plugin in line with the previously-fixed multicluster plugin behavior.
Changes:
- Extend
FindContainerImagesto extract images fromspec.template.spec.initContainers[*].image. - Extend
FindContainerImagesto extract images from CronJobspec.jobTemplate.spec.template.spec.{containers,initContainers}[*].image. - Add unit tests covering initContainers, CronJob jobTemplate paths, and deduplication behavior.
File summaries
| File | Description |
|---|---|
| pkg/app/pipedv1/plugin/kubernetes/provider/deployment.go | Expands image extraction paths to include initContainers and CronJob jobTemplate pod specs. |
| pkg/app/pipedv1/plugin/kubernetes/provider/deployment_test.go | Adds coverage for the newly supported image locations and verifies deduplication. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
What this PR does:
Extends
FindContainerImagesin the standardkubernetesplugin to also extract images frominitContainersand CronJobjobTemplatepaths. Previously onlyspec.template.spec.containers[*].imagewas checked.Why we need it:
Applications using init containers or CronJobs would have their images missing from version tracking. The
kubernetes_multiclusterplugin was already fixed in #6808; this brings the standard plugin to parity.Which issue(s) this PR fixes:
Fixes #6528
Does this PR introduce a user-facing change?: