Skip to content

Commit cbb779e

Browse files
authored
Merge pull request kubernetes#92883 from jingxu97/July/listzones
Fix ListZonesInRegion() after client BasePath change
2 parents f41a204 + a7c3c9f commit cbb779e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

staging/src/k8s.io/legacy-cloud-providers/gce/gce_zones.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ package gce
2020

2121
import (
2222
"context"
23+
"fmt"
2324
"strings"
2425

2526
compute "google.golang.org/api/compute/v1"
@@ -79,7 +80,9 @@ func (g *Cloud) ListZonesInRegion(region string) ([]*compute.Zone, error) {
7980
defer cancel()
8081

8182
mc := newZonesMetricContext("list", region)
82-
list, err := g.c.Zones().List(ctx, filter.Regexp("region", g.getRegionLink(region)))
83+
// Use regex match instead of an exact regional link constructed from getRegionalLink below.
84+
// See comments in issue kubernetes/kubernetes#87905
85+
list, err := g.c.Zones().List(ctx, filter.Regexp("region", fmt.Sprintf(".*/regions/%s", region)))
8386
if err != nil {
8487
return nil, mc.Observe(err)
8588
}

0 commit comments

Comments
 (0)