Skip to content

Commit

Permalink
replication: make parameters as immutable
Browse files Browse the repository at this point in the history
mark parameters as immutable once created
which means we are not able to add/delete
or update the parameters once created.

Signed-off-by: Madhu Rajanna <[email protected]>
  • Loading branch information
Madhu-1 committed Nov 9, 2023
1 parent 3be3bf9 commit a048e22
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
// VolumeReplicationClassSpec specifies parameters that an underlying storage system uses
// when creating a volume replica. A specific VolumeReplicationClass is used by specifying
// its name in a VolumeReplication object.
// +kubebuilder:validation:XValidation:rule="has(self.parameters) == has(oldSelf.parameters)",message="parameters are immutable"
type VolumeReplicationClassSpec struct {
// Provisioner is the name of storage provisioner
// +kubebuilder:validation:Required
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ spec:
required:
- provisioner
type: object
x-kubernetes-validations:
- message: parameters are immutable
rule: has(self.parameters) == has(oldSelf.parameters)
status:
description: VolumeReplicationClassStatus defines the observed state of
VolumeReplicationClass.
Expand Down
3 changes: 3 additions & 0 deletions deploy/controller/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,9 @@ spec:
required:
- provisioner
type: object
x-kubernetes-validations:
- message: parameters are immutable
rule: has(self.parameters) == has(oldSelf.parameters)
status:
description: VolumeReplicationClassStatus defines the observed state of
VolumeReplicationClass.
Expand Down

0 comments on commit a048e22

Please sign in to comment.