-
Notifications
You must be signed in to change notification settings - Fork 15
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 cloud_init argument to image creation #188
Add cloud_init argument to image creation #188
Conversation
This adds the `cloud_init` flag to the image create step.
@stvnjacobs I think the first implementation you mentioned ( |
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.
LGTM! This PR doesn't add proper E2E testing for cloud_init
given #185 hasn't been merged quite yet but the change is simple enough that unit tests should be sufficient
Co-authored-by: Zhiwei Liang <121905282+zliang-akamai@users.noreply.github.com>
Failing tests are unrelated to this PR 🙂 |
📝 Description
This adds the
cloud_init
flag to the image create step.✔️ How to Test
There are no unit or integration tests included with this patch. I am putting it up for consideration before those are completed.
To test manually, and to get a working cloud-init image, an image can be created using an existing image which has the cloud-init capability.
📷 Preview
🤔 Additional Thoughts
Config structure
I was uncertain on the best way to format the config. I am sure I am over thinking it, but what good does that do if I don't share where my head is at.
POST /v4/images
: When an image is created,cloud-init
is a boolean.GET /v4/images/{imageId}
: When an image is viewed,cloud-init
is one of an array ofcapabilities
.I was unsure whether to structure the config so it matches the create arguments:
Or to model it like the image resource it creates.
In these situations I typically refer to official hashicorp cloud provider plugins, but I couldn't really find anything comparable.
Unfamiliar with codebase
I admit to being a bit rusty around these parts. the
hcl2spec.go
was new to me, and inconfig.go
is wasn't sure ifrequired:"false"
was really needed. I am just committing this as a proof of what worked for me, not what is fully correct.