Skip to content

Commit

Permalink
chore: Reject NodePools and NodeClaims if they don't have spec (#1041)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-innis authored Feb 22, 2024
1 parent 3bc904a commit 6c4883c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions pkg/apis/crds/karpenter.sh_nodeclaims.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,8 @@ spec:
description: ProviderID of the corresponding node object
type: string
type: object
required:
- spec
type: object
served: true
storage: true
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/crds/karpenter.sh_nodepools.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,8 @@ spec:
description: Resources is the list of resources that have been provisioned.
type: object
type: object
required:
- spec
type: object
served: true
storage: true
Expand Down
3 changes: 2 additions & 1 deletion pkg/apis/v1beta1/nodeclaim.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ type NodeClaim struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec NodeClaimSpec `json:"spec,omitempty"`
// +required
Spec NodeClaimSpec `json:"spec"`
Status NodeClaimStatus `json:"status,omitempty"`
}

Expand Down
3 changes: 2 additions & 1 deletion pkg/apis/v1beta1/nodepool.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ type NodePool struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec NodePoolSpec `json:"spec,omitempty"`
// +required
Spec NodePoolSpec `json:"spec"`
Status NodePoolStatus `json:"status,omitempty"`
}

Expand Down

0 comments on commit 6c4883c

Please sign in to comment.