Skip to content

Chart: Add activeDeadlineSeconds. #13497

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

Merged
merged 1 commit into from
Jun 10, 2025
Merged

Conversation

hrdkmshra
Copy link
Contributor

@hrdkmshra hrdkmshra commented Jun 8, 2025

What this PR does / why we need it:

  1. added activeDeadlineSeconds : 0 in ingress-nginx/charts/ingress-nginx/values.yaml.
  2. used conditional templating to ensure activeDeadlineSeconds is only included in the Job spec when explicitly set greater than 0.
  3. added unit-tests to ingress-nginx/charts/ingress-nginx/tests/admission-webhooks/job-patch/job-createSecret_test.yaml & ingress-nginx/charts/ingress-nginx/tests/admission-webhooks/job-patch/job-patchWebhook_test.yaml
  4. updated the README.md via helm-docs

#13000

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • CVE Report (Scanner found CVE and adding report)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation only

Which issue/s this PR fixes

fixes #13000

How Has This Been Tested?

  1. cd ingress-nginx/charts/ingress-nginx

helm lint . 
==> Linting .

1 chart(s) linted, 0 chart(s) failed
helm template . --debug
bash-5.2# helm unittest -f tests/admission-webhooks/job-patch/job-createSecret_test.yaml .

### Chart [ ingress-nginx ] .

 PASS  Admission Webhooks > Patch Job > Create Secret Job       tests/admission-webhooks/job-patch/job-createSecret_test.yaml

Charts:      1 passed, 1 total
Test Suites: 1 passed, 1 total
Tests:       3 passed, 3 total
Snapshot:    0 passed, 0 total
Time:        33.760399ms
bash-5.2# helm unittest -f tests/admission-webhooks/job-patch/job-patchWebhook_test.yaml .

### Chart [ ingress-nginx ] .

 PASS  Admission Webhooks > Patch Job > Patch Webhook Job       tests/admission-webhooks/job-patch/job-patchWebhook_test.yaml

Charts:      1 passed, 1 total
Test Suites: 1 passed, 1 total
Tests:       3 passed, 3 total
Snapshot:    0 passed, 0 total
Time:        23.67955ms

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I've read the CONTRIBUTION guide
  • I have added unit and/or e2e tests to cover my changes.
  • All new and existing tests passed.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 8, 2025
@k8s-ci-robot k8s-ci-robot requested a review from Gacko June 8, 2025 18:11
@k8s-ci-robot k8s-ci-robot added the area/helm Issues or PRs related to helm charts label Jun 8, 2025
@k8s-ci-robot k8s-ci-robot added needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 8, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @hrdkmshra. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added needs-priority size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jun 8, 2025
Copy link

netlify bot commented Jun 8, 2025

Deploy Preview for kubernetes-ingress-nginx canceled.

Name Link
🔨 Latest commit a6d0437
🔍 Latest deploy log https://app.netlify.com/projects/kubernetes-ingress-nginx/deploys/6847d0aca8802f000879d1d5

@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jun 8, 2025
Copy link
Member

@Gacko Gacko left a comment

Choose a reason for hiding this comment

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

Please do not set this by default and tell your PR "optional". 🙂

I'd suggest only rendering this if the value is set to something greater than 0. Otherwise you're not only adding a new property, but also change existing behavior. IIRC tools like Helm already timeout properly and with your change it might "succeed" even though the job didn't.

Please also update the documentation (helm-docs) and add unit tests in the tests/ directory.

@Gacko
Copy link
Member

Gacko commented Jun 9, 2025

/triage accepted
/kind feature
/priority backlog
/retitle Chart: Add activeDeadlineSeconds.

@k8s-ci-robot k8s-ci-robot changed the title Added optional activeDeadlineSeconds parameter configuration for admission webhook jobs Chart: Add controller.admissionWebhooks.*Job.activeDeadlineSeconds. Jun 9, 2025
@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. kind/feature Categorizes issue or PR as related to a new feature. priority/backlog Higher priority than priority/awaiting-more-evidence. and removed needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority labels Jun 9, 2025
@Gacko Gacko changed the title Chart: Add controller.admissionWebhooks.*Job.activeDeadlineSeconds. Chart: Add activeDeadlineSeconds. Jun 9, 2025
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jun 9, 2025
@hrdkmshra
Copy link
Contributor Author

hrdkmshra commented Jun 9, 2025

Please do not set this by default and tell your PR "optional". 🙂

Understood :)) ,I've updated the PR with correct wording.

I'd suggest only rendering this if the value is set to something greater than 0.

I have followed the suggested approach. To only render, if greater than 0.

Please also update the documentation (helm-docs) and add unit tests in the tests/ directory.

Thank you for pointing this out, helm lint is something very new to me, that's the only part I struggled with alot (apologies for making to many minute commits and made this PR messy).

@k8s-ci-robot k8s-ci-robot removed the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jun 10, 2025
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jun 10, 2025
Copy link
Member

@Gacko Gacko left a comment

Choose a reason for hiding this comment

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

I rebased your branch on top of main. Apart from that: LGTM!

/lgtm

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jun 10, 2025
@Gacko
Copy link
Member

Gacko commented Jun 10, 2025

The linter errors are my bad, gonna fix them for you.

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 10, 2025
@Gacko
Copy link
Member

Gacko commented Jun 10, 2025

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 10, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Gacko, hrdkmshra

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Gacko
Copy link
Member

Gacko commented Jun 10, 2025

The failing tests are not your fault. We are relying on an external service for resolving hostnames to private IPs and this service sometimes isn't 100% reliable.

@k8s-ci-robot k8s-ci-robot merged commit 6338a3a into kubernetes:main Jun 10, 2025
41 of 49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/helm Issues or PRs related to helm charts cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. priority/backlog Higher priority than priority/awaiting-more-evidence. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ability to specify activeDeadlineSeconds for jobs in helm chart
3 participants