Skip to content

Commit

Permalink
Merge pull request red-hat-storage#73 from rewantsoni/scc-immutable
Browse files Browse the repository at this point in the history
api: make storageClassClaim immutable
  • Loading branch information
openshift-merge-bot[bot] authored Feb 16, 2024
2 parents 5695c2f + 4f9d5e1 commit 1b9b7fb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion api/v1alpha1/storageclassclaim_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ type StorageClassClaim struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec StorageClassClaimSpec `json:"spec,omitempty"`
//+kubebuilder:validation:Required
//+kubebuilder:validation:XValidation:rule="oldSelf == self",message="spec is immutable"
Spec StorageClassClaimSpec `json:"spec"`
Status StorageClassClaimStatus `json:"status,omitempty"`
}

Expand Down
5 changes: 5 additions & 0 deletions config/crd/bases/ocs.openshift.io_storageclassclaims.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ spec:
- storageClient
- type
type: object
x-kubernetes-validations:
- message: spec is immutable
rule: oldSelf == self
status:
description: StorageClassClaimStatus defines the observed state of StorageClassClaim
properties:
Expand All @@ -84,6 +87,8 @@ spec:
type: string
type: array
type: object
required:
- spec
type: object
served: true
storage: true
Expand Down

0 comments on commit 1b9b7fb

Please sign in to comment.