@@ -8,14 +8,13 @@ import (
88 "path/filepath"
99 "time"
1010
11- "github.com/go-logr/logr"
1211 "github.com/operator-framework/operator-lifecycle-manager/pkg/lib/filemonitor"
1312 "github.com/operator-framework/operator-lifecycle-manager/pkg/lib/profile"
1413 "github.com/prometheus/client_golang/prometheus/promhttp"
1514 "github.com/sirupsen/logrus"
1615 "k8s.io/client-go/rest"
17- "sigs.k8s.io/controller-runtime/pkg/metrics/filters"
1816 "sigs.k8s.io/controller-runtime/pkg/log"
17+ "sigs.k8s.io/controller-runtime/pkg/metrics/filters"
1918)
2019
2120// Option applies a configuration option to the given config.
@@ -111,10 +110,10 @@ func (sc serverConfig) getListenAndServeFunc() (func() error, error) {
111110
112111 // Set up authenticated metrics endpoint if kubeConfig is provided
113112 sc .logger .Infof ("DEBUG: Checking authentication setup - kubeConfig != nil: %v, tlsEnabled: %v" , sc .kubeConfig != nil , tlsEnabled )
114-
113+
115114 if sc .kubeConfig != nil && tlsEnabled {
116115 sc .logger .Info ("DEBUG: Setting up authenticated metrics endpoint" )
117-
116+
118117 // Create authentication filter using controller-runtime
119118 sc .logger .Info ("DEBUG: Creating authentication filter with controller-runtime" )
120119 filter , err := filters .WithAuthenticationAndAuthorization (sc .kubeConfig , & http.Client {
@@ -138,7 +137,7 @@ func (sc serverConfig) getListenAndServeFunc() (func() error, error) {
138137
139138 // Add debugging wrapper to log authentication attempts
140139 debugAuthHandler := http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
141- sc .logger .Infof ("DEBUG: Metrics request from %s, Auth header present: %v, User-Agent: %s" ,
140+ sc .logger .Infof ("DEBUG: Metrics request from %s, Auth header present: %v, User-Agent: %s" ,
142141 r .RemoteAddr , r .Header .Get ("Authorization" ) != "" , r .Header .Get ("User-Agent" ))
143142 authenticatedMetricsHandler .ServeHTTP (w , r )
144143 })
0 commit comments