hashicorp / terraform-provider-kubernetes

Terraform Kubernetes provider
https://www.terraform.io/docs/providers/kubernetes/
Mozilla Public License 2.0
1.6k stars 976 forks source link

Unexpected volumes appearing on plan #685

Closed hposca closed 1 year ago

hposca commented 5 years ago

Hi there,

Recently I did a terraform plan which said that some volumes would be created on a deployment. Which is strange as I'm not making any volume claim. Just to check, I applied and then saw that these volumes were not there. It seems like a plan bug because it even shows incompatible volumes like EC2/Azure/GCE.

If there is anything I could do I'd be glad to help.

Thanks

Terraform Version

Terraform v0.12.13
+ provider.aws v2.28.1
+ provider.helm v0.10.4
+ provider.kubernetes v1.10.0
+ provider.null v2.1.2
+ provider.template v2.1.2

Affected Resource(s)

Terraform Configuration Files

resource "kubernetes_deployment" "kube_state_metrics" {
  metadata {
    name      = "kube-state-metrics"
    namespace = "kube-system"

    labels = {
      k8s-app = "kube-state-metrics"
    }
  }

  spec {
    replicas = 1

    selector {
      match_labels = {
        k8s-app = "kube-state-metrics"
      }
    }

    template {
      metadata {
        labels = {
          k8s-app = "kube-state-metrics"
        }
      }

      spec {
        automount_service_account_token = true

        container {
          name  = "kube-state-metrics"
          image = "bitnami/kube-state-metrics:1.7.2"

          port {
            name           = "http-metrics"
            container_port = 8080
          }

          port {
            name           = "telemetry"
            container_port = 8081
          }

          liveness_probe {
            http_get {
              path = "/healthz"
              port = "8080"
            }

            initial_delay_seconds = 5
            timeout_seconds       = 5
          }

          readiness_probe {
            http_get {
              path = "/"
              port = "8080"
            }

            initial_delay_seconds = 5
            timeout_seconds       = 5
          }
        }

        service_account_name = "kube-state-metrics"
      }
    }
  }
}

Debug Output

Not debugged yet.

Panic Output

No panic.

Expected Behavior

Shouldn't say that it would create basically all the volume types defined in https://github.com/terraform-providers/terraform-provider-kubernetes/blob/2c80accb5635246099d383af6cfb9f2811b548e2/kubernetes/schema_volume_source.go

