mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-12 13:31:52 +00:00
Fix ListZonesInRegion() after client BasePath change
This path fixes region Regex for listing zones. Compute client BasePath changed to compute.googleapis.com, but resource URI were left as www.googleapis.com
This commit is contained in:
parent
5afc42de95
commit
a7c3c9f0d5
@ -20,6 +20,7 @@ package gce
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
compute "google.golang.org/api/compute/v1"
|
compute "google.golang.org/api/compute/v1"
|
||||||
@ -79,7 +80,9 @@ func (g *Cloud) ListZonesInRegion(region string) ([]*compute.Zone, error) {
|
|||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
mc := newZonesMetricContext("list", region)
|
mc := newZonesMetricContext("list", region)
|
||||||
list, err := g.c.Zones().List(ctx, filter.Regexp("region", g.getRegionLink(region)))
|
// Use regex match instead of an exact regional link constructed from getRegionalLink below.
|
||||||
|
// See comments in issue kubernetes/kubernetes#87905
|
||||||
|
list, err := g.c.Zones().List(ctx, filter.Regexp("region", fmt.Sprintf(".*/regions/%s", region)))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, mc.Observe(err)
|
return nil, mc.Observe(err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user