Skip to content

Commit 5e25e3e

Browse files
committed
chore: set save to true for loadUsingRegistry and dedupe checks
1 parent c957729 commit 5e25e3e

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Diff for: pkg/buildx/commands/bake.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ func RunBake(dockerCli command.Cli, in BakeOptions, validator BakeValidator, pri
108108
},
109109
)
110110
}
111-
if in.save || in.loadUsingRegistry {
111+
if in.save {
112112
opts := registry.SaveOptions{
113113
ProjectID: in.project,
114114
BuildID: in.buildID,
@@ -327,14 +327,15 @@ func BakeCmd() *cobra.Command {
327327
}
328328
loadUsingRegistry := build.LoadUsingRegistry()
329329
if options.exportLoad && loadUsingRegistry {
330+
options.save = true
330331
pullInfo, err := depotbuild.PullBuildInfo(context.Background(), build.ID, token)
331332
// if we cannot get pull info, dont fail; load as normal
332333
if err == nil {
333334
options.loadUsingRegistry = loadUsingRegistry
334335
options.pullInfo = pullInfo
335336
}
336337
}
337-
if options.save || options.loadUsingRegistry {
338+
if options.save {
338339
options.additionalCredentials = build.AdditionalCredentials()
339340
options.additionalTags = build.AdditionalTags()
340341
}

Diff for: pkg/buildx/commands/build.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ func buildTargets(ctx context.Context, dockerCli command.Cli, nodes []builder.No
239239
},
240240
)
241241
}
242-
if depotOpts.save || depotOpts.loadUsingRegistry {
242+
if depotOpts.save {
243243
saveOpts := registry.SaveOptions{
244244
ProjectID: depotOpts.project,
245245
BuildID: depotOpts.buildID,
@@ -692,14 +692,15 @@ func BuildCmd() *cobra.Command {
692692
}
693693
loadUsingRegistry := build.LoadUsingRegistry()
694694
if options.exportLoad && loadUsingRegistry {
695+
options.save = true
695696
pullInfo, err := depotbuild.PullBuildInfo(context.Background(), build.ID, token)
696697
// if we cannot get pull info, dont fail; load as normal
697698
if err == nil {
698699
options.loadUsingRegistry = loadUsingRegistry
699700
options.pullInfo = pullInfo
700701
}
701702
}
702-
if options.save || options.loadUsingRegistry {
703+
if options.save {
703704
options.additionalCredentials = build.AdditionalCredentials()
704705
options.additionalTags = build.AdditionalTags()
705706
}

0 commit comments

Comments
 (0)