forked from AliyunContainerService/terway
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
33 lines (28 loc) · 913 Bytes
/
main.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
package main
import (
"flag"
"github.com/AliyunContainerService/terway/daemon"
log "github.com/sirupsen/logrus"
)
const defaultConfigPath = "/etc/eni/eni.json"
const defaultPidPath = "/var/run/eni/eni.pid"
const defaultSocketPath = "/var/run/eni/eni.socket"
const debugSocketPath = "unix:///var/run/eni/eni_debug.socket"
var (
gitVer string
logLevel string
daemonMode string
readonlyListen string
)
func init() {
flag.StringVar(&daemonMode, "daemon-mode", "VPC", "terway network mode")
flag.StringVar(&logLevel, "log-level", "info", "terway log level")
flag.StringVar(&readonlyListen, "readonly-listen", debugSocketPath, "terway readonly listen")
}
func main() {
flag.Parse()
log.Infof("Starting terway of version: %s", gitVer)
if err := daemon.Run(defaultPidPath, defaultSocketPath, readonlyListen, defaultConfigPath, daemonMode, logLevel); err != nil {
log.Fatal(err)
}
}