diff --git a/api/v1/redkeycluster_types.go b/api/v1/redkeycluster_types.go index 4a9774b..2ae84bf 100644 --- a/api/v1/redkeycluster_types.go +++ b/api/v1/redkeycluster_types.go @@ -161,6 +161,7 @@ func (redkeyCluster RedkeyCluster) GetLabels() map[string]string { // RedkeyClusterSpec defines the desired state of RedkeyCluster. // +kubebuilder:validation:XValidation:rule="self.ephemeral || has(self.storage)", message="Ephemeral or storage must be set" // +kubebuilder:validation:XValidation:rule="!(self.ephemeral && has(self.storage))", message="Ephemeral and storage cannot be combined" +// +kubebuilder:validation:XValidation:rule="!(!self.ephemeral && self.purgeKeysOnRebalance == true)", message="Cannot set purgeKeysOnRebalance to true for non-ephemeral clusters" type RedkeyClusterSpec struct { // +kubebuilder:validation:Optional // RedisAuth diff --git a/config/crd/bases/redis.inditex.dev_redkeyclusters.yaml b/config/crd/bases/redis.inditex.dev_redkeyclusters.yaml index e491259..bb1c2c1 100644 --- a/config/crd/bases/redis.inditex.dev_redkeyclusters.yaml +++ b/config/crd/bases/redis.inditex.dev_redkeyclusters.yaml @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2025 INDUSTRIA DE DISEÑO TEXTIL S.A. (INDITEX S.A.) +# SPDX-License-Identifier: Apache-2.0 + --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition @@ -7761,6 +7764,8 @@ spec: rule: self.ephemeral || has(self.storage) - message: Ephemeral and storage cannot be combined rule: '!(self.ephemeral && has(self.storage))' + - message: Cannot set purgeKeysOnRebalance to true for non-ephemeral clusters + rule: '!(!self.ephemeral && self.purgeKeysOnRebalance == true)' status: properties: conditions: