diff options
author | Arthur Sengileyev <arthur.sengileyev@gmail.com> | 2022-08-22 17:19:54 +0300 |
---|---|---|
committer | Arthur Sengileyev <arthur.sengileyev@gmail.com> | 2022-08-30 13:35:07 +0300 |
commit | 08a2851bae2cd70a0e0ca7463f6bf7abea0901a5 (patch) | |
tree | 0f34ce2a20a8cfdfbb4cc0105e71944f526aafc7 /cmd | |
parent | 468aa6478c73e4acd8708ce8bb0bb5a056f329c2 (diff) | |
download | podman-08a2851bae2cd70a0e0ca7463f6bf7abea0901a5.tar.gz podman-08a2851bae2cd70a0e0ca7463f6bf7abea0901a5.tar.bz2 podman-08a2851bae2cd70a0e0ca7463f6bf7abea0901a5.zip |
Allow to override default username via command line
Signed-off-by: Arthur Sengileyev <arthur.sengileyev@gmail.com>
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/podman/machine/init.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cmd/podman/machine/init.go b/cmd/podman/machine/init.go index def3334e8..0848147a8 100644 --- a/cmd/podman/machine/init.go +++ b/cmd/podman/machine/init.go @@ -42,7 +42,6 @@ func init() { }) flags := initCmd.Flags() cfg := registry.PodmanConfig() - initOpts.Username = cfg.Config.Machine.User cpusFlagName := "cpus" flags.Uint64Var( @@ -89,6 +88,10 @@ func init() { ) _ = flags.MarkHidden("reexec") + UsernameFlagName := "username" + flags.StringVar(&initOpts.Username, UsernameFlagName, cfg.Machine.User, "Username used in qcow image") + _ = initCmd.RegisterFlagCompletionFunc(UsernameFlagName, completion.AutocompleteDefault) + ImagePathFlagName := "image-path" flags.StringVar(&initOpts.ImagePath, ImagePathFlagName, cfg.Machine.Image, "Path to qcow image") _ = initCmd.RegisterFlagCompletionFunc(ImagePathFlagName, completion.AutocompleteDefault) |