Skip to content

Commit 96c30d1

Browse files
committed
force replan if cannot load tfplan correctly
Signed-off-by: Tom Huang <tom.huang@weave.works>
1 parent de15fbf commit 96c30d1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

controllers/tf_controller_apply.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ func (r *TerraformReconciler) apply(ctx context.Context, terraform infrav1.Terra
5858
PendingPlan: terraform.Status.Plan.Pending,
5959
})
6060
if err != nil {
61+
// replan if errors occur
62+
terraform.Status.Plan.Pending = ""
63+
terraform.Status.LastPlannedRevision = ""
64+
terraform.Status.LastAttemptedRevision = ""
6165
return infrav1.TerraformNotReady(
6266
terraform,
6367
revision,

0 commit comments

Comments
 (0)