-
Notifications
You must be signed in to change notification settings - Fork 6
/
main.go
46 lines (39 loc) · 957 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
42
43
44
45
46
package main
import (
"github.com/reallyliri/kubescout/config"
"github.com/reallyliri/kubescout/pkg"
log "github.com/sirupsen/logrus"
"github.com/urfave/cli/v2"
_ "k8s.io/client-go/plugin/pkg/client/auth"
"os"
)
const VERSION = "0.1.16"
func main() {
cli.AppHelpTemplate =
`NAME:
{{.Name}} - {{.Version}} - {{.Usage}}
USAGE:
{{.Name}}{{range .Flags}}{{if and (not (eq .Name "help")) (not (eq .Name "version")) }} {{if .Required}}--{{.Name}} value{{end}}{{end}}{{end}} [optional flags]
OPTIONS:
{{range .Flags}}{{.}}
{{end}}
`
app := &cli.App{
Name: "kubescout",
Usage: "Scout for alarming issues in your Kubernetes cluster",
Flags: config.Flags,
Version: VERSION,
Action: func(ctx *cli.Context) error {
cfg, err := config.ParseConfig(ctx)
if err != nil {
return err
}
return pkg.Scout(cfg, nil)
},
}
err := app.Run(os.Args)
if err != nil {
log.Errorf("failed: %v", err)
os.Exit(1)
}
}