From b56b4b53744c59cad942278ff34a0b0616a7aa60 Mon Sep 17 00:00:00 2001 From: Tino Rusch Date: Sun, 20 Jun 2021 16:11:54 +0200 Subject: read secret config from config file if no user data. feat: read secret config from config file if the user hasn't entered explicit config values feat: allow to specify `--driver-opts opt1=val1,opt2=val2` in the secret create command to allow overriding the default values fix: show driver options in `podman secret inspect` Signed-off-by: Tino Rusch --- cmd/podman/secrets/create.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'cmd') diff --git a/cmd/podman/secrets/create.go b/cmd/podman/secrets/create.go index f5739e99a..8c268615c 100644 --- a/cmd/podman/secrets/create.go +++ b/cmd/podman/secrets/create.go @@ -42,8 +42,14 @@ func init() { flags := createCmd.Flags() driverFlagName := "driver" - flags.StringVar(&createOpts.Driver, driverFlagName, "file", "Specify secret driver") + optsFlagName := "driver-opts" + + cfg := registry.PodmanConfig() + + flags.StringVar(&createOpts.Driver, driverFlagName, cfg.Secrets.Driver, "Specify secret driver") + flags.StringToStringVar(&createOpts.Opts, optsFlagName, cfg.Secrets.Opts, "Specify driver specific options") _ = createCmd.RegisterFlagCompletionFunc(driverFlagName, completion.AutocompleteNone) + _ = createCmd.RegisterFlagCompletionFunc(optsFlagName, completion.AutocompleteNone) envFlagName := "env" flags.BoolVar(&env, envFlagName, false, "Read secret data from environment variable") -- cgit v1.2.3-54-g00ecf