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