From d7c0f968ca60994306c8c76cd8e4e0a677fe9ada Mon Sep 17 00:00:00 2001 From: Qi Wang Date: Fri, 25 Oct 2019 21:16:37 -0400 Subject: fix bug check nonexist authfile Use GetDefaultAuthFile() from buildah. For podman command(except login), if authfile does not exist returns error. close #4328 Signed-off-by: Qi Wang --- cmd/podman/build.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'cmd/podman/build.go') diff --git a/cmd/podman/build.go b/cmd/podman/build.go index bbc1d5b5f..fbf85fc97 100644 --- a/cmd/podman/build.go +++ b/cmd/podman/build.go @@ -155,6 +155,11 @@ func buildCmd(c *cliconfig.BuildValues) error { tags = tags[1:] } } + if c.BudResults.Authfile != "" { + if _, err := os.Stat(c.BudResults.Authfile); err != nil { + return errors.Wrapf(err, "error getting authfile %s", c.BudResults.Authfile) + } + } pullPolicy := imagebuildah.PullNever if c.Pull { -- cgit v1.2.3-54-g00ecf