Terraform-provider-helm: Values modified outside of terraform not detected as changes

Created on 31 Oct 2019  路  2Comments  路  Source: hashicorp/terraform-provider-helm

Terraform Version

Terraform v0.12.12

Helm provider Version

~> 0.10

Affected Resource(s)

  • helm_resource

Terraform Configuration Files

resource "helm_release" "service" {
  name       = "service"
  chart      = "service"
  version    = "0.1.7"
  repository = module.k8s.helm_repository_name

  set {
    name  = "image.tag"
    value = "latest"
  }
}

Expected Behaviour

A diff should be detected if settings of the release are modified outside of Terraform.

Actual Behavior

The helm provider does not detect changes to the release done outside of Terraform.

Steps to Reproduce

  1. terraform apply

    $ helm get values service
    image:
     tag: latest # <-- Value as set in terraform
    
  2. helm upgrade service service --reuse-values --set image.tag=test

    $ helm get values service
    image:
     tag: test # <-- Value in the deployed release changed
    
  3. terraform apply (Should detect the change done on the release when refreshing the state)
    ... helm_release.service: Refreshing state... [id=service] ... Apply complete! Resources: 0 added, 0 changed, 0 destroyed.
acknowledged enhancement themdiffs

Most helpful comment

Just ran into this, and it is very annoying. For a workaround, I did this:

  set {
    name = "valuesChecksum"
    value = filemd5("${path.module}/values-production.yaml") 
  }

All 2 comments

Just ran into this, and it is very annoying. For a workaround, I did this:

  set {
    name = "valuesChecksum"
    value = filemd5("${path.module}/values-production.yaml") 
  }

If edit resources created by helm directly, they also will be skipped, because values/release file not changed

Was this page helpful?
0 / 5 - 0 ratings