Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

terraform-provider-helm_v3.0.0-pre1_x5 panic: interface conversion: interface {} is []interface {}, not map[string]interface {} #1577

Open
aRustyDev opened this issue Feb 2, 2025 · 1 comment

Comments

@aRustyDev
Copy link

Terraform, Provider, Kubernetes and Helm Versions

Terraform version: `v1.5.7`
Provider version:
- `registry.terraform.io/hashicorp/helm v3.0.0-pre1`
- `registry.terraform.io/hashicorp/kubernetes v2.35.1`
Kubernetes version: 
- Client: `v1.31.2`
- Server: `v1.30.7+orb1`

Terraform

$ terraform -v
Terraform v1.5.7
on darwin_amd64
+ provider registry.terraform.io/hashicorp/helm v3.0.0-pre1
+ provider registry.terraform.io/hashicorp/kubernetes v2.35.1

Your version of Terraform is out of date! The latest version
is 1.10.5. You can update by downloading from https://www.terraform.io/downloads.html

Kubernetes Version

$ kubectl version
Client Version: v1.31.2
Kustomize Version: v5.4.2
Server Version: v1.30.7+orb1

Orb Version

$ orb version
Version: 1.9.5 (1090500)
Commit: 8276a76896800e4a12df9d35065c7458488ac010 (v1.9.5)

Helm Version

$ helm version
version.BuildInfo{Version:"v3.16.3", GitCommit:"cfd07493f46efc9debd9cc1b02a0961186df7fdf", GitTreeState:"dirty", GoVersion:"go1.23.3"}

Node Info

$ kubectl get nodes -o wide
NAME: orbstack
~
VERSION: v1.30.7+orb1
~
OS-IMAGE: OrbStack
KERNEL-VERSION: 6.12.10-orbstack-00297-gf8f6e015b993
CONTAINER-RUNTIME: docker://27.4.1

$ kubectl describe node orbstack
ProviderID: `k3s://orbstack`
Annotations: 
   alpha.kubernetes.io/provided-node-ip: 198.19.249.2,fd07:b51a:cc66::2
   flannel.alpha.coreos.com/backend-data: null
   flannel.alpha.coreos.com/backend-type: host-gw
   flannel.alpha.coreos.com/backend-v6-data: null
   flannel.alpha.coreos.com/kube-subnet-manager: true
   flannel.alpha.coreos.com/public-ip: 198.19.249.2
   flannel.alpha.coreos.com/public-ipv6: fd07:b51a:cc66::2
   k3s.io/hostname: orbstack
   k3s.io/internal-ip: 198.19.249.2,fd07:b51a:cc66::2
   k3s.io/node-args: ["server","--disable","metrics-server,traefik,coredns","--https-listen-port","26443","--lb-server-port","26444","--docker","--container-ru...
   k3s.io/node-config-hash: BFKAPNXBOHQQL6OPIPWRDHHR7FVJWTKOTQTJSCSMATII6R5O2JPA====
   k3s.io/node-env: {}
   node.alpha.kubernetes.io/ttl: 0
   volumes.kubernetes.io/controller-managed-attach-detach: true

Affected Resource(s)

  • helm_release

Terraform Configuration Files

locals {
  settings = {
    "orbstack" = {
        "operator.replicas" = 1
        "cni.binPath" = "/var/lib/rancher/k3s/data/current/bin/"
        "cni.confPath" = "/var/lib/rancher/k3s/agent/etc/cni/net.d"
        "hubble.relay.enabled" = "true"
        "hubble.ui.enabled" = "true"
        "hubble.ui.ingress.enabled" = "true"
        "hubble.ui.ingress.className" = "traefik"
        "hubble.ui.ingress.hosts.0" = "hubble.domain.tld"
        "envoy.enabled" = "false"
        "nodeinit.enabled" = "true"
        # "cni.chainingMode" = ""
        # "cni.chainingTarget" = ""
        # "cni.exclusive" = "false"
    }
  }
}

resource "helm_release" "cilium" {
  repository = "https://helm.cilium.io/"
  chart      = "cilium"
  version    = "1.17.0-rc.2"

  name      = "cilium"
  namespace = "kube-system"

  atomic      = true
  description = "eBPF-based Networking, Security, and Observability."

  set = [ for k,v in local.settings[var.platform] : { name = k, value = v } ]
  
  values = [ file("${path.module}/values.yaml")] # using default values from ArtifactHub for 1.17.0-rc.2
}

variable "chart" {
  type = map(any)
}

variable "platform" {
  type = string
  default = "orbstack"
}

terraform {
  required_providers {
    kubernetes = {
      source  = "hashicorp/kubernetes"
      version = "2.35.1"
    }
    helm = {
      source  = "hashicorp/helm"
      version = "3.0.0-pre1"
    }
  }
}

provider "kubernetes" {
  config_path    = "~/.kube/config"
  config_context = "orbstack"
}

provider "helm" {
  kubernetes = {
    config_path    = "~/.kube/config"
    config_context = "orbstack"
  }
}

Debug Output

NOTE: In addition to Terraform debugging, please set HELM_DEBUG=1 to enable debugging info from helm.

Panic Output

https://gist.github.com/aRustyDev/7932ad1590c6cff22281c86169a843b5

Steps to Reproduce

  1. terraform plan -out orbstack.plan
  2. terraform apply -auto-approve orbstack.plan

Expected Behavior

Should deploy the config

Actual Behavior

│ Error: Plugin did not respond
│
│ The plugin encountered an error, and failed to respond to the plugin6.(*GRPCProvider).ApplyResourceChange call. The plugin logs may contain more
│ details.

panic: interface conversion: interface {} is []interface {}, not map[string]interface {}

@aRustyDev
Copy link
Author

aRustyDev commented Feb 3, 2025

I tweeked my configs a bit more and I think the issue is b/c I didn't reinstall traefik. I removed the hubble.ui.ingress parts and it at least didn't panic.

New locals

locals {
  settings = {
    "orbstack" = {
        "operator.replicas" = 1
        "cni.binPath" = "/var/lib/rancher/k3s/data/current/bin/"
        "cni.confPath" = "/var/lib/rancher/k3s/agent/etc/cni/net.d"
        "hubble.relay.enabled" = "true"
        "hubble.ui.enabled" = "true"
        # "hubble.ui.ingress.enabled" = "true"
        # "hubble.ui.ingress.className" = "traefik"
        # "hubble.ui.ingress.hosts.0" = "hubble.domain.tld"
        "envoy.enabled" = "false"
        # "nodeinit.enabled" = "true"
        # "cni.chainingMode" = ""
        # "cni.chainingTarget" = ""
        # "cni.exclusive" = "false"
    }
}

This works but needed me to destroy before applying

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

No branches or pull requests

2 participants