Skip to content

Commit

Permalink
fix: Support v1 PDB in k8s v1.25+. Fixes #10649 (#10712)
Browse files Browse the repository at this point in the history
Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
  • Loading branch information
terrytangyuan committed Mar 30, 2023
1 parent 72a0e5b commit 988706d
Show file tree
Hide file tree
Showing 22 changed files with 715 additions and 716 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ pkg/apis/workflow/v1alpha1/generated.proto: $(GOPATH)/bin/go-to-protobuf $(PROTO
$(GOPATH)/bin/go-to-protobuf \
--go-header-file=./hack/custom-boilerplate.go.txt \
--packages=github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1 \
--apimachinery-packages=+k8s.io/apimachinery/pkg/util/intstr,+k8s.io/apimachinery/pkg/api/resource,k8s.io/apimachinery/pkg/runtime/schema,+k8s.io/apimachinery/pkg/runtime,k8s.io/apimachinery/pkg/apis/meta/v1,k8s.io/api/core/v1,k8s.io/api/policy/v1beta1 \
--apimachinery-packages=+k8s.io/apimachinery/pkg/util/intstr,+k8s.io/apimachinery/pkg/api/resource,k8s.io/apimachinery/pkg/runtime/schema,+k8s.io/apimachinery/pkg/runtime,k8s.io/apimachinery/pkg/apis/meta/v1,k8s.io/api/core/v1,k8s.io/api/policy/v1 \
--proto-import $(GOPATH)/src
# Delete the link
[ -e ./v3 ] && rm -rf v3
Expand Down
6 changes: 3 additions & 3 deletions api/jsonschema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -7296,7 +7296,7 @@
"type": "integer"
},
"podDisruptionBudget": {
"$ref": "#/definitions/io.k8s.api.policy.v1beta1.PodDisruptionBudgetSpec",
"$ref": "#/definitions/io.k8s.api.policy.v1.PodDisruptionBudgetSpec",
"description": "PodDisruptionBudget holds the number of concurrent disruptions that you allow for Workflow's Pods. Controller will automatically add the selector with workflow name, if selector is empty. Optional: Defaults to empty."
},
"podGC": {
Expand Down Expand Up @@ -10325,7 +10325,7 @@
},
"type": "object"
},
"io.k8s.api.policy.v1beta1.PodDisruptionBudgetSpec": {
"io.k8s.api.policy.v1.PodDisruptionBudgetSpec": {
"description": "PodDisruptionBudgetSpec is a description of a PodDisruptionBudget.",
"properties": {
"maxUnavailable": {
Expand All @@ -10338,7 +10338,7 @@
},
"selector": {
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector",
"description": "Label query over pods whose evictions are managed by the disruption budget. A null selector selects no pods. An empty selector ({}) also selects no pods, which differs from standard behavior of selecting all pods. In policy/v1, an empty selector will select all pods in the namespace.",
"description": "Label query over pods whose evictions are managed by the disruption budget. A null selector will match no pods, while an empty ({}) selector will select all pods within the namespace.",
"x-kubernetes-patch-strategy": "replace"
}
},
Expand Down
6 changes: 3 additions & 3 deletions api/openapi-spec/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -11210,7 +11210,7 @@
},
"podDisruptionBudget": {
"description": "PodDisruptionBudget holds the number of concurrent disruptions that you allow for Workflow's Pods. Controller will automatically add the selector with workflow name, if selector is empty. Optional: Defaults to empty.",
"$ref": "#/definitions/io.k8s.api.policy.v1beta1.PodDisruptionBudgetSpec"
"$ref": "#/definitions/io.k8s.api.policy.v1.PodDisruptionBudgetSpec"
},
"podGC": {
"description": "PodGC describes the strategy to use when deleting completed pods",
Expand Down Expand Up @@ -14228,7 +14228,7 @@
}
}
},
"io.k8s.api.policy.v1beta1.PodDisruptionBudgetSpec": {
"io.k8s.api.policy.v1.PodDisruptionBudgetSpec": {
"description": "PodDisruptionBudgetSpec is a description of a PodDisruptionBudget.",
"type": "object",
"properties": {
Expand All @@ -14241,7 +14241,7 @@
"$ref": "#/definitions/io.k8s.apimachinery.pkg.util.intstr.IntOrString"
},
"selector": {
"description": "Label query over pods whose evictions are managed by the disruption budget. A null selector selects no pods. An empty selector ({}) also selects no pods, which differs from standard behavior of selecting all pods. In policy/v1, an empty selector will select all pods in the namespace.",
"description": "Label query over pods whose evictions are managed by the disruption budget. A null selector will match no pods, while an empty ({}) selector will select all pods within the namespace.",
"x-kubernetes-patch-strategy": "replace",
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"
}
Expand Down
2 changes: 1 addition & 1 deletion docs/fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -4954,7 +4954,7 @@ PodDisruptionBudgetSpec is a description of a PodDisruptionBudget.
|:----------:|:----------:|---------------|
|`maxUnavailable`|[`IntOrString`](#intorstring)|An eviction is allowed if at most "maxUnavailable" pods selected by "selector" are unavailable after the eviction, i.e. even in absence of the evicted pod. For example, one can prevent all voluntary evictions by specifying 0. This is a mutually exclusive setting with "minAvailable".|
|`minAvailable`|[`IntOrString`](#intorstring)|An eviction is allowed if at least "minAvailable" pods selected by "selector" will still be available after the eviction, i.e. even in the absence of the evicted pod. So for example you can prevent all voluntary evictions by specifying "100%".|
|`selector`|[`LabelSelector`](#labelselector)|Label query over pods whose evictions are managed by the disruption budget. A null selector selects no pods. An empty selector ({}) also selects no pods, which differs from standard behavior of selecting all pods. In policy/v1, an empty selector will select all pods in the namespace.|
|`selector`|[`LabelSelector`](#labelselector)|Label query over pods whose evictions are managed by the disruption budget. A null selector will match no pods, while an empty ({}) selector will select all pods within the namespace.|

## PodSecurityContext

Expand Down

0 comments on commit 988706d

Please sign in to comment.