forked from joeholley/supergloo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
37 lines (31 loc) · 741 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
34
35
36
37
package main
import (
"flag"
"log"
"time"
check "github.com/solo-io/go-checkpoint"
"github.com/solo-io/supergloo/pkg/meshdiscovery/setup"
"github.com/solo-io/supergloo/pkg/version"
)
func main() {
if err := run(); err != nil {
log.Fatalf("err in main: %v", err.Error())
}
}
func run() error {
opts := setupFlags()
errs := make(chan error)
start := time.Now()
check.CallCheck("meshdiscovery", version.Version, start)
go func() {
errs <- setup.Main(nil, nil, opts)
}()
return <-errs
}
func setupFlags() *setup.MeshDiscoveryOptions {
opts := &setup.MeshDiscoveryOptions{}
flag.BoolVar(&opts.DisableConfigLoop, "disable-config", false, "set to true to disable mesh"+
"config discovery")
flag.Parse()
return opts
}