Skip to content

Commit 3a28780

Browse files
committed
Remove affinity groups from project tests
1 parent 6c03dde commit 3a28780

File tree

2 files changed

+1
-24
lines changed
  • test/e2e

2 files changed

+1
-24
lines changed

test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-project/md.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ spec:
1111
template:
1212
name: ${CLOUDSTACK_TEMPLATE_NAME}
1313
sshKey: ${CLOUDSTACK_SSH_KEY_NAME}
14-
affinity: anti
1514
---
1615
apiVersion: infrastructure.cluster.x-k8s.io/v1beta3
1716
kind: CloudStackMachineTemplate
@@ -25,4 +24,3 @@ spec:
2524
template:
2625
name: ${CLOUDSTACK_TEMPLATE_NAME}
2726
sshKey: ${CLOUDSTACK_SSH_KEY_NAME}
28-
affinity: anti

test/e2e/project.go

+1-22
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ func ProjectSpec(ctx context.Context, inputGetter func() CommonSpecInput) {
4040
namespace *corev1.Namespace
4141
cancelWatches context.CancelFunc
4242
clusterResources *clusterctl.ApplyClusterTemplateAndWaitResult
43-
affinityIds []string
4443
vpcName string
4544
)
4645

@@ -69,8 +68,6 @@ func ProjectSpec(ctx context.Context, inputGetter func() CommonSpecInput) {
6968
Skip("Failed to fetch project")
7069
}
7170

72-
// Initialize affinityIds to an empty slice to avoid nil checks
73-
affinityIds = make([]string, 0)
7471
})
7572

7673
It("Should create a cluster in a project", func() {
@@ -97,15 +94,9 @@ func ProjectSpec(ctx context.Context, inputGetter func() CommonSpecInput) {
9794
// Ensure the cluster was created successfully before proceeding with checks
9895
Expect(clusterResources.Cluster).ToNot(BeNil(), "Cluster was not created successfully")
9996

100-
By("Checking affinity groups and VPC in project")
97+
By("Checking VPC in project")
10198
csClient := CreateCloudStackClient(ctx, input.BootstrapClusterProxy.GetKubeconfigPath())
10299

103-
// Check affinity groups
104-
By(fmt.Sprintf("Checking affinity groups for cluster %s in project %s", clusterResources.Cluster.Name, projectName))
105-
tempAffinityIds := CheckAffinityGroupInProject(csClient, clusterResources.Cluster.Name, "anti", projectName)
106-
Expect(tempAffinityIds).ToNot(BeEmpty(), "No affinity groups found for cluster")
107-
affinityIds = tempAffinityIds
108-
109100
// Check VPC
110101
By(fmt.Sprintf("Checking if VPC %s exists in project %s", vpcName, projectName))
111102
exists, err := CheckVPCExistsInProject(csClient, vpcName, projectName)
@@ -117,18 +108,6 @@ func ProjectSpec(ctx context.Context, inputGetter func() CommonSpecInput) {
117108
// Dumps all the resources in the spec namespace, then cleanups the cluster object and the spec namespace itself.
118109
dumpSpecResourcesAndCleanup(ctx, specName, input.BootstrapClusterProxy, input.ArtifactFolder, namespace, cancelWatches, clusterResources.Cluster, input.E2EConfig.GetIntervals, input.SkipCleanup)
119110

120-
csClient := CreateCloudStackClient(ctx, input.BootstrapClusterProxy.GetKubeconfigPath())
121-
122-
// Only check for affinity group deletion if affinity groups were created
123-
if len(affinityIds) > 0 {
124-
err := CheckAffinityGroupsDeletedInProject(csClient, affinityIds, projectName)
125-
if err != nil {
126-
Fail(err.Error())
127-
}
128-
} else {
129-
By("Skipping affinity group deletion check as no affinity groups were created")
130-
}
131-
132111
By("PASSED!")
133112
})
134113
}

0 commit comments

Comments
 (0)