Fix a panic when no arguments are passed
@@ -48,6 +48,7 @@ func init() {
func main() {
// Make it possible to just print the version number and exit
+ if len(os.Args) > 1 {
if os.Args[1] == "version" {
fmt.Printf("%s version: %s\n", filepath.Base(os.Args[0]), version.GetVersion())
os.Exit(0)
@@ -61,6 +62,7 @@ func main() {
os.Exit(0)
}
}
+ }
var metricsAddr string
var enableLeaderElection bool