Actual Behavior

                  + volume {
                      + name = (known after apply)

                      + aws_elastic_block_store {
                          + fs_type   = (known after apply)
                          + partition = (known after apply)
                          + read_only = (known after apply)
                          + volume_id = (known after apply)
                        }

                      + azure_disk {
                          + caching_mode  = (known after apply)
                          + data_disk_uri = (known after apply)
                          + disk_name     = (known after apply)
                          + fs_type       = (known after apply)
                          + read_only     = (known after apply)
                        }

                      + azure_file {
                          + read_only   = (known after apply)
                          + secret_name = (known after apply)
                          + share_name  = (known after apply)
                        }

                      + ceph_fs {
                          + monitors    = (known after apply)
                          + path        = (known after apply)
                          + read_only   = (known after apply)
                          + secret_file = (known after apply)
                          + user        = (known after apply)

                          + secret_ref {
                              + name = (known after apply)
                            }
                        }

                      + cinder {
                          + fs_type   = (known after apply)
                          + read_only = (known after apply)
                          + volume_id = (known after apply)
                        }

                      + config_map {
                          + default_mode = (known after apply)
                          + name         = (known after apply)

                          + items {
                              + key  = (known after apply)
                              + mode = (known after apply)
                              + path = (known after apply)
                            }
                        }

                      + downward_api {
                          + default_mode = (known after apply)

                          + items {
                              + mode = (known after apply)
                              + path = (known after apply)

                              + field_ref {
                                  + api_version = (known after apply)
                                  + field_path  = (known after apply)
                                }

                              + resource_field_ref {
                                  + container_name = (known after apply)
                                  + quantity       = (known after apply)
                                  + resource       = (known after apply)
                                }
                            }
                        }

                      + empty_dir {
                          + medium = (known after apply)
                        }

                      + fc {
                          + fs_type      = (known after apply)
                          + lun          = (known after apply)
                          + read_only    = (known after apply)
                          + target_ww_ns = (known after apply)
                        }

                      + flex_volume {
                          + driver    = (known after apply)
                          + fs_type   = (known after apply)
                          + options   = (known after apply)
                          + read_only = (known after apply)

                          + secret_ref {
                              + name = (known after apply)
                            }
                        }

                      + flocker {
                          + dataset_name = (known after apply)
                          + dataset_uuid = (known after apply)
                        }

                      + gce_persistent_disk {
                          + fs_type   = (known after apply)
                          + partition = (known after apply)
                          + pd_name   = (known after apply)
                          + read_only = (known after apply)
                        }

                      + git_repo {
                          + directory  = (known after apply)
                          + repository = (known after apply)
                          + revision   = (known after apply)
                        }

                      + glusterfs {
                          + endpoints_name = (known after apply)
                          + path           = (known after apply)
                          + read_only      = (known after apply)
                        }

                      + host_path {
                          + path = (known after apply)
                          + type = (known after apply)
                        }

                      + iscsi {
                          + fs_type         = (known after apply)
                          + iqn             = (known after apply)
                          + iscsi_interface = (known after apply)
                          + lun             = (known after apply)
                          + read_only       = (known after apply)
                          + target_portal   = (known after apply)
                        }

                      + local {
                          + path = (known after apply)
                        }

                      + nfs {
                          + path      = (known after apply)
                          + read_only = (known after apply)
                          + server    = (known after apply)
                        }

                      + persistent_volume_claim {
                          + claim_name = (known after apply)
                          + read_only  = (known after apply)
                        }

                      + photon_persistent_disk {
                          + fs_type = (known after apply)
                          + pd_id   = (known after apply)
                        }

                      + quobyte {
                          + group     = (known after apply)
                          + read_only = (known after apply)
                          + registry  = (known after apply)
                          + user      = (known after apply)
                          + volume    = (known after apply)
                        }

                      + rbd {
                          + ceph_monitors = (known after apply)
                          + fs_type       = (known after apply)
                          + keyring       = (known after apply)
                          + rados_user    = (known after apply)
                          + rbd_image     = (known after apply)
                          + rbd_pool      = (known after apply)
                          + read_only     = (known after apply)

                          + secret_ref {
                              + name = (known after apply)
                            }
                        }

                      + secret {
                          + default_mode = (known after apply)
                          + optional     = (known after apply)
                          + secret_name  = (known after apply)

                          + items {
                              + key  = (known after apply)
                              + mode = (known after apply)
                              + path = (known after apply)
                            }
                        }

                      + vsphere_volume {
                          + fs_type     = (known after apply)
                          + volume_path = (known after apply)
                        }
                      }

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform plan
  2. Surprise 😱
  3. terraform apply
  4. kubectl edit deploy/kube-state-metrics --namespace kube-system , none of these volumes appear

Important Factoids

Nothing special, running on AWS EKS.

References

None yet

JordanP commented 5 years ago

Same here after an upgrade to 1.10. Yeah "surprise" but no harm done in my case.

pdecat commented 5 years ago

I can reproduce the issue with providers versions 1.10.0, 1.9.0 and 1.8.0, but not 1.7.0.

Never noticed it because all my deployments happen to have at least one volume.

pdecat commented 5 years ago

Tried to work it around with an empty volume {} block but it crashed the provider:

kubernetes_deployment.kube_state_metrics: Creating...

Error: rpc error: code = Unavailable desc = transport is closing

