From c34be1b29581b4d78a379bfc0e35314fdecf04ef Mon Sep 17 00:00:00 2001 From: Kyle Squizzato Date: Thu, 10 Oct 2024 17:04:39 -0700 Subject: [PATCH] Update TODO comments, validate both Azure controllers Signed-off-by: Kyle Squizzato --- .github/workflows/build_test.yml | 4 ++++ .../templates/k0scontrolplane.yaml | 2 -- test/e2e/e2e_suite_test.go | 12 +++++++++--- test/e2e/managedcluster/common.go | 3 +-- test/e2e/managedcluster/validate_deleted.go | 2 +- test/e2e/provider_aws_test.go | 4 ++-- test/e2e/provider_vsphere_test.go | 2 +- 7 files changed, 18 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml index c08236bb..7e24c376 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -12,6 +12,10 @@ on: paths-ignore: - 'config/**' - '**.md' + push: + tags: + - '*' + env: GO_VERSION: '1.22' REGISTRY_REPO: 'oci://ghcr.io/mirantis/hmc/charts-ci' diff --git a/templates/cluster/vsphere-standalone-cp/templates/k0scontrolplane.yaml b/templates/cluster/vsphere-standalone-cp/templates/k0scontrolplane.yaml index 708ce809..038fb1a9 100644 --- a/templates/cluster/vsphere-standalone-cp/templates/k0scontrolplane.yaml +++ b/templates/cluster/vsphere-standalone-cp/templates/k0scontrolplane.yaml @@ -114,10 +114,8 @@ spec: images: driver: tag: v3.1.2 - repo: "registry.k8s.io/csi-vsphere/driver" syncer: tag: v3.1.2 - repo: "registry.k8s.io/csi-vsphere/syncer" machineTemplate: infrastructureRef: apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 diff --git a/test/e2e/e2e_suite_test.go b/test/e2e/e2e_suite_test.go index eef3a144..8f0c1ee3 100644 --- a/test/e2e/e2e_suite_test.go +++ b/test/e2e/e2e_suite_test.go @@ -105,16 +105,22 @@ func verifyControllersUp(kc *kubeclient.KubeClient) error { } func validateController(kc *kubeclient.KubeClient, labelSelector string, name string) error { + controllerItems := 1 + if strings.Contains(labelSelector, managedcluster.GetProviderLabel(managedcluster.ProviderAzure)) { + // Azure provider has two controllers. + controllerItems = 2 + } + deployList, err := kc.Client.AppsV1().Deployments(kc.Namespace).List(context.Background(), metav1.ListOptions{ LabelSelector: labelSelector, - Limit: 1, + Limit: int64(controllerItems), }) if err != nil { return fmt.Errorf("failed to list %s controller deployments: %w", name, err) } - if len(deployList.Items) < 1 { - return fmt.Errorf("expected at least 1 %s controller deployment", name) + if len(deployList.Items) < controllerItems { + return fmt.Errorf("expected at least %d %s controller deployments, got %d", controllerItems, name, len(deployList.Items)) } deployment := deployList.Items[0] diff --git a/test/e2e/managedcluster/common.go b/test/e2e/managedcluster/common.go index 2e300f2c..f237f855 100644 --- a/test/e2e/managedcluster/common.go +++ b/test/e2e/managedcluster/common.go @@ -51,8 +51,7 @@ func PatchHostedClusterReady(kc *kubeclient.KubeClient, provider ProviderType, c version = "v1beta1" resource = "azureclusters" case ProviderVSphere: - version = "v1beta1" - resource = "vsphereclusters" + return default: Fail(fmt.Sprintf("unsupported provider: %s", provider)) } diff --git a/test/e2e/managedcluster/validate_deleted.go b/test/e2e/managedcluster/validate_deleted.go index 7ceeb61a..dce3211f 100644 --- a/test/e2e/managedcluster/validate_deleted.go +++ b/test/e2e/managedcluster/validate_deleted.go @@ -36,7 +36,7 @@ func validateClusterDeleted(ctx context.Context, kc *kubeclient.KubeClient, clus if cluster != nil { phase, _, _ := unstructured.NestedString(cluster.Object, "status", "phase") if phase != "Deleting" { - // TODO: We should have a threshold error system for situations + // TODO(#474): We should have a threshold error system for situations // like this, we probably don't want to wait the full Eventually // for something like this, but we can't immediately fail the test // either. diff --git a/test/e2e/provider_aws_test.go b/test/e2e/provider_aws_test.go index 552f53ec..048eaed9 100644 --- a/test/e2e/provider_aws_test.go +++ b/test/e2e/provider_aws_test.go @@ -98,8 +98,8 @@ var _ = Describe("AWS Templates", Label("provider:cloud", "provider:aws"), Order // Download the KUBECONFIG for the standalone cluster and load it // so we can call Make targets against this cluster. - // TODO: Ideally we shouldn't use Make here and should just convert - // these Make targets into Go code, but this will require a + // TODO(#472): Ideally we shouldn't use Make here and should just + // convert these Make targets into Go code, but this will require a // helmclient. var kubeCfgPath string kubeCfgPath, kubecfgDeleteFunc = kc.WriteKubeconfig(context.Background(), clusterName) diff --git a/test/e2e/provider_vsphere_test.go b/test/e2e/provider_vsphere_test.go index 613ab1cf..a6079665 100644 --- a/test/e2e/provider_vsphere_test.go +++ b/test/e2e/provider_vsphere_test.go @@ -59,7 +59,7 @@ var _ = Context("vSphere Templates", Label("provider:onprem", "provider:vsphere" // VSphere doesn't have any form of cleanup outside of reconciling a // cluster deletion so we need to keep the test active while we wait // for CAPV to clean up the resources. - // TODO: Add an exterior cleanup mechanism for VSphere like + // TODO(#473) Add an exterior cleanup mechanism for VSphere like // 'dev-aws-nuke' to clean up resources in the event that the test // fails to do so. if deleteFunc != nil && !noCleanup() {