Skip to content

Helm 3.1 failing failed to create typed patch object because field not declared in schema #1721

@robabbott42

Description

@robabbott42

Terraform, Provider, Kubernetes and Helm Versions

Terraform version: latest (1.14)
Provider version: 1.1
Kubernetes version:1.32.6

Affected Resource(s)

resource "helm_release"

Terraform Configuration Files

terraform

resource "helm_release" "this" {
  depends_on = [
    kubernetes_storage_class_v1.sonarqube_disk,
    kubernetes_secret_v1.this
  ]

  name         = "sonarqube"
  namespace    = kubernetes_namespace.this.metadata[0].name
  repository   = "oci://wegmans.azurecr.io/helm" #"https://SonarSource.github.io/helm-chart-sonarqube"
  chart        = "sonarqube"
  version      = var.chart_version
  reset_values = true
  force_update = var.forceUpdate
  set = [
    {
      name  = "ingress.hosts[0].name"
      value = var.host_name
    },
    {
      name  = "jdbcOverwrite.jdbcUrl"
      value = "jdbc:postgresql://${var.database.fqdn}:5432/${var.database.name}?socketTimeout=1500"
    },
    {
      name  = "jdbcOverwrite.jdbcUsername"
      value = var.database.administrator_login
    }
  ]

  values = [
    var.values
  ]
}

tfvars file

. . .
securityContext:
runAsNonRoot: true
runAsUser: 1000
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
. . .

Debug Output

Run terraform plan -no-color -input=false -lock=false -out terraform.plan -parallelism=10 -refresh=false '-var-file=./environment/Non-Production.tfvars' > terraform.output

Error: Visit Error

with module.helm_chart.helm_release.this,
on modules/helm_chart/main.tf line 118, in resource "helm_release" "this":
118: resource "helm_release" "this" {

failed to create typed patch object (sonarqube/sonarqube-sonarqube; apps/v1,
Kind=StatefulSet):
.spec.template.spec.securityContext.allowPrivilegeEscalation: field not
declared in schema

Error: Parser Error

with module.kubernetes.module.ingress.helm_release.this,
on modules/kubernetes/ingress/main.tf line 31, in resource "helm_release" "this":
31: resource "helm_release" "this" {

duplicate entry for /v1, Kind=APIResourceList
Error: Process completed with exit code 1.

Steps to Reproduce

  1. terraform plan

Expected Behavior

Produce a terraform plan withou errors

Actual Behavior

It fails because its not expecting these paramaetrs from tfvars

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions