Skip to content
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

kubernetes_manifest errors with x-kubernetes-preserve-unknown-fields CRD of ArgoCD Application #2375

Open
jcogilvie opened this issue Dec 20, 2023 · 2 comments · May be fixed by #2437
Open
Labels
acknowledged Issue has undergone initial review and is in our work queue. bug needs investigation

Comments

@jcogilvie
Copy link

jcogilvie commented Dec 20, 2023

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 argoproj/argo-cd#16115 for config and repro case

Debug Output

Please see argoproj/argo-cd#16115 for output

Steps to Reproduce

  1. terraform apply the indicated manifest against argocd's Application CRD from v2.8+, in which it adds the x-kubernetes-preserve-unknown-fields annotation to a new field called valuesObject

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 #1928 (comment)

Actual Behavior

Apply error

Important Factoids

EKS 1.27

References

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
@alexsomesan
Copy link
Member

@jcogilvie Could we get a glimpse of the actual output of Terraform when the apply returns an error?

@jcogilvie
Copy link
Author

jcogilvie commented Jan 25, 2024

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
╵

more output in gist

@BBBmau BBBmau added the acknowledged Issue has undergone initial review and is in our work queue. label Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
acknowledged Issue has undergone initial review and is in our work queue. bug needs investigation
Projects
None yet
3 participants