Skip to content

Plan fails when trying to migrate to helm v3.0 #1695

@Sri-BHP

Description

@Sri-BHP

Terraform, Provider, Kubernetes and Helm Versions

Terraform version:1.10.0
Provider version:  3.0.2
Kubernetes version: 2.38.0

Affected Resource(s)

  • helm_release

Terraform Configuration Files

resource "helm_release" "addon" {
  count                      = var.manage_via_gitops ? 0 : 1
  name                       = var.helm_config["name"]
  repository                 = try(var.helm_config["repository"], null)
  chart                      = var.helm_config["chart"]
  version                    = try(var.helm_config["version"], null)
  timeout                    = try(var.helm_config["timeout"], 1200)
  values                     = try(var.helm_config["values"], null)
  create_namespace           = var.irsa_config != null ? false : try(var.helm_config["create_namespace"], false)
  namespace                  = var.helm_config["namespace"]
  lint                       = try(var.helm_config["lint"], false)
  description                = try(var.helm_config["description"], "")
  repository_key_file        = try(var.helm_config["repository_key_file"], "")
  repository_cert_file       = try(var.helm_config["repository_cert_file"], "")
  repository_ca_file         = try(var.helm_config["repository_ca_file"], "")
  repository_username        = try(var.helm_config["repository_username"], "")
  repository_password        = try(var.helm_config["repository_password"], "")
  verify                     = try(var.helm_config["verify"], false)
  keyring                    = try(var.helm_config["keyring"], null) != null && try(var.helm_config["keyring"], null) != "" ? var.helm_config["keyring"] : null
  disable_webhooks           = try(var.helm_config["disable_webhooks"], false)
  reuse_values               = try(var.helm_config["reuse_values"], false)
  reset_values               = try(var.helm_config["reset_values"], false)
  force_update               = try(var.helm_config["force_update"], false)
  recreate_pods              = try(var.helm_config["recreate_pods"], false)
  cleanup_on_fail            = try(var.helm_config["cleanup_on_fail"], false)
  max_history                = try(var.helm_config["max_history"], 0)
  atomic                     = try(var.helm_config["atomic"], false)
  skip_crds                  = try(var.helm_config["skip_crds"], false)
  render_subchart_notes      = try(var.helm_config["render_subchart_notes"], true)
  disable_openapi_validation = try(var.helm_config["disable_openapi_validation"], false)
  wait                       = try(var.helm_config["wait"], true)
  wait_for_jobs              = try(var.helm_config["wait_for_jobs"], false)
  dependency_update          = try(var.helm_config["dependency_update"], false)
  replace                    = try(var.helm_config["replace"], false)

  postrender = {
    binary_path = try(var.helm_config["postrender"], "")
  }

  set           = try(var.helm_config["set"], null) != null ? distinct(concat(var.set_values, var.helm_config["set"])) : var.set_values
  set_sensitive = try(var.helm_config["set_sensitive"], null) != null ? concat(var.helm_config["set_sensitive"], var.set_sensitive_values) : var.set_sensitive_values

  depends_on = [module.irsa]
}

Steps to Reproduce

  1. Have an existing Helm release resource on a version earlier than v3.0
  2. Update the terrafom code to use Helm provider version 3.0 or later
  3. Run terraform plan and the plan fails with the error.

Expected Behavior

Terraform plan and apply runs successfully.

Actual Behavior

Terraform plan fails with the error below; the same error is thrown for every helm_release resource.

Error: Provider produced invalid plan
Provider "registry.terraform.io/hashicorp/helm" planned an invalid value for module.aws_eks.module.eks_blueprints_kubernetes_addons.module.cluster_autoscaler[0].module.helm_addon.helm_release.addon[0].keyring: planned value cty.StringVal("") for a non-computed attribute.

This is a bug in the provider, which should be reported in the provider's own issue tracker.


Error: Provider produced invalid plan
Provider "registry.terraform.io/hashicorp/helm" planned an invalid value for module.aws_eks.module.eks_blueprints_kubernetes_addons.module.metrics_server[0].module.helm_addon.helm_release.addon[0].keyring: planned value cty.StringVal("") for a non-computed attribute.

This is a bug in the provider, which should be reported in the provider's own issue tracker. 

I have reported the issue here as the error message itself suggests that it's a bug in the provider.

Important Factoids

The Terraform runs are on Terraform Cloud for Business.

References

None

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

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