@@ -10,15 +10,16 @@ import (
10
10
"time"
11
11
12
12
configv1client "github.com/openshift/client-go/config/clientset/versioned/typed/config/v1"
13
- "github.com/operator-framework/operator-lifecycle-manager/pkg/lib/operatorclient"
14
- "github.com/operator-framework/operator-lifecycle-manager/pkg/lib/operatorstatus"
15
13
"github.com/prometheus/client_golang/prometheus/promhttp"
16
14
log "github.com/sirupsen/logrus"
17
15
v1 "k8s.io/api/core/v1"
18
16
utilclock "k8s.io/apimachinery/pkg/util/clock"
19
17
"k8s.io/client-go/tools/clientcmd"
20
18
21
19
"github.com/operator-framework/operator-lifecycle-manager/pkg/controller/operators/catalog"
20
+ "github.com/operator-framework/operator-lifecycle-manager/pkg/lib/operatorclient"
21
+ "github.com/operator-framework/operator-lifecycle-manager/pkg/lib/operatorstatus"
22
+ "github.com/operator-framework/operator-lifecycle-manager/pkg/lib/profile"
22
23
"github.com/operator-framework/operator-lifecycle-manager/pkg/lib/signals"
23
24
"github.com/operator-framework/operator-lifecycle-manager/pkg/metrics"
24
25
olmversion "github.com/operator-framework/operator-lifecycle-manager/pkg/version"
61
62
62
63
tlsCertPath = flag .String (
63
64
"tls-cert" , "" , "Path to use for certificate key (requires tls-key)" )
65
+
66
+ profiling = flag .Bool (
67
+ "profiling" , false , "serve profiling data (on port 8080)" )
64
68
)
65
69
66
70
func init () {
@@ -114,6 +118,13 @@ func main() {
114
118
healthMux .HandleFunc ("/healthz" , func (w http.ResponseWriter , r * http.Request ) {
115
119
w .WriteHeader (http .StatusOK )
116
120
})
121
+
122
+ // Serve profiling if enabled
123
+ if * profiling {
124
+ logger .Infof ("profiling enabled" )
125
+ profile .RegisterHandlers (healthMux )
126
+ }
127
+
117
128
go http .ListenAndServe (":8080" , healthMux )
118
129
119
130
metricsMux := http .NewServeMux ()
0 commit comments