Set GOMAXPROCS. Print errors on stderr.

This commit is contained in:
Daniel Smith
2015-02-19 10:30:31 -08:00
parent 1b5d14423c
commit fcddefa184
7 changed files with 45 additions and 4 deletions

View File

@@ -24,6 +24,7 @@ import (
"io/ioutil"
"os"
"path"
"runtime"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
"github.com/GoogleCloudPlatform/kubernetes/pkg/version/verflag"
@@ -177,8 +178,10 @@ func (hk *HyperKube) Run(args []string) error {
// RunToExit will run the hyperkube and then call os.Exit with an appropriate exit code.
func (hk *HyperKube) RunToExit(args []string) {
runtime.GOMAXPROCS(runtime.NumCPU())
err := hk.Run(args)
if err != nil {
fmt.Fprint(os.Stderr, err.Error())
os.Exit(1)
}
os.Exit(0)