Skip to content

Commit 695e824

Browse files
committed
fix prompt disappear in manual mode
Signed-off-by: Chanwit Kaewkasi <chanwit@gmail.com>
1 parent 2264258 commit 695e824

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

controllers/terraform_controller.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,12 @@ func (r *TerraformReconciler) Reconcile(ctx context.Context, req ctrl.Request) (
175175
return ctrl.Result{RequeueAfter: terraform.GetRetryInterval()}, nil
176176
}
177177

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+
178184
terraform = infrav1.TerraformProgressing(terraform, "Reconciliation in progress")
179185
if err := r.patchStatus(ctx, req.NamespacedName, terraform.Status); err != nil {
180186
log.Error(err, "unable to update status before Terraform initialization")
@@ -257,12 +263,6 @@ func (r *TerraformReconciler) Reconcile(ctx context.Context, req ctrl.Request) (
257263
}
258264
}
259265

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-
266266
// reconcile Terraform by applying the latest revision
267267
reconciledTerraform, reconcileErr := r.reconcile(ctx, runnerClient, *terraform.DeepCopy(), sourceObj)
268268
if err := r.patchStatus(ctx, req.NamespacedName, reconciledTerraform.Status); err != nil {

0 commit comments

Comments
 (0)