mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 04:06:03 +00:00
Applied review comments
This commit is contained in:
parent
c92b922798
commit
3f5a8754d0
@ -52,11 +52,11 @@ func (g *Cloud) DeleteInstanceGroup(name string, zone string) error {
|
||||
|
||||
// FilterInstanceGroupsByName lists all InstanceGroups in the project and
|
||||
// zone that match the name regexp.
|
||||
func (g *Cloud) FilterInstanceGroupsByName(name, zone string) ([]*compute.InstanceGroup, error) {
|
||||
func (g *Cloud) FilterInstanceGroupsByNamePrefix(namePrefix, zone string) ([]*compute.InstanceGroup, error) {
|
||||
ctx, cancel := cloud.ContextWithCallTimeout()
|
||||
defer cancel()
|
||||
mc := newInstanceGroupMetricContext("filter", zone)
|
||||
v, err := g.c.InstanceGroups().List(ctx, zone, filter.Regexp("name", name))
|
||||
v, err := g.c.InstanceGroups().List(ctx, zone, filter.Regexp("name", namePrefix+".*"))
|
||||
return v, mc.Observe(err)
|
||||
}
|
||||
|
||||
|
@ -626,9 +626,9 @@ func (g *Cloud) ensureInternalInstanceGroups(name string, nodes []*v1.Node) ([]s
|
||||
var igLinks []string
|
||||
for zone, nodes := range zonedNodes {
|
||||
if g.AlphaFeatureGate.Enabled(AlphaFeatureSkipIGsManagement) {
|
||||
igs, err := g.FilterInstanceGroupsByName(name, zone)
|
||||
igs, err := g.FilterInstanceGroupsByNamePrefix(name, zone)
|
||||
if err != nil {
|
||||
return []string{}, err
|
||||
return nil, err
|
||||
}
|
||||
for _, ig := range igs {
|
||||
igLinks = append(igLinks, ig.SelfLink)
|
||||
@ -636,7 +636,7 @@ func (g *Cloud) ensureInternalInstanceGroups(name string, nodes []*v1.Node) ([]s
|
||||
} else {
|
||||
igLink, err := g.ensureInternalInstanceGroup(name, zone, nodes)
|
||||
if err != nil {
|
||||
return []string{}, err
|
||||
return nil, err
|
||||
}
|
||||
igLinks = append(igLinks, igLink)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user