terraform-provider-kubernetes
terraform-provider-kubernetes copied to clipboard
CustomResourceDefinition apply fails `Provider produced inconsistent result after apply`
Error: Provider produced inconsistent result after apply
│
│ When applying changes to module.nginx-public.kubernetes_manifest.customresourcedefinition_appolicies_appprotect_f5_com[0], provider
│ "provider[\"registry.terraform.io/hashicorp/kubernetes\"]" produced an unexpected new value: .object.spec.preserveUnknownFields: was cty.False, but now null.
│
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.
Terraform Version, Provider Version and Kubernetes Version
terraform -v
Terraform v1.0.10
on darwin_amd64
+ provider registry.terraform.io/hashicorp/kubernetes v2.6.1
Affected Resource(s)
kubernetes_manifest
Terraform Configuration Files
https://gist.github.com/geofflancaster/89ea2c837414a96ee17863b82f457f2d
Debug Output
Panic Output
Steps to Reproduce
Expected Behavior
What should have happened? The CRD should be applied, unchanged.
Actual Behavior
What actually happened? The apply fails with error
Important Factoids
References
- GH-1234
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
Just to note on this issue, I came across this and noticed it might be related to computed_fields since changes happen differently than what TF expects right after an apply.
https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/manifest#computed-fields
Unless the field is declared as "computed" Terraform will throw an error signaling that the state returned by the 'apply' operation is inconsistent with the value defined in the 'plan'.
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!