@@ -88,27 +88,21 @@ func (actuator floatingipActuator) ListOSResourcesForAdoption(ctx context.Contex
8888func (actuator floatingipCreateActuator ) ListOSResourcesForImport (ctx context.Context , obj orcObjectPT , filter filterT ) (iter.Seq2 [* osResourceT , error ], progress.ReconcileStatus ) {
8989 var reconcileStatus progress.ReconcileStatus
9090
91- network , rs := dependency .FetchDependency (
91+ network , rs := dependency .FetchDependency [ * orcv1alpha1. Network ] (
9292 ctx , actuator .k8sClient , obj .Namespace , filter .FloatingNetworkRef , "Network" ,
93- func (dep * orcv1alpha1.Network ) bool {
94- return orcv1alpha1 .IsAvailable (dep ) && dep .Status .ID != nil
95- },
93+ orcv1alpha1 .IsAvailable ,
9694 )
9795 reconcileStatus = reconcileStatus .WithReconcileStatus (rs )
9896
99- port , rs := dependency .FetchDependency (
97+ port , rs := dependency .FetchDependency [ * orcv1alpha1. Port ] (
10098 ctx , actuator .k8sClient , obj .Namespace , filter .PortRef , "Port" ,
101- func (dep * orcv1alpha1.Port ) bool {
102- return orcv1alpha1 .IsAvailable (dep ) && dep .Status .ID != nil
103- },
99+ orcv1alpha1 .IsAvailable ,
104100 )
105101 reconcileStatus = reconcileStatus .WithReconcileStatus (rs )
106102
107- project , rs := dependency .FetchDependency (
103+ project , rs := dependency .FetchDependency [ * orcv1alpha1. Project ] (
108104 ctx , actuator .k8sClient , obj .Namespace , filter .ProjectRef , "Project" ,
109- func (dep * orcv1alpha1.Project ) bool {
110- return orcv1alpha1 .IsAvailable (dep ) && dep .Status .ID != nil
111- },
105+ orcv1alpha1 .IsAvailable ,
112106 )
113107 reconcileStatus = reconcileStatus .WithReconcileStatus (rs )
114108
@@ -145,9 +139,7 @@ func (actuator floatingipCreateActuator) CreateResource(ctx context.Context, obj
145139 if resource .FloatingNetworkRef != nil {
146140 // Fetch dependencies and ensure they have our finalizer
147141 network , networkDepRS := networkDep .GetDependency (
148- ctx , actuator .k8sClient , obj , func (dep * orcv1alpha1.Network ) bool {
149- return orcv1alpha1 .IsAvailable (dep ) && dep .Status .ID != nil
150- },
142+ ctx , actuator .k8sClient , obj , orcv1alpha1 .IsAvailable ,
151143 )
152144 reconcileStatus = reconcileStatus .WithReconcileStatus (networkDepRS )
153145 if network != nil {
@@ -160,9 +152,7 @@ func (actuator floatingipCreateActuator) CreateResource(ctx context.Context, obj
160152 if resource .FloatingSubnetRef != nil {
161153 // Fetch dependencies and ensure they have our finalizer
162154 subnet , subnetDepRS := subnetDep .GetDependency (
163- ctx , actuator .k8sClient , obj , func (dep * orcv1alpha1.Subnet ) bool {
164- return orcv1alpha1 .IsAvailable (dep ) && dep .Status .ID != nil
165- },
155+ ctx , actuator .k8sClient , obj , orcv1alpha1 .IsAvailable ,
166156 )
167157 reconcileStatus = reconcileStatus .WithReconcileStatus (subnetDepRS )
168158 if subnet != nil {
@@ -175,9 +165,7 @@ func (actuator floatingipCreateActuator) CreateResource(ctx context.Context, obj
175165 if resource .PortRef != nil {
176166 // Fetch dependencies and ensure they have our finalizer
177167 port , portDepRS := portDep .GetDependency (
178- ctx , actuator .k8sClient , obj , func (dep * orcv1alpha1.Port ) bool {
179- return orcv1alpha1 .IsAvailable (dep ) && dep .Status .ID != nil
180- },
168+ ctx , actuator .k8sClient , obj , orcv1alpha1 .IsAvailable ,
181169 )
182170 reconcileStatus = reconcileStatus .WithReconcileStatus (portDepRS )
183171 if port != nil {
@@ -188,9 +176,7 @@ func (actuator floatingipCreateActuator) CreateResource(ctx context.Context, obj
188176 var projectID string
189177 if resource .ProjectRef != nil {
190178 project , projectDepRS := projectDependency .GetDependency (
191- ctx , actuator .k8sClient , obj , func (dep * orcv1alpha1.Project ) bool {
192- return orcv1alpha1 .IsAvailable (dep ) && dep .Status .ID != nil
193- },
179+ ctx , actuator .k8sClient , obj , orcv1alpha1 .IsAvailable ,
194180 )
195181 reconcileStatus = reconcileStatus .WithReconcileStatus (projectDepRS )
196182 if project != nil {
0 commit comments