tofu-controller icon indicating copy to clipboard operation
tofu-controller copied to clipboard

Add an option to handle the labels copying for the tfstate secret

Open anpolychrono opened this issue 8 months ago • 0 comments

It might be a good idea to handle if we want to copy the labels from another controller or not. I deploy an ArgoCD Application which has Terraform and GitRepo resources. I have installed fluxcd and tf-controller in the cluster. When I sync the Application the tfstate is a secret in the namespace where the Application run. This tfstate secret has ArgoCD's labels and I believe it shouldn't because when I delete the Application the secret gets deleted before the Terraform resource and all the deployment hangs.

    labels:
      argocd.argoproj.io/instance: app1

I have by pass this by pre-creating the secret (empty tfstate) but it is not very elegant solution because it becomes out of sync when tf-runner updates the secret.

Let me know your thoughts.

anpolychrono avatar Nov 16 '23 20:11 anpolychrono