terraform-provider-kubernetes
terraform-provider-kubernetes copied to clipboard
`kubernetes_manifest` errors with `x-kubernetes-preserve-unknown-fields` CRD of ArgoCD Application
Terraform Version, Provider Version and Kubernetes Version
Terraform version: 1.6
Kubernetes provider version: 2.24.0
Kubernetes version: 1.27
Affected Resource(s)
kubernetes_manifest
Terraform Configuration Files
Please see https://github.com/argoproj/argo-cd/issues/16115 for config and repro case
Debug Output
Please see https://github.com/argoproj/argo-cd/issues/16115 for output
Steps to Reproduce
terraform applythe indicated manifest against argocd'sApplicationCRD from v2.8+, in which it adds thex-kubernetes-preserve-unknown-fieldsannotation to a new field calledvaluesObject
Expected Behavior
It would be ideal if the provider could detect that there is not and never has been a value provided for the unknown field in my CR instance, so it can simply ignore the type change, but if it can't, then I would at least expect that the resource is deleted and recreated as indicated in https://github.com/hashicorp/terraform-provider-kubernetes/issues/1928#issuecomment-1341043424
Actual Behavior
Apply error
Important Factoids
EKS 1.27
References
- https://github.com/hashicorp/terraform-provider-kubernetes/issues/2123
- maybe https://github.com/hashicorp/terraform-provider-kubernetes/issues/1930
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
@jcogilvie Could we get a glimpse of the actual output of Terraform when the apply returns an error?
My mistake; it errors on plan. Here's the error from a plan (which I can't presently get past to test the apply):
╷
│ Error: Failed to transform List value into Tuple of different length
│
│ with module.this_app[0].kubernetes_manifest.raw[0],
│ on .terraform/modules/this_app/main.tf line 172, in resource "kubernetes_manifest" "raw":
│ 172: resource "kubernetes_manifest" "raw" {
│
│ Error: %!s(<nil>)
│ ...at attribute:
│ spec.sources
╵
╷
│ Error: Failed to transform Object element into Object element type
│
│ with module.this_app[0].kubernetes_manifest.raw[0],
│ on .terraform/modules/this_app/main.tf line 172, in resource "kubernetes_manifest" "raw":
│ 172: resource "kubernetes_manifest" "raw" {
│
│ Error (see above) at attribute:
│ spec.sources
╵
╷
│ Error: Failed to transform Object element into Object element type
│
│ with module.this_app[0].kubernetes_manifest.raw[0],
│ on .terraform/modules/this_app/main.tf line 172, in resource "kubernetes_manifest" "raw":
│ 172: resource "kubernetes_manifest" "raw" {
│
│ Error (see above) at attribute:
│ spec
╵