Open CiucurDaniel opened 1 year ago
Ok so if I just try to set a single line string it works:
set {
name = "server.ha.config"
type = "string"
value = "this works"
}
Then the question still remains how can I set a multiline string value?
This issue might be changed to a BUG it seems the provider has a hard time setting that value as it's a HCL. We should be able to use set to set different string values such as my use case or as another example setting the content of a config map data which a a script or HCL.
@CiucurDaniel did you ever find a workaround?
FYI, I just stumbled on this while using the following:
Terraform version: 1.6.4
Helm Provider version: 2.14.0
Kubernetes version: 1.30
While running the following snippet
resource "helm_release" "this" {
name = var.release_name
chart = "chart-1.0.0.tgz"
namespace = var.namespace
lint = true
atomic = true
set {
name = "config.app-conf.properties"
type = "string"
value = <<EOF
hostname=xpto
user=user
password=pass
dbname=dbname
EOF
}
}
The chart uses a template for secrets that expect the value app-conf to be a string but seems to arrive as map
│ Error: malformed chart or values:
│ templates/: template: chart/templates/secret-files.yaml:11:26: executing "chart/templates/secret-files.yaml" at <b64enc>: wrong type for value; expected string; got map[string]interface {}
│
│ with helm_release.this,
│ on main.tf line 11, in resource "helm_release" "this":
│ 11: resource "helm_release" "this" {
Terraform version, Kubernetes provider version and Kubernetes version
Terraform configuration
Values file portion which I try to overwrite:
Question
As you can see under
server.ha.config
we have a HCL file. I try to replace that config with a file that I templated (in order to add the secrets) but it fails with error:How can we use
set { }
in order to set a multiline string in the values file?