panic: interface conversion: interface {} is nil, not map[string]interface {}
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4:
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4: goroutine 97 [running]:
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4: github.com/terraform-providers/terraform-provider-kubernetes/kubernetes.expandVolumes(0xc0007b0790, 0x1,
 0x1, 0x6, 0xc0006d9518, 0x1, 0x0, 0x0)
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4:   /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-kubern
etes/kubernetes/structures_pod.go:875 +0x273b
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4: github.com/terraform-providers/terraform-provider-kubernetes/kubernetes.expandPodSpec(0xc0007b0690, 0x1,
 0x1, 0x4, 0xc0004d2988, 0x0)
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4:   /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-kubern
etes/kubernetes/structures_pod.go:556 +0xb7c
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4: github.com/terraform-providers/terraform-provider-kubernetes/kubernetes.expandPodTemplate(0xc0007b0670,
0x1, 0x1, 0x8, 0xc000ae1cc8, 0x19a4880)
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4:   /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-kubern
etes/kubernetes/structures_deployment.go:108 +0x261
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4: github.com/terraform-providers/terraform-provider-kubernetes/kubernetes.expandDeploymentSpec(0xc0007b060
0, 0x1, 0x1, 0x19a4880, 0xc0008730c0, 0x1)
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4:   /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-kubern
etes/kubernetes/structures_deployment.go:89 +0x3ea
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4: github.com/terraform-providers/terraform-provider-kubernetes/kubernetes.resourceKubernetesDeploymentCrea
te(0xc00029fce0, 0x196e520, 0xc000a06fd0, 0x2, 0x350f840)
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4:   /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-kubern
etes/kubernetes/resource_kubernetes_deployment.go:201 +0x148
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4: github.com/terraform-providers/terraform-provider-kubernetes/vendor/github.com/hashicorp/terraform-plugi
n-sdk/helper/schema.(*Resource).Apply(0xc000421100, 0xc0008be0a0, 0xc0008721c0, 0x196e520, 0xc000a06fd0, 0xc000868301, 0xc0007b8228, 0x1a4cfa0)
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4:   /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-kubern
etes/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/resource.go:305 +0x3b4
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4: github.com/terraform-providers/terraform-provider-kubernetes/vendor/github.com/hashicorp/terraform-plugi
n-sdk/helper/schema.(*Provider).Apply(0xc00067ea00, 0xc00027fa68, 0xc0008be0a0, 0xc0008721c0, 0xc0006e7168, 0xc0005cb020, 0x1a4fb20)
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4:   /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-kubern
etes/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/provider.go:294 +0x18f
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4: github.com/terraform-providers/terraform-provider-kubernetes/vendor/github.com/hashicorp/terraform-plugi
n-sdk/internal/helper/plugin.(*GRPCProviderServer).ApplyResourceChange(0xc0005ca110, 0x2119880, 0xc000d5e1e0, 0xc00013e9c0, 0xc0005ca110, 0xc000d5e1e0, 0xc000905bd0)
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4:   /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-kubern
etes/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/helper/plugin/grpc_provider.go:885 +0x884
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4: github.com/terraform-providers/terraform-provider-kubernetes/vendor/github.com/hashicorp/terraform-plugi
n-sdk/internal/tfplugin5._Provider_ApplyResourceChange_Handler(0x1c493e0, 0xc0005ca110, 0x2119880, 0xc000d5e1e0, 0xc00013e960, 0x0, 0x2119880, 0xc000d5e1e0, 0xc000aa9300, 0x1060)
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4:   /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-kubern
etes/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5/tfplugin5.pb.go:3189 +0x23e
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4: github.com/terraform-providers/terraform-provider-kubernetes/vendor/google.golang.org/grpc.(*Server).pro
cessUnaryRPC(0xc0005ce160, 0x2139e00, 0xc000490f00, 0xc00013a200, 0xc000533c50, 0x34d8e80, 0x0, 0x0, 0x0)
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4:   /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-kubern
etes/vendor/google.golang.org/grpc/server.go:995 +0x466
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4: github.com/terraform-providers/terraform-provider-kubernetes/vendor/google.golang.org/grpc.(*Server).han
dleStream(0xc0005ce160, 0x2139e00, 0xc000490f00, 0xc00013a200, 0x0)
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4:   /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-kubern
etes/vendor/google.golang.org/grpc/server.go:1275 +0xda6
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4: github.com/terraform-providers/terraform-provider-kubernetes/vendor/google.golang.org/grpc.(*Server).ser
veStreams.func1.1(0xc000040550, 0xc0005ce160, 0x2139e00, 0xc000490f00, 0xc00013a200)
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4:   /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-kubern
etes/vendor/google.golang.org/grpc/server.go:710 +0x9f
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4: created by github.com/terraform-providers/terraform-provider-kubernetes/vendor/google.golang.org/grpc.(*
Server).serveStreams.func1
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4:   /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-kubern
etes/vendor/google.golang.org/grpc/server.go:708 +0xa1
2019-11-15T16:42:27.928+0100 [DEBUG] plugin: plugin process exited: path=/home/patrick/go/src/github.com/terraform-providers/terraform-provider-kubernetes/_examples/in-cluster/.terraform/plu
gins/linux_amd64/terraform-provider-kubernetes_v1.10.0_x4 pid=32335 error="exit status 2"
2019/11/15 16:42:27 [DEBUG] kubernetes_deployment.kube_state_metrics: apply errored, but we're indicating that via the Error pointer rather than returning it: rpc error: code = Unavailable d
esc = transport is closing
2019/11/15 16:42:27 [TRACE] <root>: eval: *terraform.EvalMaybeTainted
2019/11/15 16:42:27 [TRACE] EvalMaybeTainted: kubernetes_deployment.kube_state_metrics encountered an error during creation, so it is now marked as tainted
2019/11/15 16:42:27 [TRACE] <root>: eval: *terraform.EvalWriteState
2019/11/15 16:42:27 [TRACE] EvalWriteState: removing state object for kubernetes_deployment.kube_state_metrics
2019/11/15 16:42:27 [TRACE] <root>: eval: *terraform.EvalApplyProvisioners
2019/11/15 16:42:27 [TRACE] EvalApplyProvisioners: kubernetes_deployment.kube_state_metrics has no state, so skipping provisioners
2019/11/15 16:42:27 [TRACE] <root>: eval: *terraform.EvalMaybeTainted
2019/11/15 16:42:27 [TRACE] EvalMaybeTainted: kubernetes_deployment.kube_state_metrics encountered an error during creation, so it is now marked as tainted
2019/11/15 16:42:27 [TRACE] <root>: eval: *terraform.EvalWriteState
2019/11/15 16:42:27 [TRACE] EvalWriteState: removing state object for kubernetes_deployment.kube_state_metrics
2019/11/15 16:42:27 [TRACE] <root>: eval: *terraform.EvalIf
2019/11/15 16:42:27 [TRACE] <root>: eval: *terraform.EvalIf
2019/11/15 16:42:27 [TRACE] <root>: eval: *terraform.EvalWriteDiff
2019/11/15 16:42:27 [TRACE] <root>: eval: *terraform.EvalApplyPost
2019/11/15 16:42:27 [ERROR] <root>: eval: *terraform.EvalApplyPost, err: rpc error: code = Unavailable desc = transport is closing
2019/11/15 16:42:27 [ERROR] <root>: eval: *terraform.EvalSequence, err: rpc error: code = Unavailable desc = transport is closing
2019/11/15 16:42:27 [TRACE] [walkApply] Exiting eval tree: kubernetes_deployment.kube_state_metrics
2019/11/15 16:42:27 [TRACE] vertex "kubernetes_deployment.kube_state_metrics": visit complete
2019/11/15 16:42:27 [TRACE] dag/walk: upstream of "provider.kubernetes (close)" errored, so skipping
2019/11/15 16:42:27 [TRACE] dag/walk: upstream of "meta.count-boundary (EachMode fixup)" errored, so skipping
2019/11/15 16:42:27 [TRACE] dag/walk: upstream of "root" errored, so skipping
2019/11/15 16:42:27 [TRACE] statemgr.Filesystem: creating backup snapshot at terraform.tfstate.backup
2019/11/15 16:42:27 [TRACE] statemgr.Filesystem: state has changed since last snapshot, so incrementing serial to 75
2019/11/15 16:42:27 [TRACE] statemgr.Filesystem: writing snapshot at terraform.tfstate
2019/11/15 16:42:27 [TRACE] statemgr.Filesystem: removing lock metadata file .terraform.tfstate.lock.info
2019/11/15 16:42:27 [TRACE] statemgr.Filesystem: unlocking terraform.tfstate using fcntl flock
2019-11-15T16:42:27.963+0100 [DEBUG] plugin: plugin exited

!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!

Terraform crashed! This is always indicative of a bug within Terraform.
A crash log has been placed at "crash.log" relative to your current
working directory. It would be immensely helpful if you could please
report the crash with Terraform[1] so that we can fix this.

When reporting bugs, please include your terraform version. That
information is available on the first line of crash.log. You can also
get it by running 'terraform --version' on the command line.

[1]: https://github.com/hashicorp/terraform/issues

!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!
hashibot commented 4 years ago

This issue has been open 180 days with no activity. If this issue is reproducible with the latest version of the provider and with Terraform 0.12, please comment. Otherwise this issue will be closed in 30 days.

aareet commented 4 years ago

Reproducible in provider.kubernetes v1.11.3

aareet commented 4 years ago

I was also able to reproduce this with the cron job example from the docs

resource "kubernetes_cron_job" "demo" {
  metadata {
    name = "demo"
  }
  spec {
    concurrency_policy            = "Replace"
    failed_jobs_history_limit     = 5
    schedule                      = "1 0 * * *"
    starting_deadline_seconds     = 10
    successful_jobs_history_limit = 10
    suspend                       = true
    # ttl_seconds_after_finished    = 10
    job_template {
      metadata {}
      spec {
        backoff_limit = 2
        template {
          metadata {}
          spec {
            container {
              name    = "hello"
              image   = "busybox"
              command = ["/bin/sh", "-c", "date; echo Hello from the Kubernetes cluster"]
            }
            restart_policy = "OnFailure"
          }
        }
      }
    }
  }
}
pjboro commented 4 years ago

I was able to reproduce this with tf 0.13.0 and kubernetes v1.13.3. Unwanted volume and volume mount appears in tf plan for a cronjob.

Edit: it was possible to get rid of unwanted volumes by writing volumes: {}, but we coudn't get rid of unwanted volume claims. After trying for several hours to find a solution, we gave in, deciding to use helm provider and a regular chart.

icy95 commented 3 years ago

Reproducible in kubernetes v2.0.2. Is there any update or a workaround ?

sbellone commented 3 years ago

Reproducible in v2.4.1 I've tried the same workaround than @pdecat (put an empty volume {}), and it still makes the plugin crash:

Crash logs ``` | The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).ApplyResourceChange call. │ The plugin logs may contain more details. ╵ Stack trace from the terraform-provider-kubernetes_v2.4.1_x5 plugin: panic: interface conversion: interface {} is nil, not map[string]interface {} goroutine 197 [running]: github.com/hashicorp/terraform-provider-kubernetes/kubernetes.expandVolumes(0xc0013457a0, 0x1, 0x1, 0x6, 0xc0014abff8, 0x1, 0x0, 0x0) /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-kubernetes/kubernetes/structures_pod.go:1352 +0x275f github.com/hashicorp/terraform-provider-kubernetes/kubernetes.expandPodSpec(0xc0013452c0, 0x1, 0x1, 0x4, 0xc001370518, 0x0) /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-kubernetes/kubernetes/structures_pod.go:779 +0xf3b github.com/hashicorp/terraform-provider-kubernetes/kubernetes.expandPodTemplate(0xc001345240, 0x1, 0x1, 0x8, 0xc0013702f8, 0x1) /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-kubernetes/kubernetes/structures_deployment.go:116 +0x26b github.com/hashicorp/terraform-provider-kubernetes/kubernetes.expandJobSpec(0xc001345200, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...) /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-kubernetes/kubernetes/structure_job.go:93 +0x367 github.com/hashicorp/terraform-provider-kubernetes/kubernetes.expandJobTemplate(0xc001345180, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...) /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-kubernetes/kubernetes/structure_cron_job.go:104 +0x169 github.com/hashicorp/terraform-provider-kubernetes/kubernetes.expandCronJobSpec(0xc001345120, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...) /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-kubernetes/kubernetes/structure_cron_job.go:74 +0x2a5 github.com/hashicorp/terraform-provider-kubernetes/kubernetes.resourceKubernetesCronJobCreate(0x3287c98, 0xc0004854a0, 0xc0001b2d80, 0x2da9120, 0xc00143bd80, 0xc001344990, 0x170c3aa, 0xc001447f60) /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-kubernetes/kubernetes/resource_kubernetes_cron_job.go:64 +0x250 github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0xc000ad77a0, 0x3287c28, 0xc000f619c0, 0xc0001b2d80, 0x2da9120, 0xc00143bd80, 0x0, 0x0, 0x0) /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-kubernetes/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource.go:330 +0x17f github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc000ad77a0, 0x3287c28, 0xc000f619c0, 0xc0001d87e0, 0xc001447f60, 0x2da9120, 0xc00143bd80, 0x0, 0x0, 0x0, ...) /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-kubernetes/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource.go:456 +0x67b github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc00078e480, 0x3287c28, 0xc000f619c0, 0xc00102a0a0, 0xc0010c0828, 0x1, 0x30) /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-kubernetes/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/grpc_provider.go:955 +0x8ef github.com/hashicorp/terraform-plugin-mux.SchemaServer.ApplyResourceChange(0xc000792960, 0xc000792990, 0xc00143b900, 0x2, 0x2, 0xc00069c680, 0x1, 0x3287c28, 0xc000f619c0, 0xc00102a0a0, ...) /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-kubernetes/vendor/github.com/hashicorp/terraform-plugin-mux/schema_server.go:287 +0x98 github.com/hashicorp/terraform-plugin-go/tfprotov5/server.(*server).ApplyResourceChange(0xc00143b920, 0x3287cd0, 0xc000f619c0, 0xc0001d80e0, 0xc00143b920, 0xc00091a240, 0xc001491ba0) /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-kubernetes/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/server/server.go:332 +0xb5 github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler(0x2df72c0, 0xc00143b920, 0x3287cd0, 0xc00091a240, 0xc00112a540, 0x0, 0x3287cd0, 0xc00091a240, 0xc00121d000, 0x16ca) /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-kubernetes/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:380 +0x214 google.golang.org/grpc.(*Server).processUnaryRPC(0xc0005276c0, 0x329fbb8, 0xc000297800, 0xc0011fc000, 0xc000792a20, 0x4108c80, 0x0, 0x0, 0x0) /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-kubernetes/vendor/google.golang.org/grpc/server.go:1217 +0x52b google.golang.org/grpc.(*Server).handleStream(0xc0005276c0, 0x329fbb8, 0xc000297800, 0xc0011fc000, 0x0) /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-kubernetes/vendor/google.golang.org/grpc/server.go:1540 +0xd0c google.golang.org/grpc.(*Server).serveStreams.func1.2(0xc000a59340, 0xc0005276c0, 0x329fbb8, 0xc000297800, 0xc0011fc000) /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-kubernetes/vendor/google.golang.org/grpc/server.go:878 +0xab created by google.golang.org/grpc.(*Server).serveStreams.func1 /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-kubernetes/vendor/google.golang.org/grpc/server.go:876 +0x1fd Error: The terraform-provider-kubernetes_v2.4.1_x5 plugin crashed! This is always indicative of a bug within the plugin. It would be immensely helpful if you could report the crash with the plugin's maintainers so that it can be fixed. The output above should help diagnose the issue. ```
simonvanderveldt commented 2 years ago

Still happening with Terraform v1.0.9 and hashicorp/kubernetes v2.9.0. Also crashed when using volumes: {} on apply (not on plan).