How do I set a null value to remove a config field with the helm provider?

32 views Asked by At

I'm using a community chart that unfortunately has a CPU limit hard coded in its default values.yaml. I don't want to change the limit I want to remove it all together.

I can't set it to 0 either because I get an error spec.containers[0].resources.requests: Invalid value: "500m": must be less than or equal to cpu limit of 0- could be specific to GKE NAP.

This is rejected by the API because "~" and "null" come through as strings.

locals {
   values = {
    someconfig = {
      resources = {
        requests = {
          cpu    = "500m"
          memory = "2Gi"
        }
        limits = {
          memory = "2Gi"
          # Remove CPU limit set in default values.yaml
          cpu    = "~" # also tried "null"
        }
      }
    }
  }
}

resource "helm_release" "derp" {
  ....
  name      = "blah"
  namespace = "blah"
  values = [
    yamlencode(local.values)
  ]
}

While there was regression the latest version of helm should see a null value and not fall back to the default values.yaml value, it should set it to null.

0

There are 0 answers