Skip to content

Commit

Permalink
skip synchronizing TGs on non-yandex nodes (#117)
Browse files Browse the repository at this point in the history
Signed-off-by: Egor Balakin <egor.balakin@flant.com>
  • Loading branch information
m1ron0xFF authored Mar 10, 2025
1 parent 5ce3bb8 commit 64cf777
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/cloudprovider/yandex/load_balancer_tg_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"fmt"
"log"
"strings"
"sync"

"k8s.io/klog/v2"
Expand Down Expand Up @@ -116,6 +117,11 @@ func (ntgs *NodeTargetGroupSyncer) synchronizeNodesWithTargetGroups(ctx context.
// TODO: speed up by not performing individual lookups
var instances []*instanceWithNodeInfo
for _, node := range nodes {
if !(strings.Contains(node.Spec.ProviderID, "yandex")) {
log.Printf("node %s ProviderID is not yandex (%s), skipping", node.Name, node.Spec.ProviderID)
continue
}

nodeName := MapNodeNameToInstanceName(types.NodeName(node.Name))
log.Printf("Finding Instance by Folder %q and Name %q", ntgs.cloud.config.FolderID, nodeName)
instance, err := ntgs.cloud.yandexService.ComputeSvc.FindInstanceByName(ctx, nodeName)
Expand Down

0 comments on commit 64cf777

Please sign in to comment.