-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.go
41 lines (34 loc) · 945 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
38
39
40
41
package main
import (
"time"
"github.com/castai/kvisor/pkg/logging"
"github.com/sirupsen/logrus"
"github.com/spf13/pflag"
"github.com/castai/kvisor/cmd/event-generator/app"
)
var (
Version = "local"
logLevel = pflag.String("log-level", logrus.DebugLevel.String(), "log level")
mode = pflag.String("mode", "controller", "Run as controller or single event generator")
thiefDelay = pflag.Duration("thief-delay", 90*time.Second, "")
thiefInterval = pflag.Duration("thief-interval", 30*time.Second, "")
)
func main() {
pflag.Parse()
log := logging.New(&logging.Config{
Level: logging.MustParseLevel(*logLevel),
})
genapp, err := app.New(&app.Config{
Version: Version,
Log: log,
Kubeconfig: "",
ThiefDelay: *thiefDelay,
ThiefInterval: *thiefInterval,
})
if err != nil {
log.Fatal(err.Error())
}
if err := genapp.Run(*mode); err != nil {
log.Fatal(err.Error())
}
}