cache_to and cache_from are now string instead of cli.StringSlice

This commit is contained in:
David Kovari 2024-01-21 13:40:57 -06:00
commit 08ca33ec76
No known key found for this signature in database
GPG key ID: EA46A9DC0364BD76
3 changed files with 8 additions and 8 deletions

View file

@ -195,13 +195,13 @@ func settingsFlags(settings *plugin.Settings) []cli.Flag {
Usage: "sets the build target to use",
Destination: &settings.Build.Target,
},
&cli.StringSliceFlag{
&cli.StringFlag{
Name: "cache-from",
EnvVars: []string{"PLUGIN_CACHE_FROM"},
Usage: "sets images to consider as cache sources",
Destination: &settings.Build.CacheFrom,
},
&cli.StringSliceFlag{
&cli.StringFlag{
Name: "cache-to",
EnvVars: []string{"PLUGIN_CACHE_TO"},
Usage: "cache destination for the build cache",

View file

@ -78,11 +78,11 @@ func commandBuild(build Build, dryrun bool) *exec.Cmd {
if build.NoCache {
args = append(args, "--no-cache")
}
for _, arg := range build.CacheFrom.Value() {
args = append(args, "--cache-from", arg)
if build.CacheFrom != "" {
args = append(args, "--cache-from", build.CacheFrom)
}
for _, arg := range build.CacheTo.Value() {
args = append(args, "--cache-to", arg)
if build.CacheTo != "" {
args = append(args, "--cache-to", build.CacheTo)
}
for _, arg := range build.ArgsEnv.Value() {
addProxyValue(&build, arg)

View file

@ -72,8 +72,8 @@ type Build struct {
Target string // Docker build target
Output string // Docker build output
Pull bool // Docker build pull
CacheFrom cli.StringSlice // Docker build cache-from
CacheTo cli.StringSlice // Docker build cache-to
CacheFrom string // Docker build cache-from
CacheTo string // Docker build cache-to
Compress bool // Docker build compress
Repo cli.StringSlice // Docker build repository
NoCache bool // Docker build no-cache