In the cleanup code to remove old resources that are not part of the current resource generation, the secret containing the terraform outputs, defined by spec.outputsSecret, is also getting removed.
Since the labels that are getting added to the secrets are used for ownership to make cleanup easy, it's deleting things that should persist. The code should recognize resources that should not be removed.
In the cleanup code to remove old resources that are not part of the current resource generation, the secret containing the terraform outputs, defined by
spec.outputsSecret
, is also getting removed.https://github.com/isaaguilar/terraform-operator/blob/aec31a2e60a2cf754b74fec357ea345a73a90468/pkg/controllers/terraform_controller.go#L875-L880
Since the labels that are getting added to the secrets are used for ownership to make cleanup easy, it's deleting things that should persist. The code should recognize resources that should not be removed.