mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
controller: don't write metadata file in controller
Signed-off-by: Justin Chadwell <me@jedevc.com>
This commit is contained in:
@ -111,7 +111,6 @@ func (o *buildOptions) toControllerOptions() (*controllerapi.BuildOptions, error
|
||||
Target: o.target,
|
||||
Ulimits: dockerUlimitToControllerUlimit(o.ulimits),
|
||||
Builder: o.builder,
|
||||
MetadataFile: o.metadataFile,
|
||||
NoCache: o.noCache,
|
||||
Pull: o.pull,
|
||||
ExportPush: o.exportPush,
|
||||
@ -263,7 +262,11 @@ func runBuild(dockerCli command.Cli, options buildOptions) (err error) {
|
||||
}
|
||||
return os.WriteFile(options.imageIDFile, []byte(dgst), 0644)
|
||||
}
|
||||
|
||||
if options.metadataFile != "" {
|
||||
if err := writeMetadataFile(options.metadataFile, decodeExporterResponse(resp.ExporterResponse)); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -895,13 +898,6 @@ func resolvePaths(options *controllerapi.BuildOptions) (_ *controllerapi.BuildOp
|
||||
}
|
||||
options.SSH = ssh
|
||||
|
||||
if options.MetadataFile != "" {
|
||||
options.MetadataFile, err = filepath.Abs(options.MetadataFile)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
return options, nil
|
||||
}
|
||||
|
||||
|
@ -235,15 +235,6 @@ func TestResolvePaths(t *testing.T) {
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "metadatafile",
|
||||
options: controllerapi.BuildOptions{
|
||||
MetadataFile: "test1",
|
||||
},
|
||||
want: controllerapi.BuildOptions{
|
||||
MetadataFile: filepath.Join(tmpwd, "test1"),
|
||||
},
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
|
Reference in New Issue
Block a user