-
Notifications
You must be signed in to change notification settings - Fork 567
CNTRLPLANE-3160: Drop AutoNodeKarpenter feature gate and promote EC2NodeClass to v1 #8166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
df33c35
9ce89af
52f7f8c
d64c222
366f255
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -202,11 +202,6 @@ linters: | |
| - kubeapilinter | ||
| path: hypershift/v1beta1/openstack.go | ||
| text: 'arrayofstruct: OpenStackPlatformSpec.Subnets is an array of structs, but the struct has no required fields. At least one field should be marked as required to prevent ambiguous YAML configurations' | ||
| - linters: | ||
| - kubeapilinter | ||
| path: karpenter/v1beta1/karpenter_types.go | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we add
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the exception is not actually needed, the struct already has // +kubebuilder:validation:MinProperties=1
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this triggered an offline discussion for me with Joel. This would still hit the linter on a new field or a field change. "Not having a specific requirement but at least one" is not an ideal choice when the struct belongs to a slice. The reasoning is that with all fields optional, a user could accidentally write two separate items thinking they're writing one (or the other way around). I think we'll accepted that here.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To put the slice thing into an example vs Is a very subtle difference that you might glance over, but has a very different meaning to the API. This has caught people out in security contexts before with pretty nasty results |
||
| text: 'arrayofstruct: OpenshiftEC2NodeClassSpec.CapacityReservationSelectorTerms is an array of structs, but the struct has no required fields. At least one field should be marked as required to prevent ambiguous YAML configurations' | ||
|
|
||
| # conditions (1 issue) | ||
| - linters: | ||
| - kubeapilinter | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,9 +16,6 @@ | |
| { | ||
| "disabled": [], | ||
| "enabled": [ | ||
| { | ||
| "name": "AutoNodeKarpenter", | ||
| }, | ||
| { | ||
| "name": "ExternalOIDC" | ||
| }, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,9 +16,6 @@ | |
| { | ||
| "disabled": [], | ||
| "enabled": [ | ||
| { | ||
| "name": "AutoNodeKarpenter", | ||
| }, | ||
| { | ||
| "name": "ExternalOIDC" | ||
| }, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -230,9 +230,8 @@ type HostedControlPlaneSpec struct { | |
| // using the specified provisioner (e.g. Karpenter) instead of requiring | ||
| // manual NodePool management. | ||
| // | ||
| // +openshift:enable:FeatureGate=AutoNodeKarpenter | ||
| // +optional | ||
| AutoNode *AutoNode `json:"autoNode,omitempty"` | ||
| AutoNode AutoNode `json:"autoNode,omitzero"` | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just to know more, is this change expected by promoting a featureGate or this is due to the new api linter?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is expected that any API follow best practices, specially if it's GA. The linter enforces those best practices. |
||
|
|
||
| // nodeSelector when specified, must be true for the pods managed by the HostedCluster to be scheduled. | ||
| // | ||
|
|
@@ -414,7 +413,6 @@ type HostedControlPlaneStatus struct { | |
| NodeCount *int `json:"nodeCount,omitempty"` | ||
|
|
||
| // autoNode contains the observed state of the autoNode (Karpenter) provisioner. | ||
| // +openshift:enable:FeatureGate=AutoNodeKarpenter | ||
| // +optional | ||
| AutoNode AutoNodeStatus `json:"autoNode,omitzero"` | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -642,9 +642,8 @@ type HostedClusterSpec struct { | |
| // autoNode specifies the configuration for automatic node provisioning and lifecycle management. | ||
| // When set, the provisioner(e.g. Karpenter) will be used to provision nodes for targeted workloads. | ||
| // | ||
| // +openshift:enable:FeatureGate=AutoNodeKarpenter | ||
| // +optional | ||
| AutoNode *AutoNode `json:"autoNode,omitempty"` | ||
| AutoNode AutoNode `json:"autoNode,omitzero"` | ||
|
|
||
| // etcd specifies configuration for the control plane etcd cluster. The | ||
| // default managementType is Managed. Once set, the managementType cannot be | ||
|
|
@@ -1398,7 +1397,7 @@ type ProvisionerConfig struct { | |
| // | ||
| // +optional | ||
| // +unionMember | ||
| Karpenter *KarpenterConfig `json:"karpenter,omitempty"` | ||
| Karpenter KarpenterConfig `json:"karpenter,omitzero"` | ||
| } | ||
|
|
||
| // KarpenterConfig specifies the configuration for the Karpenter provisioner | ||
|
|
@@ -1418,7 +1417,7 @@ type KarpenterConfig struct { | |
| // | ||
| // +optional | ||
| // +unionMember | ||
| AWS *KarpenterAWSConfig `json:"aws,omitempty"` | ||
| AWS KarpenterAWSConfig `json:"aws,omitzero"` | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comment as above |
||
| } | ||
|
|
||
| // KarpenterAWSConfig specifies AWS-specific configuration for the Karpenter provisioner. | ||
|
|
@@ -2174,7 +2173,6 @@ type HostedClusterStatus struct { | |
| Platform *PlatformStatus `json:"platform,omitempty"` | ||
|
|
||
| // autoNode contains the observed state of the autoNode (Karpenter) provisioner. | ||
| // +openshift:enable:FeatureGate=AutoNodeKarpenter | ||
| // +optional | ||
| AutoNode AutoNodeStatus `json:"autoNode,omitzero"` | ||
|
|
||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guard the CRD copy with directory creation.
Line 192 assumes
.../zz_generated.crd-manifests/already exists. If it doesn’t,make karpenter-apifails at this step.Suggested hardening
$(CONTROLLER_GEN) $(CRD_OPTIONS) paths="./api/karpenter/..." output:crd:artifacts:config=karpenter-operator/controllers/karpenter/assets + mkdir -p karpenter-operator/controllers/karpenter/assets/zz_generated.crd-manifests cp karpenter-operator/controllers/karpenter/assets/karpenter.hypershift.openshift.io_openshiftec2nodeclasses.yaml karpenter-operator/controllers/karpenter/assets/zz_generated.crd-manifests/openshiftec2nodeclasses.crd.yaml🤖 Prompt for AI Agents