hashicorp / terraform-k8s

Terraform Cloud Operator for Kubernetes
https://learn.hashicorp.com/tutorials/terraform/kubernetes-operator?in=terraform/kubernetes
Mozilla Public License 2.0
454 stars 71 forks source link

SyncWorkspace pod reporting workspace as errored even though it's not #142

Open EmmanuelOgiji opened 2 years ago

EmmanuelOgiji commented 2 years ago

Community Note

terraform-k8s & Kubernetes Version

terraform-k8s version: 1.1.0 Kubernetes version 1.22

Affected Resource(s)

Terraform cloud operator sync workspace pod is reporting that a workspace run could not be completed and the workspace has errored even though that is not the case.

This is part of migrating state to Terraform Cloud and although the initial run failed, a few terraform state commands and UI re-runs later, the workspace applied successfully. However, the sync workspace pod references the latest runID i.e. the successful run for still reports its status as errored.

Deleted the pod and allowed the deployment/replicaset to recreate to see if that would help but it didn't

Debug Output

Log Output: https://gist.github.com/EmmanuelOgiji/864091c75f6bc746b1dea7f862d376f5

Expected Behavior

The operator pod should have reconciled and reported that the workspace is in fact now applied.

Actual Behavior

It still reports as errored

Steps to Reproduce

EmmanuelOgiji commented 2 years ago

Seems like this is the same issue as https://github.com/hashicorp/terraform-k8s/issues/143. I resolved by triggering a "dummy" run via the operator i.e. change a variable but that is only a workaround