-
Notifications
You must be signed in to change notification settings - Fork 164
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 support for writing files to containers from cloud-init config #3520
add support for writing files to containers from cloud-init config #3520
Conversation
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.
We do need to support the old format since the users have existing cloud-init configured for their edge applications.
So need to detect which format is in use to handle both.
9b7ee46
to
fe0d37e
Compare
brought back the support for old cloud-init format and fixed unit tests. |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #3520 +/- ##
==========================================
+ Coverage 20.51% 20.53% +0.02%
==========================================
Files 208 209 +1
Lines 45381 45512 +131
==========================================
+ Hits 9308 9345 +37
- Misses 35390 35479 +89
- Partials 683 688 +5
☔ View full report in Codecov by Sentry. |
You can ignore those yetus complaints. It is supposed to only look at lines/functions which were changed in your PR but that doesn't always work. |
fe0d37e
to
f3f5f19
Compare
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.
Still some minor issues, but approving so we can get some test results.
f3f5f19
to
f9b4bc7
Compare
added tests for the new cloudconfig package |
b14e87d
to
24407e5
Compare
We are adding the support for "write_files" section in cloud-init config for containers. Also the definition of envs is moved to the section "runcmd" with lines like "- VAR=value", however the old syntax of "VAR=value" is still supported. The rest of cloud-init config is ignored. Signed-off-by: Paul Gaiduk <paulg@zededa.com>
24407e5
to
b34b102
Compare
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.
Can you update the PR description to capture that we do handle the old format.
Also, is there any file in docs or pkg/pillar/docs which specifies the env=value format? Any one discuss cloud-init or userdata where we should add such specification?
It might make sense to rewrite/expand the first paragraph in docs/ECO-METADATA.md for this.
Feel free to merge this and do that doc update in a separate PR if you'd like.
@eriknordmark I updated the PR description, but I don't have the write access to the repo to merge. I think we should create a new doc file |
Signed-off-by: Paul Gaiduk <paulg@zededa.com>
44f6b02
to
e71e15e
Compare
Makes sense. I'll merge this for now |
We are extending the support for the cloud-init config for containers. While the old config format with
still remains available we also introduce the support for the original cloud-init config syntax with support for fields
runcmd
(only for defining envs) andwrite_files
, like in the following exampleThe section
runcmd
will only be used for providing envs, while the new sectionwrite_files
can be used to write files to the containers in the usual cloud-init way. The option to change the owner is however not supported at the moment.The rest of the field of the cloud-init configuration will be ignored.