Skip to content

Commit

Permalink
chore: Make NodeClaim Spec Immutable on v1 API (#1359)
Browse files Browse the repository at this point in the history
  • Loading branch information
engedaam committed Jun 28, 2024
1 parent 38350b8 commit 1b1cf03
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions kwok/charts/crds/karpenter.sh_nodeclaims.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,9 @@ spec:
- nodeClassRef
- requirements
type: object
x-kubernetes-validations:
- message: spec is immutable
rule: self == oldSelf
status:
description: NodeClaimStatus defines the observed state of NodeClaim
properties:
Expand Down
3 changes: 3 additions & 0 deletions pkg/apis/crds/karpenter.sh_nodeclaims.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,9 @@ spec:
- nodeClassRef
- requirements
type: object
x-kubernetes-validations:
- message: spec is immutable
rule: self == oldSelf
status:
description: NodeClaimStatus defines the observed state of NodeClaim
properties:
Expand Down
1 change: 1 addition & 0 deletions pkg/apis/v1/nodeclaim.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ type NodeClaim struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="spec is immutable"
// +required
Spec NodeClaimSpec `json:"spec"`
Status NodeClaimStatus `json:"status,omitempty"`
Expand Down

0 comments on commit 1b1cf03

Please sign in to comment.