Skip to content

Commit

Permalink
feat: replace IsCreated with Exists for Client interface from package…
Browse files Browse the repository at this point in the history
… docker (#558)

Signed-off-by: zhyon404 <zhyong4@gmail.com>
  • Loading branch information
zhyon404 authored Jul 6, 2022
1 parent 3c8c6cd commit 707d5e8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/buildkitd/buildkitd.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func (c *generalClient) maybeStart(ctx context.Context,
return "", err
}

created, err := dockerClient.IsCreated(ctx, c.containerName)
created, err := dockerClient.Exists(ctx, c.containerName)
if err != nil {
return "", err
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ type Client interface {
StartBuildkitd(ctx context.Context, tag, name, mirror string) (string, error)

IsRunning(ctx context.Context, name string) (bool, error)
IsCreated(ctx context.Context, name string) (bool, error)
Exists(ctx context.Context, name string) (bool, error)
WaitUntilRunning(ctx context.Context, name string, timeout time.Duration) error

Exec(ctx context.Context, cname string, cmd []string) error
Expand Down Expand Up @@ -448,7 +448,7 @@ func (c generalClient) StartEnvd(ctx context.Context, tag, name, buildContext st
return container.Name, container.NetworkSettings.IPAddress, nil
}

func (c generalClient) IsCreated(ctx context.Context, cname string) (bool, error) {
func (c generalClient) Exists(ctx context.Context, cname string) (bool, error) {
_, err := c.GetContainer(ctx, cname)
if err != nil {
if client.IsErrNotFound(err) {
Expand Down

0 comments on commit 707d5e8

Please sign in to comment.