@@ -40,7 +40,6 @@ func ProjectSpec(ctx context.Context, inputGetter func() CommonSpecInput) {
40
40
namespace * corev1.Namespace
41
41
cancelWatches context.CancelFunc
42
42
clusterResources * clusterctl.ApplyClusterTemplateAndWaitResult
43
- affinityIds []string
44
43
vpcName string
45
44
)
46
45
@@ -69,8 +68,6 @@ func ProjectSpec(ctx context.Context, inputGetter func() CommonSpecInput) {
69
68
Skip ("Failed to fetch project" )
70
69
}
71
70
72
- // Initialize affinityIds to an empty slice to avoid nil checks
73
- affinityIds = make ([]string , 0 )
74
71
})
75
72
76
73
It ("Should create a cluster in a project" , func () {
@@ -97,15 +94,9 @@ func ProjectSpec(ctx context.Context, inputGetter func() CommonSpecInput) {
97
94
// Ensure the cluster was created successfully before proceeding with checks
98
95
Expect (clusterResources .Cluster ).ToNot (BeNil (), "Cluster was not created successfully" )
99
96
100
- By ("Checking affinity groups and VPC in project" )
97
+ By ("Checking VPC in project" )
101
98
csClient := CreateCloudStackClient (ctx , input .BootstrapClusterProxy .GetKubeconfigPath ())
102
99
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
-
109
100
// Check VPC
110
101
By (fmt .Sprintf ("Checking if VPC %s exists in project %s" , vpcName , projectName ))
111
102
exists , err := CheckVPCExistsInProject (csClient , vpcName , projectName )
@@ -117,18 +108,6 @@ func ProjectSpec(ctx context.Context, inputGetter func() CommonSpecInput) {
117
108
// Dumps all the resources in the spec namespace, then cleanups the cluster object and the spec namespace itself.
118
109
dumpSpecResourcesAndCleanup (ctx , specName , input .BootstrapClusterProxy , input .ArtifactFolder , namespace , cancelWatches , clusterResources .Cluster , input .E2EConfig .GetIntervals , input .SkipCleanup )
119
110
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
-
132
111
By ("PASSED!" )
133
112
})
134
113
}
0 commit comments