diff options
author | José Guilherme Vanz <jvanz@jvanz.com> | 2021-07-06 21:00:03 -0300 |
---|---|---|
committer | Daniel J Walsh <dwalsh@redhat.com> | 2021-11-11 15:11:19 -0500 |
commit | 6762d5e2381d79c26ecabac8c83d31d1f49e1325 (patch) | |
tree | e14bef604ca3723c866b15691ba3a115ebd2997e /cmd | |
parent | d6d89fa79f1cb785e2f3f6b8d2295b97b19066e9 (diff) | |
download | podman-6762d5e2381d79c26ecabac8c83d31d1f49e1325.tar.gz podman-6762d5e2381d79c26ecabac8c83d31d1f49e1325.tar.bz2 podman-6762d5e2381d79c26ecabac8c83d31d1f49e1325.zip |
--authfile command line argument for image sign command.
Adds the --authfile command line argument to allow users to use
alternative authfile paths when signing images.
Replaces: https://github.com/containers/podman/pull/10975
Fixes: https://github.com/containers/podman/issues/10866
Signed-off-by: José Guilherme Vanz <jvanz@jvanz.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/podman/images/sign.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/cmd/podman/images/sign.go b/cmd/podman/images/sign.go index 96f214d0b..4c42a0bd6 100644 --- a/cmd/podman/images/sign.go +++ b/cmd/podman/images/sign.go @@ -3,6 +3,7 @@ package images import ( "os" + "github.com/containers/common/pkg/auth" "github.com/containers/common/pkg/completion" "github.com/containers/podman/v3/cmd/podman/common" "github.com/containers/podman/v3/cmd/podman/registry" @@ -48,6 +49,10 @@ func init() { flags.StringVar(&signOptions.CertDir, certDirFlagName, "", "`Pathname` of a directory containing TLS certificates and keys") _ = signCommand.RegisterFlagCompletionFunc(certDirFlagName, completion.AutocompleteDefault) flags.BoolVarP(&signOptions.All, "all", "a", false, "Sign all the manifests of the multi-architecture image") + + authfileFlagName := "authfile" + flags.StringVar(&signOptions.Authfile, authfileFlagName, auth.GetDefaultAuthFile(), "Path of the authentication file. Use REGISTRY_AUTH_FILE environment variable to override") + _ = signCommand.RegisterFlagCompletionFunc(authfileFlagName, completion.AutocompleteDefault) } func sign(cmd *cobra.Command, args []string) error { |