terraform-provider-ovh
terraform-provider-ovh copied to clipboard
ovh_cloud_project_kube version not optional
In the docs, it's said we can omit the version parameter, but
resource "ovh_cloud_project_kube" "cluster" {
service_name = var.ovh_project
name = "kube-cluster"
region = var.ovh_region
}
gives us an error:
Error: calling Post /cloud/project/341edd7a85dd4fe0b0e2c63dacc09f95/kube with params kube-cluster-dev(GRA7): :
"Error 400: \"Body parameter version isn't formated correctly\""
The version is passed as "" (empty string) while (for example)
resource "ovh_cloud_project_kube" "cluster-dev" {
service_name = var.ovh_project
name = "kube-cluster-dev"
region = var.ovh_region
version = "1.20"
}
seems to work :+1:
Found this issue using ovh-ca today:
2021/03/08 13:53:57 [DEBUG] setting computed for "next_upgrade_versions" from ComputedKeys
2021-03-08T13:53:57.559-0500 [DEBUG] plugin.terraform-provider-ovh_v0.11.0: 2021/03/08 13:53:57 [DEBUG] Will create kube: poc(BHS5):
2021-03-08T13:53:57.560-0500 [DEBUG] plugin.terraform-provider-ovh_v0.11.0: 2021/03/08 13:53:57 [DEBUG] OVH API Request Details:
2021-03-08T13:53:57.560-0500 [DEBUG] plugin.terraform-provider-ovh_v0.11.0: ---[ REQUEST ]---------------------------------------
2021-03-08T13:53:57.560-0500 [DEBUG] plugin.terraform-provider-ovh_v0.11.0: POST /1.0/cloud/project/__REDACTED__/kube HTTP/1.1
2021-03-08T13:53:57.560-0500 [DEBUG] plugin.terraform-provider-ovh_v0.11.0: Host: ca.api.ovh.com
2021-03-08T13:53:57.560-0500 [DEBUG] plugin.terraform-provider-ovh_v0.11.0: User-Agent: Go-http-client/1.1
2021-03-08T13:53:57.560-0500 [DEBUG] plugin.terraform-provider-ovh_v0.11.0: Content-Length: 43
2021-03-08T13:53:57.560-0500 [DEBUG] plugin.terraform-provider-ovh_v0.11.0: Accept: application/json
2021-03-08T13:53:57.560-0500 [DEBUG] plugin.terraform-provider-ovh_v0.11.0: Content-Type: application/json;charset=utf-8
2021-03-08T13:53:57.560-0500 [DEBUG] plugin.terraform-provider-ovh_v0.11.0: X-Ovh-Application: __REDACTED__
2021-03-08T13:53:57.560-0500 [DEBUG] plugin.terraform-provider-ovh_v0.11.0: X-Ovh-Consumer: __REDACTED__
2021-03-08T13:53:57.560-0500 [DEBUG] plugin.terraform-provider-ovh_v0.11.0: X-Ovh-Signature: __REDACTED__
2021-03-08T13:53:57.560-0500 [DEBUG] plugin.terraform-provider-ovh_v0.11.0: X-Ovh-Timestamp: 1615229637
2021-03-08T13:53:57.560-0500 [DEBUG] plugin.terraform-provider-ovh_v0.11.0: Accept-Encoding: gzip
2021-03-08T13:53:57.560-0500 [DEBUG] plugin.terraform-provider-ovh_v0.11.0:
2021-03-08T13:53:57.560-0500 [DEBUG] plugin.terraform-provider-ovh_v0.11.0: {
2021-03-08T13:53:57.560-0500 [DEBUG] plugin.terraform-provider-ovh_v0.11.0: "name": "poc",
2021-03-08T13:53:57.560-0500 [DEBUG] plugin.terraform-provider-ovh_v0.11.0: "region": "BHS5",
2021-03-08T13:53:57.560-0500 [DEBUG] plugin.terraform-provider-ovh_v0.11.0: "version": ""
2021-03-08T13:53:57.560-0500 [DEBUG] plugin.terraform-provider-ovh_v0.11.0: }
In the docs, it's said we can omit the version parameter, but
resource "ovh_cloud_project_kube" "cluster" { service_name = var.ovh_project name = "kube-cluster" region = var.ovh_region }
gives us an error:
Error: calling Post /cloud/project/341edd7a85dd4fe0b0e2c63dacc09f95/kube with params kube-cluster-dev(GRA7): : "Error 400: \"Body parameter version isn't formated correctly\""
The version is passed as "" (empty string) while (for example)
resource "ovh_cloud_project_kube" "cluster-dev" { service_name = var.ovh_project name = "kube-cluster-dev" region = var.ovh_region version = "1.20" }
seems to work 👍
Hey @rienafairefr ! I got the same issue and added the version in my resource creation definition but ended up with another issue. Concretely,
resource "ovh_cloud_project_kube" "dev-cluster" { service_name = var.ovh_project name = "dev-cluster" region = var.ovh_region version = "1.20" }
gives me now
Error: calling Post /cloud/project/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/kube with params dev-cluster(GRA7): 1.20: "gzip: invalid header"
Did you have the same problem? Any idea of what could be wrong?
@eduleboss There is a probable bug in go-ovh
, something about gzip encoding the request or the response to the ovh api. I raised the issue there https://github.com/ovh/go-ovh/issues/53
No fix or workaround, I resorted to creating the nodepool in the UI. The error is in creating the ovh_cloud_project_kube resource for you ? For me, that part worked. It was the nodepool creation that failed
Adding a version = "1.20" fixed the issue for me.
I had this same issue in the past, but then with some update, it was fixed. Maybe is better to close the issue.
Closing this issue since it should be resolved now, don't hesitate to re-open it if needed.