-
Notifications
You must be signed in to change notification settings - Fork 25
/
main.go
61 lines (56 loc) · 1.55 KB
/
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//go:generate go run pkg/codegen/cleanup/main.go
//go:generate /bin/rm -rf pkg/generated
//go:generate go run pkg/codegen/main.go
//go:generate go fmt pkg/deploy/zz_generated_bindata.go
//go:generate go fmt pkg/static/zz_generated_bindata.go
package main
import (
"context"
"errors"
"os"
"github.com/sirupsen/logrus"
"github.com/urfave/cli"
"github.com/xiaods/k8e/pkg/cli/agent"
"github.com/xiaods/k8e/pkg/cli/cert"
"github.com/xiaods/k8e/pkg/cli/cmds"
"github.com/xiaods/k8e/pkg/cli/completion"
"github.com/xiaods/k8e/pkg/cli/crictl"
"github.com/xiaods/k8e/pkg/cli/etcdsnapshot"
"github.com/xiaods/k8e/pkg/cli/kubectl"
"github.com/xiaods/k8e/pkg/cli/secretsencrypt"
"github.com/xiaods/k8e/pkg/cli/server"
"github.com/xiaods/k8e/pkg/configfilearg"
)
func main() {
app := cmds.NewApp()
app.Commands = []cli.Command{
cmds.NewServerCommand(server.Run),
cmds.NewAgentCommand(agent.Run),
cmds.NewKubectlCommand(kubectl.Run),
cmds.NewCRICTL(crictl.Run),
cmds.NewEtcdSnapshotCommands(
etcdsnapshot.Delete,
etcdsnapshot.List,
etcdsnapshot.Prune,
etcdsnapshot.Save,
),
cmds.NewSecretsEncryptCommands(
secretsencrypt.Status,
secretsencrypt.Enable,
secretsencrypt.Disable,
secretsencrypt.Prepare,
secretsencrypt.Rotate,
secretsencrypt.Reencrypt,
secretsencrypt.RotateKeys,
),
cmds.NewCertCommands(
cert.Check,
cert.Rotate,
cert.RotateCA,
),
cmds.NewCompletionCommand(completion.Run),
}
if err := app.Run(configfilearg.MustParse(os.Args)); err != nil && !errors.Is(err, context.Canceled) {
logrus.Fatal(err)
}
}