Skip to content

Commit

Permalink
Move if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
ciarams87 committed Jun 30, 2022
1 parent ff61c01 commit 2e3b8f8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions cmd/nginx-ingress/flags.go
Expand Up @@ -180,7 +180,9 @@ func parseFlags(versionInfo string, binaryInfo string) {

initialChecks()

printVersionInfo(versionInfo, binaryInfo)
if *versionFlag {
printVersionInfo(versionInfo, binaryInfo)
}

glog.Infof("Starting NGINX Ingress Controller %v PlusFlag=%v", versionInfo, *nginxPlus)
glog.Info(binaryInfo)
Expand Down Expand Up @@ -267,11 +269,9 @@ func initialChecks() {

// printVersionInfo prints the the version and binary info before exiting if the flag is set
func printVersionInfo(versionInfo string, binaryInfo string) {
if *versionFlag {
fmt.Println(versionInfo)
fmt.Println(binaryInfo)
os.Exit(0)
}
fmt.Println(versionInfo)
fmt.Println(binaryInfo)
os.Exit(0)
}

// validationChecks checks the values for various flags
Expand Down

0 comments on commit 2e3b8f8

Please sign in to comment.