Skip to content

Commit

Permalink
Verify existence of auth file if specified
Browse files Browse the repository at this point in the history
Fixes: containers#9572

Signed-off-by: Daniel J Walsh <[email protected]>

<MH: Fixed cherry-pick conflicts>

Signed-off-by: Matthew Heon <[email protected]>
  • Loading branch information
rhatdan authored and mheon committed Apr 16, 2021
1 parent 0cbd322 commit 5bca115
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cmd/podman/images/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"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"
Expand Down Expand Up @@ -330,6 +331,12 @@ func buildFlagsWrapperToOptions(c *cobra.Command, contextDir string, flags *buil
pullPolicy = define.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 {
Expand Down

0 comments on commit 5bca115

Please sign in to comment.