This repository has been archived by the owner on Aug 11, 2021. It is now read-only.
terraform plan fails with 'Invalid value: "": field is immutable' error due to wrong content type header #149
Labels
bug
Something isn't working
Terraform, Provider, Kubernetes versions
Affected Resource(s)
Terraform Configuration Files
Debug Output
https://gist.github.com/anrock-sc/34ff83ed56236e32280bd4de9f9459f5
Panic Output
N/A
Steps to Reproduce
Terrafrom resource:
Service yaml on server:
Run
terraform plan -target=kubernetes_manifest.homepage-redirect-service
Expected Behavior
Terraform plan completes successfully.
Actual Behavior
Important Factoids
We are on the GKE rapid release channel, however when this bug started to occur, roughly around the 22.02.2021, we didn't updated or changed anything on client or server side.
When comparing
kubectl
http traffic to the terraform alpha provider traffic, we could boil down the issue to thecontent-type
header value which seems to be different.This is the curl command that matches are the headers send by the kubectl:
patch.json
Result:
Note that for kubectl the content-type header is set to
Content-Type: application/strategic-merge-patch+json
However, for the terraform alpha provider the content type-headerapplication/apply-patch+yaml
is set resulting in anUnprocessable Entity Error
.Here the curl command with the content-type header the terraform alpha provider would use:
Result:
It seems to be related to the patch definitions in https://github.com/hashicorp/terraform-provider-kubernetes-alpha/blob/master/vendor/k8s.io/apimachinery/pkg/types/patch.go#L24-L29
References
This bug relates to:
Community Note
The text was updated successfully, but these errors were encountered: