diff --git a/kwok/charts/crds/karpenter.sh_nodeclaims.yaml b/kwok/charts/crds/karpenter.sh_nodeclaims.yaml index 24f0b8e538..83b294f119 100644 --- a/kwok/charts/crds/karpenter.sh_nodeclaims.yaml +++ b/kwok/charts/crds/karpenter.sh_nodeclaims.yaml @@ -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: diff --git a/pkg/apis/crds/karpenter.sh_nodeclaims.yaml b/pkg/apis/crds/karpenter.sh_nodeclaims.yaml index 9683b31900..615402f1d6 100644 --- a/pkg/apis/crds/karpenter.sh_nodeclaims.yaml +++ b/pkg/apis/crds/karpenter.sh_nodeclaims.yaml @@ -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: diff --git a/pkg/apis/v1/nodeclaim.go b/pkg/apis/v1/nodeclaim.go index 3b2789011e..d1d85f51c0 100644 --- a/pkg/apis/v1/nodeclaim.go +++ b/pkg/apis/v1/nodeclaim.go @@ -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"`