Skip to content

Commit 15b0376

Browse files
Merge pull request #364 from ingvagabund/set-min-length-for-mdb-crd
MDB: Set minimum value constraint for MinAvailable and MaxUnavailable
2 parents 2a49705 + c14a953 commit 15b0376

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

install/0000_30_machine-api-operator_08_machinedisruptionbudget.crd.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,15 @@ spec:
5353
one can prevent all voluntary deletions by specifying 0. This is a
5454
mutually exclusive setting with "minAvailable".
5555
format: int32
56+
minimum: 0
5657
type: integer
5758
minAvailable:
5859
description: An deletion of the machine is allowed if at least "minAvailable"
5960
machines selected by "selector" will still be available after the
6061
deletion. So for example you can prevent all voluntary deletions by
6162
specifying all available nodes.
6263
format: int32
64+
minimum: 0
6365
type: integer
6466
selector:
6567
description: Label query over machines whose deletions are managed by

pkg/apis/healthchecking/v1alpha1/machinedisruptionbudget_types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ type MachineDisruptionBudgetSpec struct {
1010
// "selector" will still be available after the deletion.
1111
// So for example you can prevent all voluntary deletions by specifying all available nodes.
1212
// +optional
13+
// +kubebuilder:validation:Minimum=0
1314
MinAvailable *int32 `json:"minAvailable,omitempty" protobuf:"bytes,1,opt,name=minAvailable"`
1415

1516
// Label query over machines whose deletions are managed by the disruption
@@ -22,6 +23,7 @@ type MachineDisruptionBudgetSpec struct {
2223
// For example, one can prevent all voluntary deletions by specifying 0.
2324
// This is a mutually exclusive setting with "minAvailable".
2425
// +optional
26+
// +kubebuilder:validation:Minimum=0
2527
MaxUnavailable *int32 `json:"maxUnavailable,omitempty" protobuf:"bytes,3,opt,name=maxUnavailable"`
2628
}
2729

0 commit comments

Comments
 (0)