terraform-provider-ovh icon indicating copy to clipboard operation
terraform-provider-ovh copied to clipboard

ovh_cloud_project_kube version not optional

Open rienafairefr opened this issue 3 years ago • 5 comments

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:

rienafairefr avatar Mar 04 '21 12:03 rienafairefr

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: }

msgongora avatar Mar 08 '21 19:03 msgongora

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?

edouardhinvi avatar Mar 18 '21 12:03 edouardhinvi

@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

rienafairefr avatar Mar 18 '21 12:03 rienafairefr

Adding a version = "1.20" fixed the issue for me.

greenscientist avatar Apr 08 '21 17:04 greenscientist

I had this same issue in the past, but then with some update, it was fixed. Maybe is better to close the issue.

fabio-viana avatar Oct 27 '21 21:10 fabio-viana

Closing this issue since it should be resolved now, don't hesitate to re-open it if needed.

amstuta avatar Mar 19 '24 16:03 amstuta