mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 14:37:00 +00:00
Tolerate a missing MasterName (for GKE)
GKE created clusters don't provide a MasterName, so don't throw a warning and give up when that happens.
This commit is contained in:
parent
6b78eeca84
commit
14091e4043
@ -162,13 +162,16 @@ func lookupClusterImageSources() (string, string, error) {
|
|||||||
frags := strings.Split(nodeImg, "/")
|
frags := strings.Split(nodeImg, "/")
|
||||||
nodeImg = frags[len(frags)-1]
|
nodeImg = frags[len(frags)-1]
|
||||||
|
|
||||||
masterName := TestContext.CloudConfig.MasterName
|
// For GKE clusters, MasterName will not be defined; we just leave masterImg blank.
|
||||||
masterImg, err := host2image(masterName)
|
masterImg := ""
|
||||||
if err != nil {
|
if masterName := TestContext.CloudConfig.MasterName; masterName != "" {
|
||||||
return "", "", err
|
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
|
return masterImg, nodeImg, nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user