@@ -175,6 +175,12 @@ func (r *TerraformReconciler) Reconcile(ctx context.Context, req ctrl.Request) (
175
175
return ctrl.Result {RequeueAfter : terraform .GetRetryInterval ()}, nil
176
176
}
177
177
178
+ // Return early if it's manually mode and pending
179
+ if terraform .Status .Plan .Pending != "" && ! r .forceOrAutoApply (terraform ) && ! r .shouldApply (terraform ) {
180
+ log .Info ("reconciliation is stopped to wait for a manual approve" )
181
+ return ctrl.Result {}, nil
182
+ }
183
+
178
184
terraform = infrav1 .TerraformProgressing (terraform , "Reconciliation in progress" )
179
185
if err := r .patchStatus (ctx , req .NamespacedName , terraform .Status ); err != nil {
180
186
log .Error (err , "unable to update status before Terraform initialization" )
@@ -257,12 +263,6 @@ func (r *TerraformReconciler) Reconcile(ctx context.Context, req ctrl.Request) (
257
263
}
258
264
}
259
265
260
- // Return early if it's manually mode and pending
261
- if terraform .Status .Plan .Pending != "" && ! r .forceOrAutoApply (terraform ) && ! r .shouldApply (terraform ) {
262
- log .Info ("reconciliation is stopped to wait for a manual approve" )
263
- return ctrl.Result {}, nil
264
- }
265
-
266
266
// reconcile Terraform by applying the latest revision
267
267
reconciledTerraform , reconcileErr := r .reconcile (ctx , runnerClient , * terraform .DeepCopy (), sourceObj )
268
268
if err := r .patchStatus (ctx , req .NamespacedName , reconciledTerraform .Status ); err != nil {
0 commit comments