Skip to content

v3 Provider appears to randomly remove helm_release resources from TF state - Hard to reproduce #1669

@gpapakyriakopoulos

Description

@gpapakyriakopoulos

Terraform, Provider, Kubernetes and Helm Versions

Terraform version: 1.5.7
Provider version: 3.0.2
Kubernetes version: 1.31 - EKS

Affected Resource(s)

  • helm_release

Terraform Configuration Files

N/A

Expected Behavior

helm_release resources that have not been changed do not get their TF state files changed at all

Actual Behavior

After several successful Terraform apply runs (no changes to any helm_release resources), the terraform state for several (but not all) helm_release resources was updated and those resources completely removed from the state.

This resulted in Terraform trying to recreate those Helm Releases even though they already existed in the EKS cluster, resulting in an error :

cannot re-use a name that is still in use

Important Factoids

We cannot debug the whole thing and we are having trouble easily reproducing this as we are seeing the outcomes and comparing terraform states (v1 is ok and then v2 is empty).
We are also a bit suspicious of this method: https://github.com/hashicorp/terraform-provider-helm/blob/main/helm/resource_helm_release.go#L873 especially the resourceReleaseExists return that removes resources from the context below.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions