forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 1
/
gitserver.go
37 lines (30 loc) · 857 Bytes
/
gitserver.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package main
import (
"math/rand"
"os"
"path/filepath"
"runtime"
"time"
"k8s.io/kubernetes/pkg/util/logs"
"github.com/openshift/origin/pkg/cmd/infra/gitserver"
"github.com/openshift/origin/pkg/cmd/util/serviceability"
// install all APIs
_ "github.com/openshift/origin/pkg/api/install"
_ "k8s.io/kubernetes/pkg/api/install"
_ "k8s.io/kubernetes/pkg/apis/extensions/install"
)
func main() {
logs.InitLogs()
defer logs.FlushLogs()
defer serviceability.BehaviorOnPanic(os.Getenv("OPENSHIFT_ON_PANIC"))()
defer serviceability.Profile(os.Getenv("OPENSHIFT_PROFILE")).Stop()
rand.Seed(time.Now().UTC().UnixNano())
if len(os.Getenv("GOMAXPROCS")) == 0 {
runtime.GOMAXPROCS(runtime.NumCPU())
}
basename := filepath.Base(os.Args[0])
command := gitserver.CommandFor(basename)
if err := command.Execute(); err != nil {
os.Exit(1)
}
}