diff --git a/api/v1beta1/hyperconverged_types.go b/api/v1beta1/hyperconverged_types.go index 8c4178882..151976605 100644 --- a/api/v1beta1/hyperconverged_types.go +++ b/api/v1beta1/hyperconverged_types.go @@ -91,7 +91,7 @@ type HyperConvergedSpec struct { // ResourceRequirements describes the resource requirements for the operand workloads. // +kubebuilder:default={"vmiCPUAllocationRatio": 10} - // +kubebuilder:validation:XValidation:rule="!has(self.vmiCPUAllocationRatio) || self.vmiCPUAllocationRatio != 1",message="Automatic CPU limits are incompatible with a VMI CPU allocation ratio of 1" + // +kubebuilder:validation:XValidation:rule="!has(self.vmiCPUAllocationRatio) || self.vmiCPUAllocationRatio > 0",message="vmiCPUAllocationRatio must be greater than 0" // +optional ResourceRequirements *OperandResourceRequirements `json:"resourceRequirements,omitempty"` diff --git a/config/crd/bases/hco.kubevirt.io_hyperconvergeds.yaml b/config/crd/bases/hco.kubevirt.io_hyperconvergeds.yaml index efd4a099c..ceee982fb 100644 --- a/config/crd/bases/hco.kubevirt.io_hyperconvergeds.yaml +++ b/config/crd/bases/hco.kubevirt.io_hyperconvergeds.yaml @@ -2730,10 +2730,9 @@ spec: type: integer type: object x-kubernetes-validations: - - message: Automatic CPU limits are incompatible with a VMI CPU allocation - ratio of 1 + - message: vmiCPUAllocationRatio must be greater than 0 rule: '!has(self.vmiCPUAllocationRatio) || self.vmiCPUAllocationRatio - != 1' + > 0' scratchSpaceStorageClass: description: |- Override the storage class used for scratch space during transfer operations. The scratch space storage class diff --git a/deploy/crds/hco00.crd.yaml b/deploy/crds/hco00.crd.yaml index efd4a099c..ceee982fb 100644 --- a/deploy/crds/hco00.crd.yaml +++ b/deploy/crds/hco00.crd.yaml @@ -2730,10 +2730,9 @@ spec: type: integer type: object x-kubernetes-validations: - - message: Automatic CPU limits are incompatible with a VMI CPU allocation - ratio of 1 + - message: vmiCPUAllocationRatio must be greater than 0 rule: '!has(self.vmiCPUAllocationRatio) || self.vmiCPUAllocationRatio - != 1' + > 0' scratchSpaceStorageClass: description: |- Override the storage class used for scratch space during transfer operations. The scratch space storage class diff --git a/deploy/index-image/community-kubevirt-hyperconverged/1.14.0/manifests/hco00.crd.yaml b/deploy/index-image/community-kubevirt-hyperconverged/1.14.0/manifests/hco00.crd.yaml index efd4a099c..ceee982fb 100644 --- a/deploy/index-image/community-kubevirt-hyperconverged/1.14.0/manifests/hco00.crd.yaml +++ b/deploy/index-image/community-kubevirt-hyperconverged/1.14.0/manifests/hco00.crd.yaml @@ -2730,10 +2730,9 @@ spec: type: integer type: object x-kubernetes-validations: - - message: Automatic CPU limits are incompatible with a VMI CPU allocation - ratio of 1 + - message: vmiCPUAllocationRatio must be greater than 0 rule: '!has(self.vmiCPUAllocationRatio) || self.vmiCPUAllocationRatio - != 1' + > 0' scratchSpaceStorageClass: description: |- Override the storage class used for scratch space during transfer operations. The scratch space storage class diff --git a/deploy/olm-catalog/community-kubevirt-hyperconverged/1.14.0/manifests/hco00.crd.yaml b/deploy/olm-catalog/community-kubevirt-hyperconverged/1.14.0/manifests/hco00.crd.yaml index efd4a099c..ceee982fb 100644 --- a/deploy/olm-catalog/community-kubevirt-hyperconverged/1.14.0/manifests/hco00.crd.yaml +++ b/deploy/olm-catalog/community-kubevirt-hyperconverged/1.14.0/manifests/hco00.crd.yaml @@ -2730,10 +2730,9 @@ spec: type: integer type: object x-kubernetes-validations: - - message: Automatic CPU limits are incompatible with a VMI CPU allocation - ratio of 1 + - message: vmiCPUAllocationRatio must be greater than 0 rule: '!has(self.vmiCPUAllocationRatio) || self.vmiCPUAllocationRatio - != 1' + > 0' scratchSpaceStorageClass: description: |- Override the storage class used for scratch space during transfer operations. The scratch space storage class diff --git a/tests/func-tests/validation_test.go b/tests/func-tests/validation_test.go index 104012644..80418f7d8 100644 --- a/tests/func-tests/validation_test.go +++ b/tests/func-tests/validation_test.go @@ -44,7 +44,7 @@ var _ = Describe("Check CR validation", Label("validation"), Serial, func() { }).WithTimeout(10 * time.Second).WithPolling(500 * time.Millisecond).WithContext(ctx).Should(outcome) }, Entry("succeed when VMI CPU allocation is nil", nil, Succeed()), - Entry("fail when VMI CPU allocation is 1", ptr.To(1), MatchError(ContainSubstring("Automatic CPU limits are incompatible with a VMI CPU allocation ratio of 1"))), + Entry("fail when VMI CPU allocation is 0", ptr.To(0), MatchError(ContainSubstring("vmiCPUAllocationRatio must be greater than 0"))), Entry("succeed when VMI CPU allocation is 2", ptr.To(2), Succeed()), ) })