mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 12:43:23 +00:00
Merge pull request #54196 from jingax10/fix_aliases_branch
Automatic merge from submit-queue (batch tested with PRs 54199, 54181, 54196). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Pass zone name instead of zone url to GCE API to update NIC setting for alias range **What this PR does / why we need it**: Zone passed to gce.serviceAlpha.Instances.UpdateNetworkInterface(...) as a URL as it results the following error: Could not add alias 10.64.3.0/24 for node "kubernetes-minion-group-mhhd": googleapi: Error 400: Invalid value 'http://www.googleapis.com/compute/alpha/projects/bigclustertestdev0-devconsole/zones/dev-central1-std'. Values must match the following regular expression: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', invalidParameter The fix is to extract (last component of URL) the zone name from the corresponding resource URL. **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes # No issue filed yet. **Special notes for your reviewer**: **Release note**: ```release-note NONE ```
This commit is contained in:
commit
2425486b5e
@ -371,7 +371,7 @@ func (gce *GCECloud) AddAliasToInstance(nodeName types.NodeName, alias *net.IPNe
|
||||
|
||||
mc := newInstancesMetricContext("addalias", v1instance.Zone)
|
||||
op, err := gce.serviceAlpha.Instances.UpdateNetworkInterface(
|
||||
gce.projectID, instance.Zone, instance.Name, iface.Name, iface).Do()
|
||||
gce.projectID, lastComponent(instance.Zone), instance.Name, iface.Name, iface).Do()
|
||||
if err != nil {
|
||||
return mc.Observe(err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user