Skip to content

Commit 05e173e

Browse files
committed
run TestBuildImageDependencies in backward compatibility mode
Signed-off-by: Nicolas De Loof <[email protected]>
1 parent 6cb4273 commit 05e173e

File tree

3 files changed

+14
-19
lines changed

3 files changed

+14
-19
lines changed

cmd/compose/build.go

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,16 @@ func (opts buildOptions) toAPIBuildOptions(services []string) (api.BuildOptions,
6868
uiMode = "rawjson"
6969
}
7070
return api.BuildOptions{
71-
Pull: opts.pull,
72-
Push: opts.push,
73-
Progress: uiMode,
74-
Args: types.NewMappingWithEquals(opts.args),
75-
NoCache: opts.noCache,
76-
Quiet: opts.quiet,
77-
Services: services,
78-
Deps: opts.deps,
79-
SSHs: SSHKeys,
80-
Builder: builderName,
81-
Compatibility: opts.Compatibility,
71+
Pull: opts.pull,
72+
Push: opts.push,
73+
Progress: uiMode,
74+
Args: types.NewMappingWithEquals(opts.args),
75+
NoCache: opts.noCache,
76+
Quiet: opts.quiet,
77+
Services: services,
78+
Deps: opts.deps,
79+
SSHs: SSHKeys,
80+
Builder: builderName,
8281
}, nil
8382
}
8483

pkg/api/api.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,6 @@ type BuildOptions struct {
155155
Memory int64
156156
// Builder name passed in the command line
157157
Builder string
158-
// Compatibility let compose run with best backward compatibility
159-
Compatibility bool
160158
}
161159

162160
// Apply mutates project according to build options

pkg/compose/build_bake.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ func (s *composeService) doBuildBake(ctx context.Context, project *types.Project
184184

185185
cfg.Targets[serviceName] = bakeTarget{
186186
Context: build.Context,
187-
Contexts: additionalContexts(build.AdditionalContexts, service.DependsOn, options.Compatibility),
187+
Contexts: additionalContexts(build.AdditionalContexts, service.DependsOn),
188188
Dockerfile: dockerFilePath(build.Context, build.Dockerfile),
189189
DockerfileInline: build.DockerfileInline,
190190
Args: args,
@@ -320,12 +320,10 @@ func (s *composeService) doBuildBake(ctx context.Context, project *types.Project
320320
return results, nil
321321
}
322322

323-
func additionalContexts(contexts types.Mapping, dependencies types.DependsOnConfig, compatibility bool) map[string]string {
323+
func additionalContexts(contexts types.Mapping, dependencies types.DependsOnConfig) map[string]string {
324324
ac := map[string]string{}
325-
if compatibility {
326-
for name := range dependencies {
327-
ac[name] = "target:" + name
328-
}
325+
for name := range dependencies {
326+
ac[name] = "target:" + name
329327
}
330328
for k, v := range contexts {
331329
ac[k] = v

0 commit comments

Comments
 (0)