mirror of https://github.com/knative/pkg.git
				
				
				
			Fix cluster creation lib return not up-to-date cluster issue (#718)
This commit is contained in:
		
							parent
							
								
									6bc5bf74cc
								
							
						
					
					
						commit
						a1b3961a1d
					
				|  | @ -290,12 +290,10 @@ func (gc *GKECluster) Acquire() error { | |||
| 		} | ||||
| 		// Creating cluster only if previous step succeeded
 | ||||
| 		if err == nil { | ||||
| 			log.Printf("Creating cluster %q in %q", clusterName, clusterLoc) | ||||
| 			log.Printf("Creating cluster %q in %q with:\n%+v", clusterName, clusterLoc, gc.Request) | ||||
| 			op, err = gc.operations.create(*gc.Project, clusterLoc, rb) | ||||
| 			if err == nil { | ||||
| 				if err = gc.wait(clusterLoc, op.Name, creationTimeout); err == nil { | ||||
| 					cluster, err = gc.operations.get(*gc.Project, clusterLoc, rb.Cluster.Name) | ||||
| 				} | ||||
| 				err = gc.wait(clusterLoc, op.Name, creationTimeout) | ||||
| 			} | ||||
| 			if err == nil { // Enable autoscaling and set limits
 | ||||
| 				arb := &container.SetNodePoolAutoscalingRequest{ | ||||
|  | @ -311,6 +309,9 @@ func (gc *GKECluster) Acquire() error { | |||
| 					err = gc.wait(clusterLoc, op.Name, autoscalingTimeout) | ||||
| 				} | ||||
| 			} | ||||
| 			if err == nil { // Get cluster at last
 | ||||
| 				cluster, err = gc.operations.get(*gc.Project, clusterLoc, rb.Cluster.Name) | ||||
| 			} | ||||
| 		} | ||||
| 		if err != nil { | ||||
| 			errMsg := fmt.Sprintf("Error during cluster creation: '%v'. ", err) | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue