From 55c2e1a0776dbaabb0e9f17f8847ae33b0cdebd2 Mon Sep 17 00:00:00 2001 From: Ryan Drew Date: Tue, 7 Sep 2021 11:11:42 -0600 Subject: [PATCH] Modify cache-from cli arg to allow multiple values Documented usage of cache-from allows for users to specify multiple images to search through by passing the cache-from argument more than once. Current implementation of cache-from as a string does not enable this behavior. See: https://github.com/moby/moby/pull/26839#issuecomment-277383550 Signed-off-by: Ryan Drew --- pkg/cli/common.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/cli/common.go b/pkg/cli/common.go index aaf48d49fa7..091e0db165e 100644 --- a/pkg/cli/common.go +++ b/pkg/cli/common.go @@ -51,7 +51,7 @@ type BudResults struct { Annotation []string Authfile string BuildArg []string - CacheFrom string + CacheFrom []string CertDir string Compress bool Creds string @@ -179,7 +179,7 @@ func GetBudFlags(flags *BudResults) pflag.FlagSet { fs.StringArrayVar(&flags.Annotation, "annotation", []string{}, "Set metadata for an image (default [])") fs.StringVar(&flags.Authfile, "authfile", "", "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.StringArrayVar(&flags.CacheFrom, "cache-from", []string{}, "Images to utilise as potential cache sources.") fs.StringVar(&flags.CertDir, "cert-dir", "", "use certificates at the specified path to access the registry") fs.BoolVar(&flags.Compress, "compress", false, "This is legacy option, which has no effect on the image") fs.StringVar(&flags.Creds, "creds", "", "use `[username[:password]]` for accessing the registry")