@@ -84,7 +84,6 @@ func (r *IBMPowerVSImageReconciler) Reconcile(ctx context.Context, req ctrl.Requ
8484 var cluster * infrav1.IBMPowerVSCluster
8585 scopeParams := scope.PowerVSImageScopeParams {
8686 Client : r .Client ,
87- Logger : log ,
8887 IBMPowerVSImage : ibmPowerVSImage ,
8988 ServiceEndpoint : r .ServiceEndpoint ,
9089 }
@@ -99,7 +98,7 @@ func (r *IBMPowerVSImageReconciler) Reconcile(ctx context.Context, req ctrl.Requ
9998 }
10099
101100 // Create the scope
102- imageScope , err := scope .NewPowerVSImageScope (scopeParams )
101+ imageScope , err := scope .NewPowerVSImageScope (ctx , scopeParams )
103102 if err != nil {
104103 return ctrl.Result {}, fmt .Errorf ("failed to create scope: %w" , err )
105104 }
@@ -240,7 +239,7 @@ func reconcileImage(ctx context.Context, img *models.ImageReference, imageScope
240239 v1beta1conditions .MarkTrue (imageScope .IBMPowerVSImage , infrav1 .ImageReadyCondition )
241240 v1beta2conditions .Set (imageScope .IBMPowerVSImage , metav1.Condition {
242241 Type : infrav1 .IBMPowerVSImageReadyV1Beta2Condition ,
243- Status : metav1 .ConditionFalse ,
242+ Status : metav1 .ConditionTrue ,
244243 Reason : infrav1 .IBMPowerVSImageReadyV1Beta2Reason ,
245244 })
246245
@@ -329,7 +328,7 @@ func (r *IBMPowerVSImageReconciler) SetupWithManager(mgr ctrl.Manager) error {
329328}
330329
331330func patchIBMPowerVSImage (ctx context.Context , patchHelper * v1beta1patch.Helper , ibmPowerVSImage * infrav1.IBMPowerVSImage ) error {
332- // Before computing ready condition, make sure that InstanceReady is always set.
331+ // Before computing ready condition, make sure that ImageReady is always set.
333332 // NOTE: This is required because v1beta2 conditions comply to guideline requiring conditions to be set at the
334333 // first reconcile.
335334 if c := v1beta2conditions .Get (ibmPowerVSImage , infrav1 .IBMPowerVSImageReadyV1Beta2Condition ); c == nil {
@@ -351,13 +350,13 @@ func patchIBMPowerVSImage(ctx context.Context, patchHelper *v1beta1patch.Helper,
351350 // always update the readyCondition.
352351 v1beta1conditions .SetSummary (ibmPowerVSImage ,
353352 v1beta1conditions .WithConditions (
354- infrav1 .InstanceReadyCondition ,
353+ infrav1 .ImageReadyCondition ,
355354 ),
356355 )
357356
358- if err := v1beta2conditions .SetSummaryCondition (ibmPowerVSImage , ibmPowerVSImage , infrav1 .IBMPowerVSImageReadyV1Beta2Condition ,
357+ if err := v1beta2conditions .SetSummaryCondition (ibmPowerVSImage , ibmPowerVSImage , infrav1 .IBMPowerVSImageReadyCondition ,
359358 v1beta2conditions.ForConditionTypes {
360- infrav1 .IBMPowerVSMachineInstanceReadyV1Beta2Condition ,
359+ infrav1 .IBMPowerVSImageReadyV1Beta2Condition ,
361360 },
362361 // Using a custom merge strategy to override reasons applied during merge.
363362 v1beta2conditions.CustomMergeStrategy {
@@ -371,13 +370,13 @@ func patchIBMPowerVSImage(ctx context.Context, patchHelper *v1beta1patch.Helper,
371370 ),
372371 },
373372 ); err != nil {
374- return fmt .Errorf ("failed to set %s condition: %w" , infrav1 .IBMPowerVSImageReadyV1Beta2Condition , err )
373+ return fmt .Errorf ("failed to set %s condition: %w" , infrav1 .IBMPowerVSImageReadyCondition , err )
375374 }
376375
377376 // Patch the IBMPowerVSImage resource.
378377 return patchHelper .Patch (ctx , ibmPowerVSImage , v1beta1patch.WithOwnedV1Beta2Conditions {Conditions : []string {
378+ infrav1 .IBMPowerVSImageReadyCondition ,
379379 infrav1 .IBMPowerVSImageReadyV1Beta2Condition ,
380- infrav1 .IBMPowerVSMachineInstanceReadyV1Beta2Condition ,
381380 clusterv1beta1 .PausedV1Beta2Condition ,
382381 }})
383382}
0 commit comments