@@ -179,14 +179,6 @@ func (r *UpgradeJobReconciler) Reconcile(ctx context.Context, req ctrl.Request)
179179func (r * UpgradeJobReconciler ) reconcileStartedJob (ctx context.Context , uj * managedupgradev1beta1.UpgradeJob ) (ctrl.Result , error ) {
180180 l := log .FromContext (ctx ).WithName ("UpgradeJobReconciler.reconcileStartedJob" )
181181
182- cont , err := r .executeHooks (ctx , uj , managedupgradev1beta1 .EventStart , noTrackingKey , eventInfoWithReason (managedupgradev1beta1 .UpgradeJobReasonStarted ), time.Time {})
183- if err != nil {
184- return ctrl.Result {}, err
185- }
186- if ! cont {
187- return ctrl.Result {}, nil
188- }
189-
190182 if r .timeSinceStartAfter (uj ) > uj .Spec .UpgradeTimeout .Duration {
191183 r .setStatusCondition (& uj .Status .Conditions , metav1.Condition {
192184 Type : managedupgradev1beta1 .UpgradeJobConditionFailed ,
@@ -197,6 +189,14 @@ func (r *UpgradeJobReconciler) reconcileStartedJob(ctx context.Context, uj *mana
197189 return ctrl.Result {}, r .Status ().Update (ctx , uj )
198190 }
199191
192+ cont , err := r .executeHooks (ctx , uj , managedupgradev1beta1 .EventStart , noTrackingKey , eventInfoWithReason (managedupgradev1beta1 .UpgradeJobReasonStarted ), time.Time {})
193+ if err != nil {
194+ return ctrl.Result {}, err
195+ }
196+ if ! cont {
197+ return ctrl.Result {}, nil
198+ }
199+
200200 var version configv1.ClusterVersion
201201 if err := r .Get (ctx , types.NamespacedName {
202202 Name : r .ManagedUpstreamClusterVersionName ,
0 commit comments