Skip to content

Commit cf73780

Browse files
authored
remove extra spaces when setting node annotations in Nebius (#175)
Signed-off-by: Dmitry Shmulevich <[email protected]>
1 parent 2efa825 commit cf73780

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

pkg/engines/slinky/engine.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ func getComputeInstances(nodes *corev1.NodeList, nodeMap map[string]string) ([]t
153153
klog.V(4).Infof("Cannot resolve k8s node %q", node.Name)
154154
continue
155155
}
156-
klog.V(4).InfoS("Adding compute instance", "host", hostName, "node", node.Name)
157156
instance, ok := node.Annotations[topology.KeyNodeInstance]
158157
if !ok {
159158
return nil, fmt.Errorf("missing %q annotation in node %s", topology.KeyNodeInstance, node.Name)
@@ -162,6 +161,7 @@ func getComputeInstances(nodes *corev1.NodeList, nodeMap map[string]string) ([]t
162161
if !ok {
163162
return nil, fmt.Errorf("missing %q annotation in node %s", topology.KeyNodeRegion, node.Name)
164163
}
164+
klog.V(4).InfoS("Adding compute instance", "host", hostName, "node", node.Name, "instance", instance, "region", region)
165165
if _, ok = regions[region]; !ok {
166166
regions[region] = make(map[string]string)
167167
regionNames = append(regionNames, region)

pkg/providers/nebius/imds.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ package nebius
88
import (
99
"context"
1010
"fmt"
11+
"strings"
1112

1213
"github.com/NVIDIA/topograph/internal/exec"
1314
"github.com/NVIDIA/topograph/pkg/providers"
@@ -56,7 +57,7 @@ func GetNodeAnnotations(ctx context.Context) (map[string]string, error) {
5657
}
5758

5859
return map[string]string{
59-
topology.KeyNodeInstance: mac.String(),
60-
topology.KeyNodeRegion: region,
60+
topology.KeyNodeInstance: strings.TrimSpace(mac.String()),
61+
topology.KeyNodeRegion: strings.TrimSpace(region),
6162
}, nil
6263
}

0 commit comments

Comments
 (0)