CA: Iterate through existed node groups in AnnotationNodeInfoProvider

This commit is contained in:
Yaroslava Serdiuk 2022-08-09 12:01:03 +00:00
parent 0caa3251c7
commit 887e16c3fc
1 changed files with 12 additions and 12 deletions

View File

@ -45,12 +45,11 @@ func (p *AnnotationNodeInfoProvider) Process(ctx *context.AutoscalingContext, no
if err != nil { if err != nil {
return nil, err return nil, err
} }
for _, nodeInfo := range nodeInfos { // Add annotatios to the NodeInfo to use later in expander.
nodeGroup, err := ctx.CloudProvider.NodeGroupForNode(nodeInfo.Node()) nodeGroups := ctx.CloudProvider.NodeGroups()
if err != nil { for _, ng := range nodeGroups {
continue if nodeInfo, ok := nodeInfos[ng.Id()]; ok {
} template, err := ng.TemplateNodeInfo()
template, err := nodeGroup.TemplateNodeInfo()
if err != nil { if err != nil {
continue continue
} }
@ -60,6 +59,7 @@ func (p *AnnotationNodeInfoProvider) Process(ctx *context.AutoscalingContext, no
} }
} }
} }
}
return nodeInfos, nil return nodeInfos, nil
} }