Skip to content

Commit

Permalink
try to add immutability validation rule to storagegroup spec
Browse files Browse the repository at this point in the history
Signed-off-by: Shi, Crane <[email protected]>
  • Loading branch information
CraneShiEMC committed Jul 10, 2023
1 parent d656660 commit 1db5a46
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions api/v1/storagegroupcrd/storagegroup_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ import (
type StorageGroup struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec api.StorageGroupSpec `json:"spec,omitempty"`
Status api.StorageGroupStatus `json:"status,omitempty"`

// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="updates to storagegroup spec are forbidden"
Spec api.StorageGroupSpec `json:"spec,omitempty"`
Status api.StorageGroupStatus `json:"status,omitempty"`
}

// +kubebuilder:object:root=true
Expand Down

0 comments on commit 1db5a46

Please sign in to comment.