-
Notifications
You must be signed in to change notification settings - Fork 40k
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
PDB Max Unavailable Field #45587
PDB Max Unavailable Field #45587
Conversation
Make sure you add the extra field as an option in https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/create_pdb.go |
877201b
to
634f668
Compare
@k8s-bot bazel test this |
a7a2f7d
to
3a0211c
Compare
@k8s-bot kops aws e2e test this |
@@ -108,6 +109,11 @@ func DeepCopy_v1beta1_PodDisruptionBudgetSpec(in interface{}, out interface{}, c | |||
in := in.(*PodDisruptionBudgetSpec) | |||
out := out.(*PodDisruptionBudgetSpec) | |||
*out = *in | |||
if in.MinAvailable != 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.
Why was this missing before?
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.
It was not a pointer field before; we're changing the API (in the first commit) to allow specifying of one of "maxUnavailable" and "minAvailable"
expectedCount += count | ||
} | ||
func (dc *DisruptionController) getExpectedScale(pdb *policy.PodDisruptionBudget, pods []*v1.Pod) (expectedCount int32, err error) { | ||
err = 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.
You don't need this.
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.
Done
/lgtm |
/lgtm |
// Ensure it supports the generator pattern that uses parameters specified during construction. | ||
var _ StructuredGenerator = &PodDisruptionBudgetV2Generator{} | ||
|
||
func (PodDisruptionBudgetV2Generator) ParamNames() []GeneratorParam { |
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.
Why do we need to implement the Generator interface
? @Kargakis
I think we are using StructuredGenerator interface
now.
allErrs = append(allErrs, extensionsvalidation.ValidatePositiveIntOrPercent(spec.MinAvailable, fldPath.Child("minAvailable"))...) | ||
allErrs = append(allErrs, extensionsvalidation.IsNotMoreThan100Percent(spec.MinAvailable, fldPath.Child("minAvailable"))...) | ||
if spec.MinAvailable != nil && spec.MaxUnavailable != nil { | ||
allErrs = append(allErrs, field.Invalid(fldPath, spec, "MinAvailable and MaxUnavailable cannot be both set")) |
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.
these should be camelCase
minAvailable
and maxUnavailable
One comment, then LGTM |
@smarterclayton Updated and rebased. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: erictune, foxish, kargakis, smarterclayton
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
@foxish: The following test(s) failed:
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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/test-infra repository. I understand the commands that are listed here. |
@k8s-bot pull-kubernetes-e2e-gce-etcd3 test this |
Automatic merge from submit-queue (batch tested with PRs 45587, 46286) |
Completes kubernetes/enhancements#285
Individual commits are self-contained; Last commit can be ignored because it is autogenerated code.
cc @kubernetes/sig-apps-api-reviews @kubernetes/sig-apps-pr-reviews