-
Notifications
You must be signed in to change notification settings - Fork 975
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
object.metadata.finalizers causes a diff on every plan for elbv2.k8s.aws/v1beta1.TargetGroupBinding #1442
Comments
Hi! This sounds like the finalizers field is behaving like what Terraform calls a "computed" values, meaning the API will change it's value from the one supplied during apply. You can get around this by specifing the "finalizers" attribute in the list of computed fields, like this:
Be aware, that by default, when computed_fileds is not set by the users, it has a default value which includes "metadata.annotations" and "metadata.labels". For robustness, you should also include these two whenever you explicitly set a value for "computed_fields". In the end, it should look like this:
Let us know if this resolved your issue. |
Specifying the list of computed fields does not address the issue. So far the only way has been to explicitly declare the finalizers list. |
@achille-roussel I was able to apply your example manifest on a freshly created EKS cluster. We will need more precise information about the cluster configuration where you are seeing this issue. Please share versions of all components used / installed on the cluster and ideally also the provisioning procedure. We will then try to reproduce this again. Thanks a lot! |
I get a similar problem this exact config if this helps
or install then resource "kubernetes_manifest" "istio-operator-1-11-4" {
computed_fields = ["metadata.finalizers", "metadata.annotations", "metadata.labels"]
manifest = {
apiVersion = "install.istio.io/v1alpha1"
kind = "IstioOperator"
metadata = {
name = "istio-demo"
namespace = "istio-system"
}
spec = {
profile = "demo"
}
}
} istioOperator then gets finalizers added, and when I run apply a second time it tries to destroy everything |
@alexsomesan thanks for looking into this. I also did not experience any issues applying the resource, the problem manifests on subsequent plans: the resource shows a diff every time even if nothing is changing. |
I had this issue (with computed_fields not working, and having to specify the finalizer) but it resolved after upgrading to the latest version of the provider (2.6.1) |
Closing this since there are reports of issue being resolved. Anyone still seeing this issue, please feel free to reopen with relevant details. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Terraform Version, Provider Version and Kubernetes Version
Affected Resource(s)
kubernetes_manifest
Terraform Configuration Files
Steps to Reproduce
terraform apply
Expected Behavior
There should be no diffs in the terraform output when the resource has not changed.
Actual Behavior
Important Factoids
manifest.metadata.finalizers
field is explicitly set, the plan does not show a diff, and there are no errors on apply:References
Community Note
The text was updated successfully, but these errors were encountered: