Skip to content

Commit c00a832

Browse files
committed
fixed mocks
Signed-off-by: Rashad Sirajudeen <rashadsirajudeen@gmail.com>
1 parent 0ccb347 commit c00a832

File tree

4 files changed

+20
-5
lines changed

4 files changed

+20
-5
lines changed

internal/commands/build.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,6 @@ This option may set DOCKER_HOST environment variable for the build container if
284284
cmd.Flags().MarkHidden("sparse")
285285
}
286286
}
287-
288287
}
289288

290289
func validateBuildFlags(flags *BuildFlags, cfg config.Config, inputImageRef client.InputImageReference, logger logging.Logger) error {

internal/commands/testmocks/mock_pack_client.go

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/fakes/fake_lifecycle.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,8 @@ func (f *FakeLifecycle) Execute(ctx context.Context, opts build.LifecycleOptions
1414
f.Opts = opts
1515
return nil
1616
}
17+
18+
func (f *FakeLifecycle) Detect(ctx context.Context, opts build.LifecycleOptions) error {
19+
f.Opts = opts
20+
return nil
21+
}

pkg/client/detect.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ package client
33
import (
44
"context"
55
"fmt"
6-
7-
"github.com/docker/docker/api/types"
86
)
97

108
func (c *Client) Detect(ctx context.Context, opts BuildOptions) error {
@@ -13,8 +11,7 @@ func (c *Client) Detect(ctx context.Context, opts BuildOptions) error {
1311
return err
1412
}
1513

16-
defer c.docker.ImageRemove(context.Background(), lifecycleOpts.LifecycleImage, types.ImageRemoveOptions{Force: true})
17-
defer c.docker.ImageRemove(context.Background(), lifecycleOpts.Builder.Name(), types.ImageRemoveOptions{Force: true})
14+
// TODO: Cleanup
1815

1916
if err = c.lifecycleExecutor.Detect(ctx, *lifecycleOpts); err != nil {
2017
return fmt.Errorf("executing detect: %w", err)

0 commit comments

Comments
 (0)