Skip to content

Commit 203aa3d

Browse files
Override and escape component provided by controller. Close #826 (#840)
Co-authored-by: Iliia Khaprov <[email protected]>
1 parent eebe960 commit 203aa3d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/utils/envconfig.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package utils
33
import (
44
"context"
55
"net/http"
6+
"strings"
67

78
"go.uber.org/zap"
89
"knative.dev/pkg/logging"
@@ -72,7 +73,9 @@ func (e *EnvConfig) SetupMetrics(ctx context.Context) error {
7273
if err != nil {
7374
return err
7475
}
76+
7577
if metricsConfig != nil {
78+
metricsConfig.Component = strings.ReplaceAll(e.component, "-", "_")
7679
if err := metrics.UpdateExporter(ctx, *metricsConfig, logger); err != nil {
7780
return err
7881
}

0 commit comments

Comments
 (0)