Skip to content
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

Omit KubeletConfiguration and Limits from the Provisioner Spec if empty #1497

Merged
merged 1 commit into from
Mar 11, 2022

Conversation

bwagner5
Copy link
Contributor

1. Issue, if available:
N/A

2. Description of changes:

  • KubeletConfiguration and Limits were being included into the provisioner spec even when they are empty. This is because both of these types are structs and not pointers or another pointer type. omitempty will not work with structs, so this PR changes the Spec to use pointers.

Example Before:

spec:
   kubeletConfiguration: {}
   limits: {}
   provider:
     apiVersion: extensions.karpenter.sh/v1alpha1
     instanceProfile: KarpenterNodeInstanceProfile-karpenter-demo
     kind: AWS
     securityGroupSelector:
       kubernetes.io/cluster/karpenter-demo: '*'
     subnetSelector:
       kubernetes.io/cluster/karpenter-demo: '*'

Example After:

spec:
   provider:
     apiVersion: extensions.karpenter.sh/v1alpha1
     instanceProfile: KarpenterNodeInstanceProfile-karpenter-demo
     kind: AWS
     securityGroupSelector:
       kubernetes.io/cluster/karpenter-demo: '*'
     subnetSelector:
       kubernetes.io/cluster/karpenter-demo: '*'

3. How was this change tested?

  • Tested a manual scale-up with AL2 and Bottlerocket

4. Does this change impact docs?

  • Yes, PR includes docs updates
  • Yes, issue opened: link to issue
  • No

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@netlify
Copy link

netlify bot commented Mar 10, 2022

✔️ Deploy Preview for karpenter-docs-prod canceled.

🔨 Explore the source changes: a33a12f

🔍 Inspect the deploy log: https://app.netlify.com/sites/karpenter-docs-prod/deploys/622a87a2828d23000842b7ea

@bwagner5 bwagner5 changed the title omit KubeletConfiguration and Limits from Spec if empty Omit KubeletConfiguration and Limits from the AWS Provider Spec if empty Mar 10, 2022
@bwagner5 bwagner5 changed the title Omit KubeletConfiguration and Limits from the AWS Provider Spec if empty Omit KubeletConfiguration and Limits from the Provisioner Spec if empty Mar 10, 2022
@bwagner5 bwagner5 force-pushed the fix-persistent-defaults branch from b288072 to a33a12f Compare March 10, 2022 23:20
Copy link
Contributor

@ellistarn ellistarn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing!

@ellistarn ellistarn merged commit d368d42 into aws:main Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants