mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-07-01 15:52:39 +00:00
GET clusters in error states so we see state information in debug logs. (#3389)
<!-- This change is generated by MagicModules. --> Original Author: @rileykarson
This commit is contained in:
parent
70e86b7be6
commit
55ef37fe38
|
@ -777,6 +777,13 @@ func resourceContainerClusterCreate(d *schema.ResourceData, meta interface{}) er
|
|||
timeoutInMinutes := int(d.Timeout(schema.TimeoutCreate).Minutes())
|
||||
waitErr := containerOperationWait(config, op, project, location, "creating GKE cluster", timeoutInMinutes)
|
||||
if waitErr != nil {
|
||||
// Try a GET on the cluster so we can see the state in debug logs. This will help classify error states.
|
||||
_, getErr := config.clientContainerBeta.Projects.Locations.Clusters.Get(containerClusterFullName(project, location, clusterName)).Do()
|
||||
if getErr != nil {
|
||||
// Make errcheck happy
|
||||
log.Printf("[WARN] Cluster %s was created in an error state and not found", clusterName)
|
||||
}
|
||||
|
||||
if deleteErr := cleanFailedContainerCluster(d, meta); deleteErr != nil {
|
||||
log.Printf("[WARN] Unable to clean up cluster from failed creation: %s", deleteErr)
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue
Block a user