Skip to content

Commit

Permalink
Update TODO comments, validate both Azure controllers
Browse files Browse the repository at this point in the history
Signed-off-by: Kyle Squizzato <[email protected]>
  • Loading branch information
squizzi authored and DinaBelova committed Oct 17, 2024
1 parent ba1d43a commit c34be1b
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 11 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 9 additions & 3 deletions test/e2e/e2e_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
3 changes: 1 addition & 2 deletions test/e2e/managedcluster/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/managedcluster/validate_deleted.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/provider_aws_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/provider_vsphere_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit c34be1b

Please sign in to comment.