-
Notifications
You must be signed in to change notification settings - Fork 118
Feature/cronjob image substitution #433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/cronjob image substitution #433
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR replaces fragile string-based image substitution with object-level YAML mutation and extends support to CronJob resources and initContainers.
- Parses Kubernetes manifests into objects, updates image fields, and re-serializes to YAML
- Introduces
updateImagesInK8sObjectandupdateImageInContainerArrayhelpers - Adds CronJob
spec.jobTemplateand initContainers handling
Comments suppressed due to low confidence (1)
src/utilities/manifestUpdateUtils.ts:122
- CronJob and initContainers image updates have been added; ensure new test cases cover both
spec.jobTemplatecontainers andinitContainersto prevent regressions.
obj?.kind?.toLowerCase() === KubernetesWorkload.CRON_JOB &&
| obj.spec.jobTemplate.spec.template.spec.initContainers[0].image | ||
| ).toBe('init:new') | ||
| }) | ||
| }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks good, can we add a test for updateContainerImagesInManifestFiles to validate that the yaml parsing works as expected
🚀 Add image substitution support for CronJobs (Addresses #243 )
This PR enhances the image substitution logic to support CronJobs by updating container image references in structured YAML objects. It replaces fragile string-based substitution with robust object-level mutation, ensuring compatibility across all standard workload types including CronJob, Deployment, and initContainers. CLOSED BECAUSE CODE WAS USED BY #436