Skip to content

Commit c8c8ebe

Browse files
committed
fix: Exclude IPAM CRDs from cleanup in E2E tests
- Add ipam.cluster.x-k8s.io to excluded groups in deleteClusterAPICRDs - IPAM provider CRDs are needed by cluster-api-operator itself - Prevents IPAM controller failures due to missing CRDs - Fixes 'no matches for kind InClusterIPPool/GlobalInClusterIPPool' errors - Now excludes both operator.cluster.x-k8s.io and ipam.cluster.x-k8s.io groups
1 parent e9d3ca5 commit c8c8ebe

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/e2e/e2e_suite_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -344,14 +344,15 @@ func ensureCertManager(clusterProxy framework.ClusterProxy, config *clusterctl.E
344344
func deleteClusterAPICRDs(clusterProxy framework.ClusterProxy) {
345345
// To remove all Cluster API CRDs we need to delete all CRDs that belong to cluster-api groups.
346346
// This includes CRDs from all providers (core, bootstrap, control-plane, infrastructure, etc.)
347-
// But we must NOT delete the operator's own CRDs (operator.cluster.x-k8s.io)
347+
// But we must NOT delete the operator's own CRDs (operator.cluster.x-k8s.io) or IPAM CRDs (ipam.cluster.x-k8s.io)
348348
crds := &apiextensionsv1.CustomResourceDefinitionList{}
349349
Expect(clusterProxy.GetClient().List(ctx, crds)).To(Succeed())
350350

351351
for _, crd := range crds.Items {
352-
// Delete CRDs that belong to cluster.x-k8s.io groups, but exclude operator CRDs
352+
// Delete CRDs that belong to cluster.x-k8s.io groups, but exclude operator and IPAM CRDs
353353
if strings.Contains(crd.Spec.Group, "cluster.x-k8s.io") &&
354-
crd.Spec.Group != "operator.cluster.x-k8s.io" {
354+
crd.Spec.Group != "operator.cluster.x-k8s.io" &&
355+
crd.Spec.Group != "ipam.cluster.x-k8s.io" {
355356
Expect(clusterProxy.GetClient().Delete(ctx, &crd)).To(Succeed())
356357
}
357358
}

0 commit comments

Comments
 (0)