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

`kubernetes_stateful_set` has permadrift when updating `volume_claim_template.spec.resources.requests.storage`

Open nitrocode opened this issue 2 years ago • 2 comments

Terraform Version, Provider Version and Kubernetes Version

Terraform v1.3.9
on darwin_arm64
+ provider registry.terraform.io/hashicorp/kubernetes v2.18.0

Affected Resource(s)

  • kubernetes_stateful_set

Terraform Configuration Files

  # kubernetes_stateful_set.this[0] will be updated in-place
  ~ resource "kubernetes_stateful_set" "this" {
        # (1 unchanged attribute hidden)

      ~ spec {
            # (4 unchanged attributes hidden)

          ~ volume_claim_template {

              ~ spec {
                    # (1 unchanged attribute hidden)

                  ~ resources {
                      ~ requests = {
                          ~ "storage" = "15Gi" -> "30Gi"
                        }
                        # (1 unchanged attribute hidden)
                    }
                }

                # (1 unchanged block hidden)
            }

            # (3 unchanged blocks hidden)
        }

        # (1 unchanged block hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Debug Output

N/A

Panic Output

N/A

Steps to Reproduce

  1. terraform plan
  2. terraform apply
  3. terraform apply
    • This is where the drift shows and the plan repeats above

Expected Behavior

No permadrift. It should have showed no changes after step 3

Actual Behavior

Permadrift was seen

Important Factoids

A workaround is to remove the statefulset and recreate it and then it will show no-changes. It seems like when volume_claim_template.spec.resources.requests.storage changes, it should force recreate the resource.

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

nitrocode avatar Mar 17 '23 17:03 nitrocode

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 Mar 22 '24 00:03 github-actions[bot]

Unstale

nitrocode avatar Mar 25 '24 02:03 nitrocode

We can still confirm that on version 2.31.0. Any updates?

dploeger avatar Dec 11 '24 14:12 dploeger