Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CA: Iterate through existed node groups in AnnotationNodeInfoProvider #5078

Merged
merged 1 commit into from
Aug 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -45,18 +45,18 @@ 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()
if err != nil {
continue
}
for key, val := range template.Node().Annotations {
if _, ok := nodeInfo.Node().Annotations[key]; !ok {
nodeInfo.Node().Annotations[key] = val
// 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
}
for key, val := range template.Node().Annotations {
if _, ok := nodeInfo.Node().Annotations[key]; !ok {
nodeInfo.Node().Annotations[key] = val
}
}
}
}