Hello Friends,
Hoping we can get some attention from HashiCorp folks here on a pending bug fix PR in the Helm Provider: Larger diff than expected when updating helm_release 'set' 'value' by adcharre · Pull Request #916 · hashicorp/terraform-provider-helm · GitHub
This fixes the following issues:
opened 11:12AM - 11 Jul 22 UTC
bug
### Terraform, Provider, Kubernetes and Helm Versions
<!--Run `terraform -v` to… show the version. If you are not running the latest version of Terraform, please upgrade because your issue may have already been fixed.
Please note that this provider only supports Helm 3.-->
```
Terraform version: v1.2.4
Provider version: v2.6.0
Kubernetes version: v1.23.6
Helm version: version.BuildInfo{Version:"v3.9.0", GitCommit:"7ceeda6c585217a19a1131663d8cd1f7d641b2a7", GitTreeState:"clean", GoVersion:"go1.17.5"}
```
### Affected Resource(s)
- helm_release
### Terraform Configuration Files
```hcl
terraform {
required_version = ">= 1.0.0"
required_providers {
kubernetes = {
source = "hashicorp/kubernetes"
version = ">= 2.8.0"
}
helm = {
source = "hashicorp/helm"
version = ">= 2.4.1"
}
}
}
provider "kubernetes" {
config_path = "~/.kube/config"
}
provider "helm" {
kubernetes {
config_path = "~/.kube/config"
}
}
variable "memory" {
type = string
}
resource "helm_release" "test" {
name = "test"
repository = "https://coredns.github.io/helm"
chart = "coredns"
set {
name = "replicaCount"
value = "1"
}
set {
name = "resources.requests.memory"
value = var.memory
}
}
```
### Debug Output
NOTE: In addition to Terraform debugging, please set HELM_DEBUG=1 to enable debugging info from helm.
Terraform log and state file: https://gist.github.com/adcharre/120482e9f4d4bcb5641c49f6fb35f0f1
### Panic Output
### Steps to Reproduce
1. `terraform apply -auto-approve -var memory=100Mi`
2. `terraform apply -auto-approve -var memory=120Mi`
3. `terraform apply -auto-approve -var memory=100Mi`
### Expected Behavior
On second and third apply, xxx and yyy would be a number.
```
helm_release.test: Refreshing state... [id=test]
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
~ update in-place
Terraform will perform the following actions:
# helm_release.test will be updated in-place
~ resource "helm_release" "test" {
id = "test"
name = "test"
# (28 unchanged attributes hidden)
- set {
- name = "resources.requests.memory" -> null
- value = "xxxMi" -> null
}
+ set {
+ name = "resources.requests.memory"
+ value = "yyyMi"
}
}
Plan: 0 to add, 1 to change, 0 to destroy.
helm_release.test: Modifying... [id=test]
helm_release.test: Modifications complete after 1s [id=test]
Apply complete! Resources: 0 added, 1 changed, 0 destroyed.
```
### Actual Behavior
On second and third apply:
```
helm_release.test: Refreshing state... [id=test]
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
~ update in-place
Terraform will perform the following actions:
# helm_release.test will be updated in-place
~ resource "helm_release" "test" {
id = "test"
name = "test"
# (27 unchanged attributes hidden)
- set {
- name = "replicaCount" -> null
- value = "1" -> null
}
+ set {
+ name = "replicaCount"
+ value = "1"
}
- set {
- name = "resources.requests.memory" -> null
- value = "xxxMi" -> null
}
+ set {
+ name = "resources.requests.memory"
+ value = "yyyMi"
}
}
Plan: 0 to add, 1 to change, 0 to destroy.
helm_release.test: Modifying... [id=test]
helm_release.test: Modifications complete after 1s [id=test]
Apply complete! Resources: 0 added, 1 changed, 0 destroyed.
```
On the third apply the follow warning is also seen in the log:
```
2022-07-11T12:02:27.741+0100 [WARN] Provider "registry.terraform.io/hashicorp/helm" produced an unexpected new value for helm_release.test during refresh.
- .set: planned set element cty.ObjectVal(map[string]cty.Value{"name":cty.StringVal("replicaCount"), "type":cty.NullVal(cty.String), "value":cty.StringVal("1")}) does not correlate with any element in actual
```
This looks like it might therefore be related to #711
Examining the state file it is clear that the "type" value for the "replicaCount" is now set to null.
### Important Factoids
### References
- #711
### Community Note
* Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request
* If you are interested in working on this issue or have submitted a pull request, please leave a comment
opened 05:54AM - 18 Mar 21 UTC
bug
### Terraform, Provider, Kubernetes and Helm Versions
<!--Run `terraform -v` to… show the version. If you are not running the latest version of Terraform, please upgrade because your issue may have already been fixed.
Please note that this provider only supports Helm 3.-->
```
Terraform version: 0.14.7
Provider version: 2.0.3
Kubernetes version: 1.18.
Helm version: 3?
```
### Affected Resource(s)
- aws-load-balancer-controller
- https://aws.github.io/eks-charts
- external-dns
- https://charts.bitnami.com/bitnami/
### Terraform Configuration Files
... elided ...
### Debug Output
```
Error: Provider produced inconsistent final plan
When expanding the plan for
module.tivo_cluster.module.alb_ingress_controller.helm_release.this to include
new values learned so far during apply, provider
"registry.terraform.io/hashicorp/helm" produced an invalid new value for .set:
planned set element
cty.ObjectVal(map[string]cty.Value{"name":cty.StringVal("region"),
"type":cty.NullVal(cty.String), "value":cty.StringVal("us-east-1")}) does not
correlate with any element in actual.
This is a bug in the provider, which should be reported in the provider's own
issue tracker.
```
### Panic Output
N/A
### Steps to Reproduce
1. `terraform apply` after updating to latest helm provider
### Expected Behavior
Error free execution
### Actual Behavior
Above error message reported. Ran apply again and there was zero diff, so nothing more reported.
### Important Factoids
N/A
### References
### Community Note
* Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request
* If you are interested in working on this issue or have submitted a pull request, please leave a comment
which are both quite important for our organization and many others that shared the same concerns in the PR and related issues
the fix seems straightforward by all accounts, so it would be wonderful if someone from HC can help us move it along through the approval/merge/release process
Thanks!
Danny
1 Like