Terraform-provider-helm: Provider does not create diff for local chart changes

Created on 2 Jun 2020  路  4Comments  路  Source: hashicorp/terraform-provider-helm

Issue was reported here but the title is unclear and that issue was closed. Also a fix is suggested here, but seems to be stuck since the original issue was closed out.

Seeing this issue with helm3.

When keeping charts locally, changes to the template yaml files will not cause a diff when running terraform plan. I've worked around this by incrementing the local chart version or using taints.

Terraform v0.12.24

Provider Version

helm (hashicorp/helm) 1.2.1

Affected Resource(s)

  • helm_release

Expected Behavior

Diff should be created when a template changes

Actual Behavior

No diff was created

Steps to Reproduce

  1. Create a local chart with a template
  2. Create a helm release resource that utilizes the chart
  3. Run terraform apply to create the resource
  4. Update the template yaml
  5. run terraform plan or terraform apply and see no diff is created.

References

enhancement needs-investigation themdiffs

Most helpful comment

Oh! Great you found it, I was searching for it several minutes, and I knew it, I read it!

This version number should be incremented each time you make changes to the chart and its templates, including the app version.

So yes, this is the expected behavior this doesn't mean that is odd. What I expect is that if I change a line in the chart should be updated. I agree, actually, I have a workaround in my code base that add as fake hash value to the release with an md5 of the chart folder.

The idea behind #357, is perfectly valid, the problem is that lacks the acceptance test, usually the hardest part to do in a chart, I will try to allocate some time to fix this.

All 4 comments

As described on the helm documentation (I read it but I couldn't find it, right now)
a the release version should be increased every time a change happened on it, at least if you want to redeploy it. Are you upgrading the version?

Updating the chart version is my "workaround" to get the tf diff, but from your comment that means it's expected behavior. I found it called out as a comment on this page: https://helm.sh/docs/topics/library_charts/.

It's a little at odds with how terraform works in that any change in tf almost always generates a diff, but you've shown this isn't a bug in the provider. Thanks for your quick response!

Oh! Great you found it, I was searching for it several minutes, and I knew it, I read it!

This version number should be incremented each time you make changes to the chart and its templates, including the app version.

So yes, this is the expected behavior this doesn't mean that is odd. What I expect is that if I change a line in the chart should be updated. I agree, actually, I have a workaround in my code base that add as fake hash value to the release with an md5 of the chart folder.

The idea behind #357, is perfectly valid, the problem is that lacks the acceptance test, usually the hardest part to do in a chart, I will try to allocate some time to fix this.

This version number should be incremented each time you make changes to the chart and its templates, including the app version.

I am not sure, but this advise seems rather to apply in cases where the chart is actually released to some repository, where others would reference it by name and version. In cases where one simply keeps the chart locally and deploys it, I think it produces a strange development experience, especially when compared how other terraform resources are handled and that the resource is already versioned when it is part of a terraform module. At least it took me some time to recognize this behavior and search for this issue here.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

stefanthorpe picture stefanthorpe  路  14Comments

aaronmell picture aaronmell  路  22Comments

dangarthwaite picture dangarthwaite  路  19Comments

iliasbertsimas picture iliasbertsimas  路  12Comments

mstrzele picture mstrzele  路  13Comments