Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,11 @@ func main() {
os.Exit(1)
}

if metricsAddr != "" {
// controller-runtime disables its metrics server when BindAddress is
// "0"; treat both "0" and "" as metrics disabled so registration and
// publishing stay consistent.
metricsEnabled := metricsAddr != "" && metricsAddr != "0"
if metricsEnabled {
log.Info("Registering scale set metrics")
actionsgithubcommetrics.RegisterMetrics()
}
Expand Down Expand Up @@ -350,7 +354,7 @@ func main() {
Client: mgr.GetClient(),
Log: log.WithName("EphemeralRunnerSet").WithValues("version", build.Version),
Scheme: mgr.GetScheme(),
PublishMetrics: metricsAddr != "0",
PublishMetrics: metricsEnabled,
ResourceBuilder: rb,
}).SetupWithManager(mgr, controllerOpts...); err != nil {
log.Error(err, "unable to create controller", "controller", "EphemeralRunnerSet")
Expand Down