controller: remove MetadataFile from CommonOptions
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
@@ -25,11 +25,12 @@ import (
|
||||
)
|
||||
|
||||
type bakeOptions struct {
|
||||
files []string
|
||||
overrides []string
|
||||
printOnly bool
|
||||
sbom string
|
||||
provenance string
|
||||
files []string
|
||||
overrides []string
|
||||
printOnly bool
|
||||
sbom string
|
||||
provenance string
|
||||
metadataFile string
|
||||
|
||||
controllerapi.CommonOptions
|
||||
//control.ControlOptions
|
||||
@@ -212,12 +213,12 @@ func runBake(dockerCli command.Cli, targets []string, in bakeOptions, cFlags com
|
||||
return wrapBuildError(err, true)
|
||||
}
|
||||
|
||||
if len(in.MetadataFile) > 0 {
|
||||
if len(in.metadataFile) > 0 {
|
||||
dt := make(map[string]interface{})
|
||||
for t, r := range resp {
|
||||
dt[t] = decodeExporterResponse(r.ExporterResponse)
|
||||
}
|
||||
if err := writeMetadataFile(in.MetadataFile, dt); err != nil {
|
||||
if err := writeMetadataFile(in.metadataFile, dt); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
@@ -242,7 +243,7 @@ func bakeCmd(dockerCli command.Cli, rootOpts *rootOptions) *cobra.Command {
|
||||
cFlags.pull = nil
|
||||
}
|
||||
options.Builder = rootOpts.builder
|
||||
options.MetadataFile = cFlags.metadataFile
|
||||
options.metadataFile = cFlags.metadataFile
|
||||
// Other common flags (noCache, pull and progress) are processed in runBake function.
|
||||
return runBake(dockerCli, args, options, cFlags)
|
||||
},
|
||||
|
||||
@@ -63,6 +63,7 @@ type buildOptions struct {
|
||||
dockerfileName string
|
||||
extraHosts []string
|
||||
imageIDFile string
|
||||
metadataFile string
|
||||
labels []string
|
||||
networkMode string
|
||||
noCacheFilter []string
|
||||
@@ -75,17 +76,15 @@ type buildOptions struct {
|
||||
tags []string
|
||||
target string
|
||||
ulimits *dockeropts.UlimitOpt
|
||||
attests []string
|
||||
sbom string
|
||||
provenance string
|
||||
progress string
|
||||
quiet bool
|
||||
|
||||
invoke *invokeConfig
|
||||
noBuild bool
|
||||
|
||||
attests []string
|
||||
sbom string
|
||||
provenance string
|
||||
|
||||
progress string
|
||||
quiet bool
|
||||
|
||||
controllerapi.CommonOptions
|
||||
control.ControlOptions
|
||||
}
|
||||
@@ -284,8 +283,8 @@ func runBuild(dockerCli command.Cli, options buildOptions) (err error) {
|
||||
return errors.Wrap(err, "writing image ID file")
|
||||
}
|
||||
}
|
||||
if options.MetadataFile != "" {
|
||||
if err := writeMetadataFile(options.MetadataFile, decodeExporterResponse(resp.ExporterResponse)); err != nil {
|
||||
if options.metadataFile != "" {
|
||||
if err := writeMetadataFile(options.metadataFile, decodeExporterResponse(resp.ExporterResponse)); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
@@ -414,7 +413,7 @@ func buildCmd(dockerCli command.Cli, rootOpts *rootOptions) *cobra.Command {
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
options.contextPath = args[0]
|
||||
options.Builder = rootOpts.builder
|
||||
options.MetadataFile = cFlags.metadataFile
|
||||
options.metadataFile = cFlags.metadataFile
|
||||
options.NoCache = false
|
||||
if cFlags.noCache != nil {
|
||||
options.NoCache = *cFlags.noCache
|
||||
|
||||
Reference in New Issue
Block a user