diff --git a/test/infrastructure/docker/e2e/docker_test.go b/test/infrastructure/docker/e2e/docker_test.go index 8a69ffc8cff2..2315ec0f200c 100644 --- a/test/infrastructure/docker/e2e/docker_test.go +++ b/test/infrastructure/docker/e2e/docker_test.go @@ -26,8 +26,9 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime" + appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" @@ -49,6 +50,7 @@ var _ = Describe("Docker", func() { var ( namespace string clusterGen = &ClusterGenerator{} + workloadClient ctrlclient.Client ) SetDefaultEventuallyTimeout(3 * time.Minute) SetDefaultEventuallyPollingInterval(10 * time.Second) @@ -125,7 +127,7 @@ var _ = Describe("Docker", func() { framework.WaitForOneKubeadmControlPlaneMachineToExist(ctx, waitForOneKubeadmControlPlaneMachineToExistInput, "5m") // Insatll a networking solution on the workload cluster - workloadClient, err := mgmt.GetWorkloadClient(ctx, cluster.Namespace, cluster.Name) + workloadClient, err = mgmt.GetWorkloadClient(ctx, cluster.Namespace, cluster.Name) Expect(err).ToNot(HaveOccurred()) applyYAMLURLInput := framework.ApplyYAMLURLInput{ Client: workloadClient, @@ -213,6 +215,20 @@ var _ = Describe("Docker", func() { } return upgraded, nil }, "10m", "30s").Should(Equal(int(*controlPlane.Spec.Replicas))) + + Eventually(func() (bool, error) { + ds := &appsv1.DaemonSet{} + + if err := workloadClient.Get(ctx, ctrlclient.ObjectKey{Name: "kube-proxy", Namespace: metav1.NamespaceSystem}, ds); err != nil { + return false, err + } + if ds.Spec.Template.Spec.Containers[0].Image == "k8s.gcr.io/kube-proxy:v1.17.2" { + return true, nil + } + + return false, nil + }, "10m", "30s").Should(BeTrue()) + }) }) })