aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/containers/buildah/pkg/cli/common.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/containers/buildah/pkg/cli/common.go')
-rw-r--r--vendor/github.com/containers/buildah/pkg/cli/common.go17
1 files changed, 2 insertions, 15 deletions
diff --git a/vendor/github.com/containers/buildah/pkg/cli/common.go b/vendor/github.com/containers/buildah/pkg/cli/common.go
index 9cd3b65f1..8e7f7dd4a 100644
--- a/vendor/github.com/containers/buildah/pkg/cli/common.go
+++ b/vendor/github.com/containers/buildah/pkg/cli/common.go
@@ -13,6 +13,7 @@ import (
"github.com/containers/buildah"
"github.com/containers/buildah/pkg/parse"
"github.com/containers/buildah/util"
+ "github.com/containers/common/pkg/auth"
"github.com/containers/common/pkg/config"
"github.com/opencontainers/runtime-spec/specs-go"
"github.com/pkg/errors"
@@ -150,7 +151,7 @@ func GetBudFlags(flags *BudResults) pflag.FlagSet {
fs := pflag.FlagSet{}
fs.StringVar(&flags.Arch, "arch", runtime.GOARCH, "set the ARCH of the image to the provided value instead of the architecture of the host")
fs.StringArrayVar(&flags.Annotation, "annotation", []string{}, "Set metadata for an image (default [])")
- fs.StringVar(&flags.Authfile, "authfile", GetDefaultAuthFile(), "path of the authentication file.")
+ fs.StringVar(&flags.Authfile, "authfile", auth.GetDefaultAuthFile(), "path of the authentication file.")
fs.StringArrayVar(&flags.BuildArg, "build-arg", []string{}, "`argument=value` to supply to the builder")
fs.StringVar(&flags.CacheFrom, "cache-from", "", "Images to utilise as potential cache sources. The build process does not currently support caching so this is a NOOP.")
fs.StringVar(&flags.CertDir, "cert-dir", "", "use certificates at the specified path to access the registry")
@@ -278,17 +279,3 @@ func VerifyFlagsArgsOrder(args []string) error {
}
return nil
}
-
-func GetDefaultAuthFile() string {
- return os.Getenv("REGISTRY_AUTH_FILE")
-}
-
-func CheckAuthFile(authfile string) error {
- if authfile == "" {
- return nil
- }
- if _, err := os.Stat(authfile); err != nil {
- return errors.Wrapf(err, "error checking authfile path %s", authfile)
- }
- return nil
-}