Skip to content

Commit 1e8eae8

Browse files
authored
Fix validation of ScaleDownUtilizationThreshold field in ScalewayManagedControlPlane (#87)
1 parent d5db075 commit 1e8eae8

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

api/v1alpha1/scalewaymanagedcontrolplane_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ type AutoscalerSpec struct {
134134

135135
// Node utilization level, defined as a sum of requested resources divided
136136
// by capacity, below which a node can be considered for scale down.
137-
// +kubebuilder:validation:Format="float"
137+
// +kubebuilder:validation:Pattern=`^(0(\.[0-9]{1,2})?|1)$`
138138
// +optional
139139
ScaleDownUtilizationThreshold *string `json:"scaleDownUtilizationThreshold,omitempty"`
140140

api/v1alpha2/scalewaymanagedcontrolplane_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ type Autoscaler struct {
186186
// sum of requested resources divided by capacity, below which a node can be
187187
// considered for scale down.
188188
// +optional
189-
// +kubebuilder:validation:Format="float"
189+
// +kubebuilder:validation:Pattern=`^(0(\.[0-9]{1,2})?|1)$`
190190
// +kubebuilder:validation:MinLength=1
191191
// +kubebuilder:validation:MaxLength=10
192192
ScaleDownUtilizationThreshold string `json:"scaleDownUtilizationThreshold,omitempty"`

config/crd/bases/infrastructure.cluster.x-k8s.io_scalewaymanagedcontrolplanes.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ spec:
188188
description: |-
189189
Node utilization level, defined as a sum of requested resources divided
190190
by capacity, below which a node can be considered for scale down.
191-
format: float
191+
pattern: ^(0(\.[0-9]{1,2})?|1)$
192192
type: string
193193
type: object
194194
clusterName:
@@ -562,9 +562,9 @@ spec:
562562
scaleDownUtilizationThreshold is the Node utilization level, defined as a
563563
sum of requested resources divided by capacity, below which a node can be
564564
considered for scale down.
565-
format: float
566565
maxLength: 10
567566
minLength: 1
567+
pattern: ^(0(\.[0-9]{1,2})?|1)$
568568
type: string
569569
type: object
570570
clusterName:

0 commit comments

Comments
 (0)