mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 06:27:05 +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
|
// FilterInstanceGroupsByName lists all InstanceGroups in the project and
|
||||||
// zone that match the name regexp.
|
// 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()
|
ctx, cancel := cloud.ContextWithCallTimeout()
|
||||||
defer cancel()
|
defer cancel()
|
||||||
mc := newInstanceGroupMetricContext("filter", zone)
|
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)
|
return v, mc.Observe(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -626,9 +626,9 @@ func (g *Cloud) ensureInternalInstanceGroups(name string, nodes []*v1.Node) ([]s
|
|||||||
var igLinks []string
|
var igLinks []string
|
||||||
for zone, nodes := range zonedNodes {
|
for zone, nodes := range zonedNodes {
|
||||||
if g.AlphaFeatureGate.Enabled(AlphaFeatureSkipIGsManagement) {
|
if g.AlphaFeatureGate.Enabled(AlphaFeatureSkipIGsManagement) {
|
||||||
igs, err := g.FilterInstanceGroupsByName(name, zone)
|
igs, err := g.FilterInstanceGroupsByNamePrefix(name, zone)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return []string{}, err
|
return nil, err
|
||||||
}
|
}
|
||||||
for _, ig := range igs {
|
for _, ig := range igs {
|
||||||
igLinks = append(igLinks, ig.SelfLink)
|
igLinks = append(igLinks, ig.SelfLink)
|
||||||
@ -636,7 +636,7 @@ func (g *Cloud) ensureInternalInstanceGroups(name string, nodes []*v1.Node) ([]s
|
|||||||
} else {
|
} else {
|
||||||
igLink, err := g.ensureInternalInstanceGroup(name, zone, nodes)
|
igLink, err := g.ensureInternalInstanceGroup(name, zone, nodes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return []string{}, err
|
return nil, err
|
||||||
}
|
}
|
||||||
igLinks = append(igLinks, igLink)
|
igLinks = append(igLinks, igLink)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user