Introduce customisation mode option#308
Conversation
| func resolveOutputPaths(args *cmd.CustomizeFlags) (imagePath, configPath string) { | ||
| imagePath = args.OutputPath |
There was a problem hiding this comment.
Would a nil check be worth it here?
There was a problem hiding this comment.
I don't seem to understand -- the args variable cannot be nil no matter what we do.
There was a problem hiding this comment.
I was reviewing the code when I should have been sleeping instead.
| return nil | ||
| } | ||
|
|
||
| func resolveOutputPaths(args *cmd.CustomizeFlags) (imagePath, configPath string) { |
There was a problem hiding this comment.
All the others functions doesn't declare output variables but only the type, maybe good to be consistent?
There was a problem hiding this comment.
It's the other way around. It's good to name those where the caller would instead have to guess.
There was a problem hiding this comment.
If I understand correctly, configPath is not supposed to be set when mode is embedded? can we capture that in a comment perhaps?
| }, | ||
| &cli.StringFlag{ | ||
| Name: "mode", | ||
| Usage: "Customization mode, 'embedded' or 'split'", |
There was a problem hiding this comment.
It is quite hard to understand for me. maybe
Usage: "configuration output mode, 'embedded' (config within image, default) or 'split' (config separate to image)" | baseName := strings.TrimSuffix(filename, filepath.Ext(filename)) | ||
|
|
||
| configPath = filepath.Join(outputDir, baseName+"-config") | ||
| } |
There was a problem hiding this comment.
can we at least warn if args.Mode is neither "split" nor "combined" ? typos galore otherwise.
| DefaultText: "image-<timestamp>.<image-type>", | ||
| }, | ||
| &cli.StringFlag{ | ||
| Name: "mode", |
There was a problem hiding this comment.
maybe we could just make it a boolean, --split-config or something like that? "--mode" is such a generic word, we might ourselves need to use it in some other context in two years from now.
|
@atanasdinov my apologies, I merged the other patch and now this conflicts. let me know if I should rebase. |
7d121c3 to
77e11ef
Compare
Signed-off-by: Atanas Dinov <atanas.dinov@suse.com>
Signed-off-by: Atanas Dinov <atanas.dinov@suse.com>
77e11ef to
39f30d8
Compare
Introduces a new
--modeCLI parameter to customize command with the following options:The use cases that are going to utilise this feature are:
--mode config-only)In order to utilise the configuration directory in a QEMU VM, you can simply:
Note: Currently the networking, Ignition data, and custom scripts are going to be extracted to the configuration directory. All files which are part of the overlay (incl. systemd extensions, Kubernetes manifests, Helm charts) will proceed to be part of the image. We will have to properly distribute those to the configuration directory instead later.