Skip to content

Unable to pass boolean value to helm chart #1677

Description

@ocofaigh

Terraform, Provider, Kubernetes and Helm Versions

Terraform version: v1.10.5
Provider version: v2.17.0
Kubernetes version: OCP 4.17 (Kubernetes 1.30)

Affected Resource(s)

  • helm_release

Terraform Configuration Files

resource "helm_release" "cloud_monitoring_agent" {
  name             = "sysdig-agent"
  chart            = "sysdig-deploy"
  repository       = "https://charts.sysdig.com"
  version          = "1.89.0"
  namespace        = "ibm-observe"
  create_namespace = true
  timeout          = 1200
  wait             = true
  recreate_pods    = true
  force_update     = true
  reset_values     = true

  values = [
    yamlencode({
      agent = {
        extraVolumes = {
          volumes = [
            {
              name = "root-vol"
              hostPath = {
                path = "/"
              }
            },
            {
              name = "tmp-vol"
              hostPath = {
                path = "/tmp"
              }
            }
          ],
          mounts = [
            {
              mountPath = "/host"
              name      = "root-vol"
              readOnly  = true
            },
            {
              mountPath = "/host/tmp"
              name      = "tmp-vol"
            }
          ]
        }
      }
    })
  ]
}

Debug Output

Error: failed to replace object: DaemonSet in version "v1" cannot be handled as a DaemonSet: json: cannot unmarshal string into Go struct field VolumeMount.spec.template.spec.containers.volumeMounts.readOnly of type bool

From the terraform plan, I can see that this value is being passed as a string, and it seems the helm chart wants it to be a boolean

Image

I can not figure out how to have this passed as a boolean by the helm provider so the helm chart deploy passes?

Panic Output

Steps to Reproduce

  1. terraform apply

Expected Behavior

Actual Behavior

Important Factoids

References

Community Note

  • Please vote on this issue by adding a 👍 reaction 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions