diff --git a/tests/e2e/kubetest2-kops/deployer/common.go b/tests/e2e/kubetest2-kops/deployer/common.go index 82f5d687f8b79..417ea9a70e4ff 100644 --- a/tests/e2e/kubetest2-kops/deployer/common.go +++ b/tests/e2e/kubetest2-kops/deployer/common.go @@ -20,14 +20,12 @@ import ( "errors" "fmt" "os" - "path" "path/filepath" "strings" "time" "k8s.io/klog/v2" "k8s.io/kops/tests/e2e/kubetest2-kops/gce" - "k8s.io/kops/tests/e2e/pkg/kops" "k8s.io/kops/tests/e2e/pkg/target" "k8s.io/kops/tests/e2e/pkg/util" "sigs.k8s.io/kubetest2/pkg/boskos" @@ -51,14 +49,6 @@ func (d *deployer) initialize() error { return fmt.Errorf("init failed to check up flags: %v", err) } } - if d.KopsVersionMarker != "" { - d.KopsBinaryPath = path.Join(d.commonOptions.RunDir(), "kops") - baseURL, err := kops.DownloadKops(d.KopsVersionMarker, d.KopsBinaryPath) - if err != nil { - return fmt.Errorf("init failed to download kops from url: %v", err) - } - d.KopsBaseURL = baseURL - } switch d.CloudProvider { case "aws": diff --git a/tests/e2e/kubetest2-kops/deployer/up.go b/tests/e2e/kubetest2-kops/deployer/up.go index 604060e4d7a04..123aac1b9cfcf 100644 --- a/tests/e2e/kubetest2-kops/deployer/up.go +++ b/tests/e2e/kubetest2-kops/deployer/up.go @@ -20,6 +20,7 @@ import ( "errors" "fmt" osexec "os/exec" + "path" "strings" "time" @@ -41,6 +42,17 @@ func (d *deployer) Up() error { return err } + // kops is fetched when --up is called instead of init to support a scenario where k/k is being built + // and a kops build is not ready yet + if d.KopsVersionMarker != "" { + d.KopsBinaryPath = path.Join(d.commonOptions.RunDir(), "kops") + baseURL, err := kops.DownloadKops(d.KopsVersionMarker, d.KopsBinaryPath) + if err != nil { + return fmt.Errorf("init failed to download kops from url: %v", err) + } + d.KopsBaseURL = baseURL + } + if d.terraform == nil { klog.Info("Cleaning up any leaked resources from previous cluster") // Intentionally ignore errors: @@ -118,6 +130,7 @@ func (d *deployer) createCluster(zones []string, adminAccess string, yes bool) e "--kubernetes-version", d.KubernetesVersion, "--ssh-public-key", d.SSHPublicKeyPath, "--set", "cluster.spec.nodePortAccess=0.0.0.0/0", + "--set", `spec.containerd.configAdditions=plugins."io.containerd.grpc.v1.cri".containerd.runtimes.test-handler.runtime_type=io.containerd.runc.v2`, } if yes { args = append(args, "--yes")