Skip to content

Commit 0cd445e

Browse files
committed
tmp
Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>
1 parent fa1115c commit 0cd445e

4 files changed

Lines changed: 101 additions & 136 deletions

File tree

targets/linux/deb/distro/distro.go

Lines changed: 6 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -110,49 +110,14 @@ func (cfg *Config) Handle(ctx context.Context, client gwclient.Client) (*gwclien
110110
Description: "Builds a container image for testing purposes only.",
111111
})
112112

113-
mux.Add("testing/container/distroless", func(ctx context.Context, client gwclient.Client) (*gwclient.Result, error) {
114-
return frontend.BuildWithPlatform(ctx, client, func(ctx context.Context, client gwclient.Client, platform *ocispecs.Platform, spec *dalec.Spec, targetKey string) (gwclient.Reference, *dalec.DockerImageSpec, error) {
115-
sOpt, err := frontend.SourceOptFromClient(ctx, client, platform)
116-
if err != nil {
117-
return nil, nil, err
118-
}
113+
mux.Add("container", func(ctx context.Context, client gwclient.Client) (*gwclient.Result, error) {
114+
cfg := *cfg
115+
cfg.DefaultOutputImage = ""
119116

120-
var opts []llb.ConstraintsOpt
121-
opts = append(opts, dalec.ProgressGroup(spec.Name))
122-
opts = append(opts, dalec.Platform(platform))
123-
124-
worker := cfg.Worker(sOpt, opts...)
125-
126-
// TODO: Add back support for prebuilt packages.
127-
pkgSt := cfg.BuildPkg(ctx, client, sOpt, spec, targetKey, opts...)
128-
129-
img, err := cfg.BuildImageConfig(ctx, sOpt, spec, platform, targetKey)
130-
if err != nil {
131-
return nil, nil, err
132-
}
133-
134-
input := BuildContainerInput{
135-
Config: cfg,
136-
Client: client,
137-
Worker: worker,
138-
SOpt: sOpt,
139-
Spec: spec,
140-
Target: targetKey,
141-
DebSt: pkgSt,
142-
Opts: opts,
143-
}
144-
145-
ctr := BuildDistrolessContainer(ctx, input)
146-
147-
tests := cfg.RunTests(ctx, client, spec, sOpt, ctr, targetKey, opts...)
148-
149-
ref, err := getRef(ctx, client, ctr.With(tests))
150-
151-
return ref, img, err
152-
})
117+
return linux.HandleContainer(&cfg)(ctx, client)
153118
}, &targets.Target{
154-
Name: "testing/container/distroless",
155-
Description: "Builds a distroless container image for testing purposes only.",
119+
Name: "container",
120+
Description: "Builds a container image.",
156121
})
157122

158123
mux.Add("dsc", cfg.HandleSourcePkg, &targets.Target{

test/custom_repo_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ func testCustomRepo(ctx context.Context, t *testing.T, workerCfg workerConfig, t
154154
sr = newSolveRequest(
155155
withSpec(ctx, t, getSpec(depSpec, nil, repoPath, "public.key")),
156156
withBuildContext(ctx, t, "test-repo", repoState),
157-
withBuildTarget(targetCfg.Container),
157+
withBuildTarget(targetCfg.Package),
158158
withPlatformPtr(workerCfg.Platform),
159159
)
160160

@@ -204,7 +204,7 @@ func testCustomRepo(ctx context.Context, t *testing.T, workerCfg workerConfig, t
204204
withSpec(ctx, t, spec),
205205
withBuildContext(ctx, t, "test-repo", repoState),
206206
withBuildContext(ctx, t, "repo-public-key", gpgKey),
207-
withBuildTarget(targetCfg.Container),
207+
withBuildTarget(targetCfg.Package),
208208
withPlatformPtr(workerCfg.Platform),
209209
)
210210

0 commit comments

Comments
 (0)