Skip to content

fix(kubernetes): extract images from initContainers and CronJob templates - #7374

Open
faizanfirdousi wants to merge 1 commit into
pipe-cd:masterfrom
faizanfirdousi:fix/kubernetes-find-container-images
Open

fix(kubernetes): extract images from initContainers and CronJob templates#7374
faizanfirdousi wants to merge 1 commit into
pipe-cd:masterfrom
faizanfirdousi:fix/kubernetes-find-container-images

Conversation

@faizanfirdousi

Copy link
Copy Markdown

What this PR does:
Extends FindContainerImages in the standard kubernetes plugin to also extract images from initContainers and CronJob jobTemplate paths. Previously only spec.template.spec.containers[*].image was checked.

Why we need it:
Applications using init containers or CronJobs would have their images missing from version tracking. The kubernetes_multicluster plugin 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?:

  • How are users affected by this change: Version tracking now correctly includes images from initContainers and CronJobs in the standard kubernetes plugin.
  • Is this breaking change: No
  • How to migrate (if breaking change): N/A

…ates

Bring the standard kubernetes plugin to parity with kubernetes_multicluster (pipe-cd#6808).

Signed-off-by: faizanfirdousi <faizanfirdousi.official@gmail.com>
Copilot AI lite review requested due to automatic review settings September 10, 2026 17:00
@faizanfirdousi
faizanfirdousi requested review from a team as code owners September 10, 2026 17:00
@github-actions

Copy link
Copy Markdown
Contributor

👋 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-off

All commits must include a Signed-off-by line to comply with the Developer Certificate of Origin (DCO).

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-lease

For multiple commits:

git rebase --signoff origin/master
git push --force-with-lease

Run checks locally

Before pushing updates, please run:

make check

This 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.
You can get your Slack invite from: https://communityinviter.com/apps/cloud-native/cncf

Thanks for contributing to PipeCD! ❤️

@netlify

netlify Bot commented Sep 10, 2026

Copy link
Copy Markdown

Deploy Preview for pipecd-site canceled.

Name Link
🔨 Latest commit 08900f5
🔍 Latest deploy log https://app.netlify.com/projects/pipecd-site/deploys/6aa2e21d88d0bc000853134d

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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 FindContainerImages to extract images from spec.template.spec.initContainers[*].image.
  • Extend FindContainerImages to extract images from CronJob spec.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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FindContainerImages does not detect images in initContainers and CronJob jobTemplate

2 participants