Skip to content

Commit f3c4d8e

Browse files
fwieselnotandy
authored andcommitted
Print 'version'
The build process expect that the -version flag is supported. Let's handle that by simply exiting for now.
1 parent 9bfc3e0 commit f3c4d8e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cmd/main.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ func init() {
6868
}
6969

7070
func main() {
71+
var version bool
7172
var metricsAddr string
7273
var enableLeaderElection bool
7374
var probeAddr string
@@ -77,6 +78,8 @@ func main() {
7778
var certificateNamespace string
7879
var certificateIssuerName string
7980

81+
flag.BoolVar(&version, "version", false,
82+
"Print the version and exit.")
8083
flag.StringVar(&metricsAddr, "metrics-bind-address", "0", "The address the metrics endpoint binds to. "+
8184
"Use :8443 for HTTPS or :8080 for HTTP, or leave as 0 to disable the metrics service.")
8285
flag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.")
@@ -102,6 +105,10 @@ func main() {
102105
opts.BindFlags(flag.CommandLine)
103106
flag.Parse()
104107

108+
if version {
109+
os.Exit(0)
110+
}
111+
105112
ctrl.SetLogger(ctrlzap.New(ctrlzap.UseFlagOptions(&opts)))
106113

107114
// if the enable-http2 flag is false (the default), http/2 should be disabled

0 commit comments

Comments
 (0)