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
FR-5549 - Make sure customized cloud-init files are valid #147
Conversation
Codecov Report
@@ Coverage Diff @@
## main #147 +/- ##
==========================================
- Coverage 87.33% 87.32% -0.02%
==========================================
Files 11 11
Lines 2440 2438 -2
==========================================
- Hits 2131 2129 -2
Misses 289 289
Partials 20 20
|
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.
By principle, I think what we want is to warn or error-out on users submitting wrong cloud-init file contents instead of implicitly fixing the input for them. I know this might be a bit of an additional burden for users, but the idea behind the cloud-init customization was always: allow providing 1-to-1 contents for the respective cloud-init metadata. So I'm thinking of these as 1:1 content per what is in the image definition. Adding things without the users knowing seems weird. Also, it might encourage people to misunderstand how proper cloud-init files should be structured - if someone forgets to add the #cloud-init header, then they might forget to do it when they're not using ubuntu-image.
So I'd recommend us erroring out, or maybe only warning, when someone provides an 'invalid' cloud-init file instead of doing it for them.
OK, I understand the position and I agree with having a 1:1 content between a proper cloud-init and the content of the image definition. |
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.
Looking good! Test coverage is good as well. Let me merge this.
Fixes LP: #2032585