-
Notifications
You must be signed in to change notification settings - Fork 33
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
Add flag to allow userdata to be uncompressed #216
Conversation
✅ Deploy Preview for kubernetes-sigs-cluster-api-cloudstack ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: hrak The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hi @hrak. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/ok-to-test |
// cloud-init has built-in support for gzip-compressed user data, ignition does not | ||
// | ||
// +optional | ||
UncompressedUserData *bool `json:"uncompressedUserData,omitempty"` |
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.
Does this need to be a pointer? The zero value of a bool
will be false and we could add a the default marker to be abundantly clear.
+kubebuilder:default=false
+optional
This would simplify some of the implementation code. What do you think?
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.
@chrisdoherty4 The main reason was to be able to check for absolute nil (not false)
if uncompressed != nil && !*uncompressed
but i will gladly adapt if you think that's not necessary.
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.
No worries. Do you have a use-case where we'd take some different action as a result of it being nil
vs false
?
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.
I used this approach mainly because there is no default value for this setting and i was not sure what it would evaluate to. This is also heavily inspired by cluster-api-provider-aws where they take a similar approach.
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.
The only time we really need a pointer is to differentiate between a user setting the value or not. If we don't need to differentiate those cases then +kubebuilder:default=false
should be fine and would make whatever interprets this simpler because they don't need to perform nil pointer checks.
Currently, I don't see a need to differentiate set vs not set. Are you able to clarify?
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.
Hi @chrisdoherty4 i looked a bit further into the reasoning for the pointer. Apparently this is part of the Kubernetes API conventions / best practices (see here.
Other references:
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.
That's good to know, thanks for looking into it.
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.
Holistically, this look great!
Is there anything i can do to move this forward? Are you OK with my comments? |
/retest |
@hrak: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
@jweite-amazon I don't know how to fix these tests. It looks like the Go version of the tests is too old. Can you assist? edit: Yup, definitely too old:
|
@hrak, please stand by. Investigation into this is taking place. |
Looking into fixing this, however it won't be done particularly quickly. These changes seem sound. /lgtm |
/lgtm |
Issue #, if available: #215
Description of changes:
This PR adds a boolean flag to the CloudstackMachine spec that allows userdata to be uncompressed. This is required for ignition support (Flatcar f.e.)
Please let me know if this is complete, this is my first PR that touches the api.
Testing performed:
Compiled and build new CAPC container image (which also includes the changes from #214 btw), tested using kind and Cloudstack 4.17 using Flatcar stable 3374.2.3. Was able to spin up a full cluster using 3 control plane nodes and 2 workers.
I used the feature flag
export EXP_KUBEADM_BOOTSTRAP_FORMAT_IGNITION=true
and the following cluster template:By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.