mirror of
https://github.com/kubernetes-sigs/descheduler.git
synced 2026-01-26 05:14:13 +01:00
fix: provide USER env var to correctly initialize tracing
This is done to prevent "Current requires cgo or $USER set in environment" error during tracing initialization.
This commit is contained in:
@@ -110,6 +110,12 @@ func NewTracerProvider(ctx context.Context, endpoint, caCert, name, namespace st
|
||||
opts = append(opts, otlptracegrpc.WithInsecure())
|
||||
}
|
||||
|
||||
if os.Getenv("USER") == "" {
|
||||
if err := os.Setenv("USER", "descheduler"); err != nil {
|
||||
klog.ErrorS(err, "failed to set USER environment variable")
|
||||
}
|
||||
}
|
||||
|
||||
client := otlptracegrpc.NewClient(opts...)
|
||||
|
||||
exporter, err := otlptrace.New(ctx, client)
|
||||
|
||||
Reference in New Issue
Block a user