feature(cloud-init): Added the ability to inject extra variables#84
feature(cloud-init): Added the ability to inject extra variables#84Wafffle77 wants to merge 2 commits into
Conversation
Signed-off-by: Ethan Clark <ethan.clark@trojans.dsu.edu>
Signed-off-by: Ethan Clark <ethan.clark@trojans.dsu.edu>
synackd
left a comment
There was a problem hiding this comment.
Thank you for your contribution! I haven't tested this yet but have a couple of initial comments.
|
|
||
| // Create flags | ||
| groupRenderCmd.Flags().VarP(&cli.FormatInput, "format-input", "f", "format of input payload data (json,json-pretty,yaml)") | ||
| groupRenderCmd.Flags().StringP("extra-vars", "", "", "extra variables to be passed to the template renderer or (if starting with @) file containing extra variables to be passed to the template renderer (can be - to read from stdin)") |
There was a problem hiding this comment.
We should provide a shorthand if using StringP(), otherwise use String(). I would recommend using e as a shorthand flag here.
Also, the description is a bit long. To avoid too much wrapping, could we shorten it? Something like this to eliminate redundancy: "extra variables to be passed to the template renderer or (if starting with @) file containing extra variables (can be - to read from stdin)"
There was a problem hiding this comment.
Since we are adding an extra flag here, we'll want to update the render command in the cloud-init(1) manual page with the flag, following the formatting conventions of the commands around it.
Pull Request Template
Thank you for your contribution! Please ensure the following before submitting:
Checklist
make test(or equivalent) locally and all tests passgit commit -s) with my real name and email<filename>.licensesidecarLICENSES/directoryDescription
Adds the
--extra-varsflag toochami cloud-init group renderto allow for injecting key-value pairs into the template renderer. The passed variables can be in any supported input format and can be passed directly, read from a file, or read from stdin.Implements #82
Type of Change
For more info, see Contributing Guidelines.