Skip to content

fix(job, cronjob): move startingDeadlineSeconds to CronJob spec - #664

Open
RaphaelFakhri wants to merge 1 commit into
stakater:mainfrom
RaphaelFakhri:fix/cronjob-starting-deadline-seconds
Open

RaphaelFakhri wants to merge 1 commit into
stakater:mainfrom
RaphaelFakhri:fix/cronjob-starting-deadline-seconds

Conversation

@RaphaelFakhri

Copy link
Copy Markdown

Summary

startingDeadlineSeconds is a CronJobSpec field, but the chart renders it in the JobSpec:

  • cronjob.yaml renders it under spec.jobTemplate.spec. Strict schema validation rejects the CronJob. Otherwise the API server drops the field and the deadline has no effect.
  • job.yaml renders it under the Job spec. The Job API has no such field, so the result is the same.

This change:

  • Renders startingDeadlineSeconds under the CronJob spec, next to schedule, and keeps support for 0.
  • Stops rendering it on Jobs and removes it from the Job example in values.yaml.
  • Updates the CronJob and Job unit tests to match.

Fixes #663

Testing

  • Before the change, the updated tests fail: helm-unittest -f tests/cronjob_test.yaml -f tests/job_test.yaml application reports 3 failed, 68 passed.
  • After the change, mise run test reports 398 passed. mise run lint passes, and README.md and values.schema.json don't change when regenerated.
  • Before the change, kubeconform -strict (Kubernetes 1.31.0) rejects the rendered CronJob (/spec/jobTemplate/spec: additional properties 'startingDeadlineSeconds' not allowed) and Job (/spec). After the change, both resources pass validation.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

startingDeadlineSeconds renders in the Job spec, so CronJobs and Jobs that set it fail validation

1 participant