You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By the way I just noticed I mixed up annotations and labels in my example, but I've seen this happen with both. It's just that for a "real" use case setting up a namespace with this label was the easiest I could think of. An example with annotations would be a ServiceAccount and a Secret for that ServiceAccount having the kubernetes.io/service-account.name annotation.
ohemelaar
changed the title
Importing resources can cause the plan to show annotation changes
Importing resources can cause the plan to show annotation and label changes
Jul 24, 2024
Terraform Version, Provider Version and Kubernetes Version
Affected Resource(s)
Noticed it with these resources, but there's probably more affected as it's in the metadata block :
Terraform Configuration Files
Debug Output
Import output
Plan ouput
Panic Output
Steps to Reproduce
kubectl apply ns.yaml
terraform import kubernetes_namespace_v1.example example
terraform plan
Expected Behavior
The plan shouldn't show any annotation changes, because the resource in kubernetes has the annotation and it's the same as in the HCL file.
Actual Behavior
Terraform plans to add the annotation which already exists.
This is a pain to sort out in large refactors because we need to manually verify if it plans to change the annotations or if it will keep it the same.
Important Factoids
References
Community Note
The text was updated successfully, but these errors were encountered: