Return with exit codes to call log.Flush()
Before os.Exit(), `github.cihub/seelog`'s log.Flush() needs to be
called. Otherwise, the log message was not output and we lost some
important logs.
This patch changes surely `returns 1` to call `defer log.Flush()` in
main().
@@ -46,7 +46,7 @@ func _main() int {
kubeClient, err := k8sapi.CreateKubeClient("", "")
if err != nil {
log.Errorf("Failed to create client: %v", err)
- os.Exit(1)
+ return 1
}
discoverController := k8sapi.NewController(kubeClient)
