diff --git a/apis/csiaddons/v1alpha1/networkfence_types.go b/apis/csiaddons/v1alpha1/networkfence_types.go index 2bf9b478c..7f0373901 100644 --- a/apis/csiaddons/v1alpha1/networkfence_types.go +++ b/apis/csiaddons/v1alpha1/networkfence_types.go @@ -57,6 +57,7 @@ type SecretSpec struct { // NetworkFenceSpec defines the desired state of NetworkFence // +kubebuilder:validation:XValidation:rule="has(self.parameters) == has(oldSelf.parameters)",message="parameters are immutable" +// +kubebuilder:validation:XValidation:rule="has(self.secret) == has(oldSelf.secret)",message="secret is immutable" type NetworkFenceSpec struct { // Driver contains the name of CSI driver. // +kubebuilder:validation:Required diff --git a/config/crd/bases/csiaddons.openshift.io_networkfences.yaml b/config/crd/bases/csiaddons.openshift.io_networkfences.yaml index 32d788a37..5aba29f2f 100644 --- a/config/crd/bases/csiaddons.openshift.io_networkfences.yaml +++ b/config/crd/bases/csiaddons.openshift.io_networkfences.yaml @@ -108,6 +108,8 @@ spec: x-kubernetes-validations: - message: parameters are immutable rule: has(self.parameters) == has(oldSelf.parameters) + - message: secret is immutable + rule: has(self.secret) == has(oldSelf.secret) status: description: NetworkFenceStatus defines the observed state of NetworkFence properties: diff --git a/deploy/controller/crds.yaml b/deploy/controller/crds.yaml index 3e3777107..8171c0adb 100644 --- a/deploy/controller/crds.yaml +++ b/deploy/controller/crds.yaml @@ -216,6 +216,8 @@ spec: x-kubernetes-validations: - message: parameters are immutable rule: has(self.parameters) == has(oldSelf.parameters) + - message: secret is immutable + rule: has(self.secret) == has(oldSelf.secret) status: description: NetworkFenceStatus defines the observed state of NetworkFence properties: