terraform-provider-kubernetes icon indicating copy to clipboard operation
terraform-provider-kubernetes copied to clipboard

kubernetes_ingress data source returns error "Invalid address to set"

Open jrlonan-gt opened this issue 2 years ago • 4 comments

Terraform Version, Provider Version and Kubernetes Version

Terraform version: 1.0.3
Kubernetes provider version:  hashicorp/kubernetes v2.4.1
Kubernetes version: 1.18

Affected Resource(s)

  • kubernetes_ingress

Terraform Configuration Files

data "kubernetes_ingress" "eks_prometheus" {
  metadata {
    name = "kube-prometheus-stack-prometheus"
    namespace = "monitoring"
  }

}

Debug Output

https://gist.github.com/jrlonan-gt/587a02d65faa9021c94b5c5da9c3829b

Panic Output

N/A

Steps to Reproduce

  1. terraform plan
  2. terraform plan --target kubernetes_ingress.eks_prometheus
  3. terraform apply

Expected Behavior

Data source should read the existing Ingress object in k8s for use with other resources

Actual Behavior

Terraform returns an error Error: Invalid address to set: []string{"spec", "0", "ingress_class_name"}

Important Factoids

  • Kubernetes ingress is created via Helm
  • I'm using terragrunt wrapper

References

N/A

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

jrlonan-gt avatar Aug 05 '21 03:08 jrlonan-gt

upgraded provider version to 2.4.1 and still see the same issue

│ Error: Invalid address to set: []string{"spec", "0", "ingress_class_name"}
│
│   with data.kubernetes_ingress.eks_prometheus,

jrlonan-gt avatar Aug 05 '21 04:08 jrlonan-gt

Same here.

tensor5 avatar Aug 22 '21 06:08 tensor5

Marking this issue as stale due to inactivity. If this issue receives no comments in the next 30 days it will automatically be closed. If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. This helps our maintainers find and focus on the active issues. Maintainers may also remove the stale label at their discretion. Thank you!

github-actions[bot] avatar Aug 23 '22 00:08 github-actions[bot]

I'm facing almost the same problem with the kubernetes_pod datasource

│ Error: Invalid address to set: []string{"spec", "0", "affinity", "0", "node_affinity", "0", "required_during_scheduling_ignored_during_execution", "0", "node_selector_term", "0", "match_fields"}

venc0r avatar Sep 09 '22 20:09 venc0r