-
Notifications
You must be signed in to change notification settings - Fork 39.8k
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
validate activeDeadlineSeconds in rs/rc #38741
validate activeDeadlineSeconds in rs/rc #38741
Conversation
Hi @sandflee. 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 If you have questions or suggestions related to this bot's behavior, please file an issue against the kubernetes/test-infra repository. |
@k8s-bot ok to test |
@kubernetes/sig-apps this is not backwards-compatible but I guess people who specify activeDeadlineSeconds in their controllers have already figured out it's wrong. |
If we are going to do this, we should also update the validation for deployments, daemonsets, and statefulsets. |
the validation of deployment is through rs, we may add the validation of daemonset and statefulsets |
[APPROVALNOTIFIER] Needs approval from an approver in each of these OWNERS Files: We suggest the following people: |
pkg/api/validation/validation.go
Outdated
@@ -2752,6 +2752,10 @@ func ValidatePodTemplateSpecForRC(template *api.PodTemplateSpec, selectorMap map | |||
if template.Spec.RestartPolicy != api.RestartPolicyAlways { | |||
allErrs = append(allErrs, field.NotSupported(fldPath.Child("spec", "restartPolicy"), template.Spec.RestartPolicy, []string{string(api.RestartPolicyAlways)})) | |||
} | |||
|
|||
if template.Spec.ActiveDeadlineSeconds != nil { | |||
allErrs = append(allErrs, field.Invalid(fldPath.Child("spec", "activeDeadlineSeconds"), template.Spec.ActiveDeadlineSeconds, "must be nil")) |
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.
nil is a Go ism, not part of the API. "must not be specified", same all over
update the patch to use "must not be specified" |
test failure seems not related, see #41419 |
@k8s-bot unit test this (confimap controller unit test flake) |
Automatic merge from submit-queue |
@sandflee PR needs rebase |
What this PR does / why we need it:
if setting activeDeadlineSeconds, deployment will continuously created new pods after old pod dies.
Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged): fixes #38684Special notes for your reviewer:
Release note: