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

Plugin crash while creating Kyverno policies #2651

Open
aukevanleeuwen opened this issue Dec 17, 2024 · 0 comments
Open

Plugin crash while creating Kyverno policies #2651

aukevanleeuwen opened this issue Dec 17, 2024 · 0 comments
Assignees
Labels

Comments

@aukevanleeuwen
Copy link

Terraform Version, Provider Version and Kubernetes Version

Terraform version: v1.10.2
Kubernetes provider version: v2.30.0 through v2.35.0
Kubernetes version: v1.31.3

Affected Resource(s)

  • kubernetes_manifest

Terraform Configuration Files

I have a directory of plain Kubernetes manifests directly from the Kyverno policies Github here: https://github.com/kyverno/policies. For example the stuff in the best-practices directory. I want to apply all of the manifests I copy in this directory like this:

resource "helm_release" "kyverno-policies" {
  repository       = "https://kyverno.github.io/kyverno/"
  chart            = "kyverno"
  name             = "kyverno"
  namespace        = "kyverno"
  create_namespace = true
}

resource "kubernetes_manifest" "kyverno-policies" {
  for_each = fileset("${path.module}/../kyverno-policies-extra", "**/*.yaml")

  manifest = yamldecode(file("${path.module}/../kyverno-policies-extra/${each.value}"))
  depends_on = [helm_release.kyverno-policies]
}

Debug / Panic Output

Here is a gist to the output on standard error: https://gist.github.com/aukevanleeuwen/4787507bfb9b9e709294101f0b99102e

Panic Output

Same as above.

Steps to Reproduce

  1. Essentially this is just a terraform plan

Expected Behavior

What should have happened? It should have presented me with a plan.

Actual Behavior

It panic-ed.

Important Factoids

This works in v2.29.0!. Stops working in v2.30.0. I'm suspecting this change to be the culprit (since it's part of v2.30.0 and it tinkers with the code that is in the stacktrace of the panic): f83d63a. My Go foo really isn't good enough to understand why this would be happening though.

References

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants