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

When release_channel is enabled, min_master_version is malformed #522

Closed
agadelshin opened this issue May 15, 2020 · 6 comments
Closed

When release_channel is enabled, min_master_version is malformed #522

agadelshin opened this issue May 15, 2020 · 6 comments

Comments

@agadelshin
Copy link

This issue is pretty much related to #412.

After we switched to 9.0.0 and enabled release_channel I see only one change in plan:

      - min_master_version          = "1.15.8-gke.3" -> null

But this change returns

Error: Malformed version:

  on .terraform/modules/platform.cluster.kubernetes-engine_private-cluster/terraform-google-kubernetes-engine-9.0.0/modules/beta-private-cluster/cluster.tf line 22, in resource "google_container_cluster" "primary":
  22: resource "google_container_cluster" "primary" {

provider version is 3.21.0 (tried on 3.17.0)
gke module version is 9.0.0

@morgante
Copy link
Contributor

Interesting, this does indeed look like a bug though I suspect it might be in the provider as it should be possible to have a null min_master_version.

Can you see if it's possible to create a new cluster using your same config?

@agadelshin
Copy link
Author

agadelshin commented May 15, 2020

@morgante thanks for suggestion, yes, I'll do this on Monday

@primeroz
Copy link

I am having the same issue with 8.1 and google provider 3.22 , creating a new cluster with release_channel set and no version work as expected , changing a cluster fail with the malformed version error on apply

To me it seems an issue when the provider try to update the state since, running with TF_LOG=debug, i can see the Cluster Update operation complete successfully and then the error

 -----------------------------------------------------
 2020/05/19 13:37:58 [DEBUG] Google API Response Details:
 ---[ RESPONSE ]--------------------------------------
 HTTP/1.1 200 OK
 Connection: close

 {                                                                
  "name": "operation-1589895468012-1ef861ce",                                                                                                                                                                                                                                                               
  "zone": "europe-west1",                                                                                                                                                                                                                                                                                   
  "operationType": "UPDATE_CLUSTER",                                                                                                                                                                                                                                                                        
  "status": "DONE",                                                                                                                                                                                                                                                                                         
  "selfLink": "https://container.googleapis.com/v1beta1/projects/PROJECT/locations/europe-west1/operations/operation-1589895468012-1ef861ce",                                                                    
  "targetLink": "https://container.googleapis.com/v1beta1/projects/PROJECT/locations/europe-west1/clusters/CLUSTER",                                                                                                 
  "startTime": "2020-05-19T13:37:48.012147826Z",                  
  "endTime": "2020-05-19T13:37:48.389156153Z"                                                                                                                                                                                                                                                               
 }
                                                                  
                                                                  
 -----------------------------------------------------
 2020/05/19 13:37:58 [DEBUG] Retry Transport: Stopping retries, last request was successful
2020-05-19T13:37:58.471Z [DEBUG] plugin.terraform-provider-google-beta_v3.22.0_x5: 2020/05/19 13:37:58 [DEBUG] Retry Transport: Returning after 1 attempts
2020-05-19T13:37:58.471Z [DEBUG] plugin.terraform-provider-google-beta_v3.22.0_x5: 2020/05/19 13:37:58 [DEBUG] Got DONE while polling for operation operation-1589895468012-1ef861ce's status                                                          
2020-05-19T13:37:58.471Z [DEBUG] plugin.terraform-provider-google-beta_v3.22.0_x5: 2020/05/19 13:37:58 [DEBUG] Unlocking "google-container-cluster/PROJECT/europe-west1/CLUSTER"
2020-05-19T13:37:58.471Z [DEBUG] plugin.terraform-provider-google-beta_v3.22.0_x5: 2020/05/19 13:37:58 [DEBUG] Unlocked "google-container-cluster/PROJECT/europe-west1/CLUSTER"
2020-05-19T13:37:58.471Z [DEBUG] plugin.terraform-provider-google-beta_v3.22.0_x5: 2020/05/19 13:37:58 [INFO] GKE cluster fc1 master authorized networks config has been updated
2020/05/19 13:37:58 [DEBUG] module.cluster.google_container_cluster.primary: apply errored, but we're indicating that via the Error pointer rather than returning it: Malformed version: 
2020/05/19 13:37:58 [ERROR] module.cluster: eval: *terraform.EvalApplyPost, err: Malformed version: 
2020/05/19 13:37:58 [ERROR] module.cluster: eval: *terraform.EvalSequence, err: Malformed version: 

@primeroz
Copy link

as a test i did

  • terraform state rm CLUSTER
  • terraform import CLUSTER PROJECT/REGION/CLUSTER

and now the min_master_version in the state is indeed null, terraform apply now works and even after apply

$ terraform state pull | grep min_master_version
            "min_master_version": null,

It does seem to be an issue only when Changing from a version to null in the state

@morgante
Copy link
Contributor

Thanks for opening a bug upstream. I'm going to close this so we can consolidate discussion there.

hashicorp/terraform-provider-google#6418

@agadelshin
Copy link
Author

thanks @primeroz!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants