@@ -18,6 +18,7 @@ package main
18
18
19
19
import (
20
20
"flag"
21
+ "fmt"
21
22
"net/http"
22
23
"os"
23
24
"time"
@@ -35,6 +36,7 @@ import (
35
36
"github.com/operator-framework/operator-controller/internal/catalogmetadata/cache"
36
37
catalogclient "github.com/operator-framework/operator-controller/internal/catalogmetadata/client"
37
38
"github.com/operator-framework/operator-controller/internal/controllers"
39
+ "github.com/operator-framework/operator-controller/internal/version"
38
40
"github.com/operator-framework/operator-controller/pkg/features"
39
41
"github.com/operator-framework/operator-controller/pkg/scheme"
40
42
)
@@ -45,17 +47,19 @@ var (
45
47
46
48
func main () {
47
49
var (
48
- metricsAddr string
49
- enableLeaderElection bool
50
- probeAddr string
51
- cachePath string
50
+ metricsAddr string
51
+ enableLeaderElection bool
52
+ probeAddr string
53
+ cachePath string
54
+ operatorControllerVersion bool
52
55
)
53
56
flag .StringVar (& metricsAddr , "metrics-bind-address" , ":8080" , "The address the metric endpoint binds to." )
54
57
flag .StringVar (& probeAddr , "health-probe-bind-address" , ":8081" , "The address the probe endpoint binds to." )
55
58
flag .BoolVar (& enableLeaderElection , "leader-elect" , false ,
56
59
"Enable leader election for controller manager. " +
57
60
"Enabling this will ensure there is only one active controller manager." )
58
61
flag .StringVar (& cachePath , "cache-path" , "/var/cache" , "The local directory path used for filesystem based caching" )
62
+ flag .BoolVar (& operatorControllerVersion , "version" , false , "Displays operator-controller version information" )
59
63
opts := zap.Options {
60
64
Development : true ,
61
65
}
@@ -65,7 +69,13 @@ func main() {
65
69
features .OperatorControllerFeatureGate .AddFlag (pflag .CommandLine )
66
70
pflag .Parse ()
67
71
72
+ if operatorControllerVersion {
73
+ fmt .Println (version .String ())
74
+ os .Exit (0 )
75
+ }
76
+
68
77
ctrl .SetLogger (zap .New (zap .UseFlagOptions (& opts ), zap .StacktraceLevel (zapcore .DPanicLevel )))
78
+ setupLog .Info ("starting up the provisioner" , "Git commit" , version .String ())
69
79
70
80
mgr , err := ctrl .NewManager (ctrl .GetConfigOrDie (), ctrl.Options {
71
81
Scheme : scheme .Scheme ,
0 commit comments