@@ -21,7 +21,6 @@ import (
2121 "encoding/json"
2222 "fmt"
2323 "maps"
24- "strings"
2524
2625 tfv1 "github.com/NexusGPU/tensor-fusion/api/v1"
2726 "github.com/NexusGPU/tensor-fusion/internal/config"
@@ -384,6 +383,10 @@ func (r *GPUNodeReconciler) createHypervisorPod(ctx context.Context, key client.
384383 if err := r .Get (ctx , client.ObjectKey {Name : * pool .Spec .SchedulingConfigTemplate }, schedulingConfigTemplate ); err == nil {
385384 if schedulingConfigTemplate .Spec .Hypervisor != nil {
386385 if cfg , err := json .Marshal (schedulingConfigTemplate .Spec .Hypervisor ); err == nil {
386+ extraLabelsJson , err := json .Marshal (config .GetGlobalConfig ().MetricsExtraPodLabels )
387+ if err != nil {
388+ return fmt .Errorf ("invalid metricsExtraPodLabels config, not valid map: %w" , err )
389+ }
387390 spec .Containers [0 ].Env = append (spec .Containers [0 ].Env , corev1.EnvVar {
388391 Name : constants .HypervisorSchedulingConfigEnv ,
389392 Value : string (cfg ),
@@ -392,7 +395,7 @@ func (r *GPUNodeReconciler) createHypervisorPod(ctx context.Context, key client.
392395 Value : config .GetGlobalConfig ().MetricsFormat ,
393396 }, corev1.EnvVar {
394397 Name : constants .HypervisorMetricsExtraLabelsEnv ,
395- Value : strings . Join ( config . GetGlobalConfig (). MetricsExtraPodLabels , "," ),
398+ Value : string ( extraLabelsJson ),
396399 })
397400 }
398401 }
0 commit comments