diff --git a/cluster/network.go b/cluster/network.go index a1630cef..4ed1e1dc 100644 --- a/cluster/network.go +++ b/cluster/network.go @@ -428,7 +428,7 @@ func checkPlaneTCPPortsFromHost(ctx context.Context, host *hosts.Host, portList if err := docker.DoRunContainer(ctx, host.DClient, imageCfg, hostCfg, PortCheckContainer, host.Address, "network", prsMap); err != nil { return err } - if err := docker.WaitForContainer(ctx, host.DClient, PortCheckContainer); err != nil { + if err := docker.WaitForContainer(ctx, host.DClient, host.Address, PortCheckContainer); err != nil { return err } logs, err := docker.ReadContainerLogs(ctx, host.DClient, PortCheckContainer) diff --git a/docker/docker.go b/docker/docker.go index 845f4781..7bcdd9ae 100644 --- a/docker/docker.go +++ b/docker/docker.go @@ -268,19 +268,19 @@ func StopRenameContainer(ctx context.Context, dClient *client.Client, hostname s if err := StopContainer(ctx, dClient, hostname, oldContainerName); err != nil { return err } - if err := WaitForContainer(ctx, dClient, oldContainerName); err != nil { + if err := WaitForContainer(ctx, dClient, hostname, oldContainerName); err != nil { return nil } err := RenameContainer(ctx, dClient, hostname, oldContainerName, newContainerName) return err } -func WaitForContainer(ctx context.Context, dClient *client.Client, containerName string) error { +func WaitForContainer(ctx context.Context, dClient *client.Client, hostname string, containerName string) error { statusCh, errCh := dClient.ContainerWait(ctx, containerName, container.WaitConditionNotRunning) select { case err := <-errCh: if err != nil { - return fmt.Errorf("Error wating for container [%s]: %v", containerName, err) + return fmt.Errorf("Error waiting for container [%s] on host [%s]: %v", containerName, hostname, err) } case <-statusCh: } diff --git a/hosts/hosts.go b/hosts/hosts.go index ed60dc9c..0b168da0 100644 --- a/hosts/hosts.go +++ b/hosts/hosts.go @@ -114,7 +114,7 @@ func (h *Host) CleanUp(ctx context.Context, toCleanPaths []string, cleanerImage return err } - if err := docker.WaitForContainer(ctx, h.DClient, CleanerContainerName); err != nil { + if err := docker.WaitForContainer(ctx, h.DClient, h.Address, CleanerContainerName); err != nil { return err }