@@ -10,9 +10,12 @@ import (
1010 "fmt"
1111
1212 . "github.com/onsi/ginkgo/v2"
13+ . "github.com/onsi/gomega"
1314 appsv1 "k8s.io/api/apps/v1"
1415 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
16+ "k8s.io/apimachinery/pkg/types"
1517 clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
18+ addonsv1 "sigs.k8s.io/cluster-api/exp/addons/api/v1beta1"
1619 "sigs.k8s.io/cluster-api/test/framework"
1720
1821 "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/api/v1alpha1"
@@ -89,14 +92,24 @@ func waitForCalicoToBeReadyInWorkloadCluster(
8992) {
9093 switch input .strategy {
9194 case v1alpha1 .AddonStrategyClusterResourceSet :
92- waitForClusterResourceSetToApplyResourcesInCluster (
95+ crs := & addonsv1.ClusterResourceSet {}
96+ Expect (input .clusterProxy .GetClient ().Get (
9397 ctx ,
94- waitForClusterResourceSetToApplyResourcesInClusterInput {
95- name : "calico-cni-installation-" + input .workloadCluster .Name ,
96- clusterProxy : input .clusterProxy ,
97- cluster : input .workloadCluster ,
98- intervals : input .clusterResourceSetIntervals ,
98+ types.NamespacedName {
99+ Name : "calico-cni-installation-" + input .workloadCluster .Name ,
100+ Namespace : input .workloadCluster .Namespace ,
99101 },
102+ crs ,
103+ )).To (Succeed ())
104+
105+ framework .WaitForClusterResourceSetToApplyResources (
106+ ctx ,
107+ framework.WaitForClusterResourceSetToApplyResourcesInput {
108+ ClusterResourceSet : crs ,
109+ ClusterProxy : input .clusterProxy ,
110+ Cluster : input .workloadCluster ,
111+ },
112+ input .clusterResourceSetIntervals ... ,
100113 )
101114 case v1alpha1 .AddonStrategyHelmAddon :
102115 WaitForHelmReleaseProxyReadyForCluster (
@@ -193,14 +206,24 @@ func waitForCiliumToBeReadyInWorkloadCluster(
193206) {
194207 switch input .strategy {
195208 case v1alpha1 .AddonStrategyClusterResourceSet :
196- waitForClusterResourceSetToApplyResourcesInCluster (
209+ crs := & addonsv1.ClusterResourceSet {}
210+ Expect (input .clusterProxy .GetClient ().Get (
197211 ctx ,
198- waitForClusterResourceSetToApplyResourcesInClusterInput {
199- name : "cilium-cni-installation-" + input .workloadCluster .Name ,
200- clusterProxy : input .clusterProxy ,
201- cluster : input .workloadCluster ,
202- intervals : input .clusterResourceSetIntervals ,
212+ types.NamespacedName {
213+ Name : "cilium-cni-installation-" + input .workloadCluster .Name ,
214+ Namespace : input .workloadCluster .Namespace ,
215+ },
216+ crs ,
217+ )).To (Succeed ())
218+
219+ framework .WaitForClusterResourceSetToApplyResources (
220+ ctx ,
221+ framework.WaitForClusterResourceSetToApplyResourcesInput {
222+ ClusterResourceSet : crs ,
223+ ClusterProxy : input .clusterProxy ,
224+ Cluster : input .workloadCluster ,
203225 },
226+ input .clusterResourceSetIntervals ... ,
204227 )
205228 case v1alpha1 .AddonStrategyHelmAddon :
206229 WaitForHelmReleaseProxyReadyForCluster (
0 commit comments