@@ -46,7 +46,7 @@ type buildOptions struct {
4646 deps bool
4747 print bool
4848 check bool
49- provenance string
49+ provenance bool
5050}
5151
5252func (opts buildOptions ) toAPIBuildOptions (services []string ) (api.BuildOptions , error ) {
@@ -70,11 +70,6 @@ func (opts buildOptions) toAPIBuildOptions(services []string) (api.BuildOptions,
7070 if uiMode == ui .ModeJSON {
7171 uiMode = "rawjson"
7272 }
73- var provenance * string
74- // empty when set by up, run or create functions and "none" when set by the user from the build command
75- if opts .provenance != "" && opts .provenance != "none" {
76- provenance = & opts .provenance
77- }
7873
7974 return api.BuildOptions {
8075 Pull : opts .pull ,
@@ -90,7 +85,7 @@ func (opts buildOptions) toAPIBuildOptions(services []string) (api.BuildOptions,
9085 Check : opts .check ,
9186 SSHs : SSHKeys ,
9287 Builder : builderName ,
93- Provenance : provenance ,
88+ Provenance : opts . provenance ,
9489 }, nil
9590}
9691
@@ -131,7 +126,6 @@ func buildCommand(p *ProjectOptions, dockerCli command.Cli, backend api.Service)
131126 flags .StringVar (& opts .ssh , "ssh" , "" , "Set SSH authentications used when building service images. (use 'default' for using your default SSH Agent)" )
132127 flags .StringVar (& opts .builder , "builder" , "" , "Set builder to use" )
133128 flags .BoolVar (& opts .deps , "with-dependencies" , false , "Also build dependencies (transitively)" )
134- flags .StringVar (& opts .provenance , "provenance" , "min" , "Set provenance mode (none|min|max)" )
135129
136130 flags .Bool ("parallel" , true , "Build images in parallel. DEPRECATED" )
137131 flags .MarkHidden ("parallel" ) //nolint:errcheck
@@ -162,6 +156,7 @@ func runBuild(ctx context.Context, dockerCli command.Cli, backend api.Service, o
162156 }
163157
164158 apiBuildOptions , err := opts .toAPIBuildOptions (services )
159+ apiBuildOptions .Provenance = true
165160 if err != nil {
166161 return err
167162 }
0 commit comments