Commit c9f8c262 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #49125 from abgworrall/handle-gke-clusters

Automatic merge from submit-queue (batch tested with PRs 47509, 46821, 45319, 49121, 49125) Tolerate a missing MasterName (for GKE) When testing, GKE created clusters don't provide a `MasterName`, so don't throw a warning and give up when that happens. ```release-note NONE ```
parents c5b47482 14091e40
......@@ -162,13 +162,16 @@ func lookupClusterImageSources() (string, string, error) {
frags := strings.Split(nodeImg, "/")
nodeImg = frags[len(frags)-1]
masterName := TestContext.CloudConfig.MasterName
masterImg, err := host2image(masterName)
if err != nil {
return "", "", err
// For GKE clusters, MasterName will not be defined; we just leave masterImg blank.
masterImg := ""
if masterName := TestContext.CloudConfig.MasterName; masterName != "" {
img, err := host2image(masterName)
if err != nil {
return "", "", err
}
frags = strings.Split(img, "/")
masterImg = frags[len(frags)-1]
}
frags = strings.Split(masterImg, "/")
masterImg = frags[len(frags)-1]
return masterImg, nodeImg, nil
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment