mirror of https://github.com/k3s-io/k3s
Fix network/subnet url logic
parent
042913d898
commit
3ee822de67
|
@ -211,17 +211,22 @@ func newGCECloud(config io.Reader) (*GCECloud, error) {
|
|||
projectID = cfg.Global.ProjectID
|
||||
}
|
||||
|
||||
if cfg.Global.NetworkName != "" && strings.Contains(cfg.Global.NetworkName, "/") {
|
||||
networkURL = cfg.Global.NetworkName
|
||||
} else {
|
||||
networkURL = gceNetworkURL(apiEndpoint, projectID, networkName)
|
||||
if cfg.Global.NetworkName != "" {
|
||||
if strings.Contains(cfg.Global.NetworkName, "/") {
|
||||
networkURL = cfg.Global.NetworkName
|
||||
} else {
|
||||
networkURL = gceNetworkURL(apiEndpoint, projectID, networkName)
|
||||
}
|
||||
}
|
||||
|
||||
if cfg.Global.SubnetworkName != "" && strings.Contains(cfg.Global.SubnetworkName, "/") {
|
||||
subnetworkURL = cfg.Global.SubnetworkName
|
||||
} else {
|
||||
subnetworkURL = gceSubnetworkURL(apiEndpoint, cfg.Global.ProjectID, region, cfg.Global.SubnetworkName)
|
||||
if cfg.Global.SubnetworkName != "" {
|
||||
if strings.Contains(cfg.Global.SubnetworkName, "/") {
|
||||
subnetworkURL = cfg.Global.SubnetworkName
|
||||
} else {
|
||||
subnetworkURL = gceSubnetworkURL(apiEndpoint, projectID, region, cfg.Global.SubnetworkName)
|
||||
}
|
||||
}
|
||||
|
||||
if cfg.Global.TokenURL != "" {
|
||||
tokenSource = NewAltTokenSource(cfg.Global.TokenURL, cfg.Global.TokenBody)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue