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

kubernetes_manifest with pod and volume: inconsistent result after apply #2326

Closed
iluminae opened this issue Oct 20, 2023 · 3 comments
Closed
Assignees

Comments

@iluminae
Copy link

Terraform Version, Provider Version and Kubernetes Version

Terraform version: v1.4.6
Kubernetes provider version: v2.23.0
Kubernetes version: v1.26.4

Affected Resource(s)

  • kubernetes_manifest

Terraform Configuration Files

resource "kubernetes_manifest" "test" {
  manifest = {
    apiVersion = "v1"
    kind       = "Pod"
    metadata = {
      name      = "test"
      namespace = "default"
    }
    spec = {
      containers = [{
        name    = "test"
        image   = "docker.io/library/busybox:latest"
        command = ["busybox", "sh", "-c", "sleep inf"]
        volumeMounts = [{
          name      = "test"
          mountPath = "/test"
        }]
      }]
      volumes = [{
        name     = "test"
        emptyDir = {}
      }]
    }
  }
}

Debug Output

I will post this if you really need it but I think its entirely reproducible and its hard to capture that incredibly verbose output.

Panic Output

n/a

Steps to Reproduce

  1. terraform apply the above repro

Expected Behavior

pod created and terraform happy

Actual Behavior

pod created and terraform unhappy

kubernetes_manifest.test: Creating...
2023-10-20T17:45:07.584-0400 [INFO]  Starting apply for kubernetes_manifest.test
2023-10-20T17:45:07.584-0400 [DEBUG] skipping FixUpBlockAttrs
2023-10-20T17:45:07.584-0400 [DEBUG] kubernetes_manifest.test: applying the planned Create change
2023-10-20T17:45:08.841-0400 [ERROR] vertex "kubernetes_manifest.test" error: Provider produced inconsistent result after apply
╷
│ Error: Provider produced inconsistent result after apply
│
│ When applying changes to kubernetes_manifest.test, provider "provider[\"registry.terraform.io/hashicorp/kubernetes\"]" produced an unexpected new value: .object: wrong final value type: attribute "spec": attribute
│ "volumes": tuple required.
│
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.
╵
2023-10-20T17:45:08.869-0400 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2023-10-20T17:45:08.876-0400 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/kubernetes/2.23.0/darwin_amd64/terraform-provider-kubernetes_v2.23.0_x5 pid=70337
2023-10-20T17:45:08.876-0400 [DEBUG] provider: plugin exited

Important Factoids

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
@iluminae iluminae added the bug label Oct 20, 2023
@alexsomesan alexsomesan self-assigned this Oct 25, 2023
@shanmugara
Copy link

shanmugara commented Nov 3, 2023

same issue here. though the pod is getting created, and I am able to update the pod with an additional volume as well. each time it throws the error, but the pod seems to getting created and updated correctly.

@shanmugara
Copy link

Some additional info that might help. This seems to be caused by the ServiceAccount token auto mount under volumes. Adding an additional element to the list of volumes, confusing the provider. Setting automountServiceAccountToken: false works happily without any errors.

Copy link

github-actions bot commented Nov 5, 2024

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 github-actions bot added the stale label Nov 5, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 5, 2024
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

3 participants