Skip to content

Commit

Permalink
Make function part of the struct.
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickdappollonio committed Nov 12, 2024
1 parent 83d968d commit 82cb260
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func (c *Client) Close() error {
return c.cli.Close() //nolint:wrapcheck // exposing the close to upstream callers
}

func getColonyK3sContainer(ctx context.Context, c *Client) (*types.Container, error) {
func (c *Client) getColonyK3sContainer(ctx context.Context) (*types.Container, error) {
containers, err := c.cli.ContainerList(ctx, containerTypes.ListOptions{All: true})
if err != nil {
return nil, fmt.Errorf("error listing containers on host: %w", err)
Expand All @@ -64,7 +64,7 @@ func getColonyK3sContainer(ctx context.Context, c *Client) (*types.Container, er
}

func (c *Client) RemoveColonyK3sContainer(ctx context.Context) error {
k3scontainer, err := getColonyK3sContainer(ctx, c)
k3scontainer, err := c.getColonyK3sContainer(ctx)
if err != nil {
return fmt.Errorf("error getting %q container: %w", constants.ColonyK3sContainerName, err)
}
Expand Down Expand Up @@ -115,7 +115,7 @@ func (c *Client) CreateColonyK3sContainer(ctx context.Context, loadBalancerIP, l
}

// check for an existing colony-k3s container
k3sColonyContainer, err := getColonyK3sContainer(ctx, c)
k3sColonyContainer, err := c.getColonyK3sContainer(ctx)
if k3sColonyContainer != nil {
return fmt.Errorf("%q container already exists. please remove before continuing or run `colony destroy`", constants.ColonyK3sContainerName)
}
Expand Down

0 comments on commit 82cb260

Please sign in to comment.