diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-04-05 21:15:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-05 21:15:15 +0200 |
commit | 4f57a103441ede86431839ece0de9e8c1e1dfbca (patch) | |
tree | 1b65cc2ffafdb7b0af7a832aa77438361c120bcd /cmd/podman/images/build.go | |
parent | 254a5d4c2618cccdd4b4051034bedc9a624be1eb (diff) | |
parent | 28251f41fff80041b08f6365b4d16e3cf4ff20b5 (diff) | |
download | podman-4f57a103441ede86431839ece0de9e8c1e1dfbca.tar.gz podman-4f57a103441ede86431839ece0de9e8c1e1dfbca.tar.bz2 podman-4f57a103441ede86431839ece0de9e8c1e1dfbca.zip |
Merge pull request #9940 from rhatdan/auth
Verify existence of auth file if specified
Diffstat (limited to 'cmd/podman/images/build.go')
-rw-r--r-- | cmd/podman/images/build.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/cmd/podman/images/build.go b/cmd/podman/images/build.go index da7f5d862..04fdeab0a 100644 --- a/cmd/podman/images/build.go +++ b/cmd/podman/images/build.go @@ -11,6 +11,7 @@ import ( buildahDefine "github.com/containers/buildah/define" buildahCLI "github.com/containers/buildah/pkg/cli" "github.com/containers/buildah/pkg/parse" + "github.com/containers/common/pkg/auth" "github.com/containers/common/pkg/completion" "github.com/containers/common/pkg/config" encconfig "github.com/containers/ocicrypt/config" @@ -330,6 +331,12 @@ func buildFlagsWrapperToOptions(c *cobra.Command, contextDir string, flags *buil pullPolicy = buildahDefine.PullNever } + if c.Flag("authfile").Changed { + if err := auth.CheckAuthFile(flags.Authfile); err != nil { + return nil, err + } + } + args := make(map[string]string) if c.Flag("build-arg").Changed { for _, arg := range flags.BuildArg { |