Skip to content

Commit 714048e

Browse files
authored
Merge pull request #8241 from sbueringer/pr-e2e-remote-docker
🌱 test/framework: don't fix kubeconfig for remote CAPD clusters
2 parents 88c5261 + a9aa612 commit 714048e

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/framework/cluster_proxy.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,20 @@ func (p *clusterProxy) fixConfig(ctx context.Context, name string, config *api.C
387387
ctx = container.RuntimeInto(ctx, containerRuntime)
388388

389389
lbContainerName := name + "-lb"
390+
391+
// Check if the container exists locally.
392+
filters := container.FilterBuilder{}
393+
filters.AddKeyValue("name", lbContainerName)
394+
containers, err := containerRuntime.ListContainers(ctx, filters)
395+
Expect(err).ToNot(HaveOccurred())
396+
if len(containers) == 0 {
397+
// Return without changing the config if the container does not exist locally.
398+
// Note: This is necessary when running the tests with Tilt and a remote Docker
399+
// engine as the lb container running on the remote Docker engine is accessible
400+
// under its normal address but not via 127.0.0.1.
401+
return
402+
}
403+
390404
port, err := containerRuntime.GetHostPort(ctx, lbContainerName, "6443/tcp")
391405
Expect(err).ToNot(HaveOccurred(), "Failed to get load balancer port")
392406

0 commit comments

Comments
 (0)