Skip to content

Commit b36e777

Browse files
author
Chanwit Kaewkasi
authored
Merge pull request #498 from weaveworks/347-fix-empty-pending-plan
Force replan if cannot load tfplan correctly
2 parents de15fbf + 96c30d1 commit b36e777

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)