Skip to content

Add CronJob support to FindReferencingConfigMaps and FindReferencingS…#7030

Open
Ankitdotraider wants to merge 1 commit into
pipe-cd:masterfrom
Ankitdotraider:fix/cronjob-configmap-secret-refs
Open

Add CronJob support to FindReferencingConfigMaps and FindReferencingS…#7030
Ankitdotraider wants to merge 1 commit into
pipe-cd:masterfrom
Ankitdotraider:fix/cronjob-configmap-secret-refs

Conversation

@Ankitdotraider

Copy link
Copy Markdown

What this PR does:
FindReferencingConfigMaps and FindReferencingSecrets only walk spec.template.spec., which works for Deployment, StatefulSet, and DaemonSet. CronJob nests its pod template under spec.jobTemplate.spec.template.spec., so ConfigMap/Secret references inside a CronJob were silently missed.

Added the missing jobTemplate probes to both functions, in both the kubernetes and kubernetes_multicluster provider packages, following the same pattern already used for the existing paths. Added test cases covering CronJob ConfigMap/Secret references in both packages.

Scoped to just these two functions no changes to FindContainerImages or anything else, to keep this focused.

Why we need it:
Without this fix, PipeCD's drift detection and re-deploy triggering silently ignore config/secret changes in CronJob workloads.

Which issue(s) this PR fixes:

Fixes #6761

Does this PR introduce a user-facing change?:

  • How are users affected by this change: PipeCD now correctly detects ConfigMap/Secret references inside CronJob workloads, enabling proper drift detection and re-deploy triggering.
  • Is this breaking change: no.
  • How to migrate (if breaking change):N/A

…ecrets

Signed-off-by: Ankit Ram <ankiittt15@gmail.com>
@Ankitdotraider
Ankitdotraider requested review from a team as code owners July 14, 2026 09:57
@github-actions

Copy link
Copy Markdown
Contributor

👋 Hi @Ankitdotraider, 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! ❤️

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.

FindReferencingConfigMaps and FindReferencingSecrets miss CronJob references

1 participant