k3s/main.go

62 lines
1.6 KiB
Go
Raw Normal View History

2019-05-09 22:05:51 +00:00
//go:generate go run pkg/codegen/cleanup/main.go
//go:generate rm -rf pkg/generated
2019-05-09 22:05:51 +00:00
//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
2019-01-01 08:23:01 +00:00
package main
import (
"context"
"errors"
2019-01-01 08:23:01 +00:00
"os"
"github.com/k3s-io/k3s/pkg/cli/agent"
"github.com/k3s-io/k3s/pkg/cli/cert"
"github.com/k3s-io/k3s/pkg/cli/cmds"
"github.com/k3s-io/k3s/pkg/cli/completion"
"github.com/k3s-io/k3s/pkg/cli/crictl"
"github.com/k3s-io/k3s/pkg/cli/etcdsnapshot"
"github.com/k3s-io/k3s/pkg/cli/kubectl"
"github.com/k3s-io/k3s/pkg/cli/secretsencrypt"
"github.com/k3s-io/k3s/pkg/cli/server"
"github.com/k3s-io/k3s/pkg/configfilearg"
2019-01-01 08:23:01 +00:00
"github.com/sirupsen/logrus"
"github.com/urfave/cli"
2019-01-01 08:23:01 +00:00
)
func main() {
2019-01-09 16:54:15 +00:00
app := cmds.NewApp()
app.Commands = []cli.Command{
2019-01-09 16:54:15 +00:00
cmds.NewServerCommand(server.Run),
cmds.NewAgentCommand(agent.Run),
cmds.NewKubectlCommand(kubectl.Run),
2019-02-08 04:08:10 +00:00
cmds.NewCRICTL(crictl.Run),
cmds.NewEtcdSnapshotCommand(etcdsnapshot.Save,
cmds.NewEtcdSnapshotSubcommands(
etcdsnapshot.Delete,
etcdsnapshot.List,
etcdsnapshot.Prune,
etcdsnapshot.Save),
),
cmds.NewSecretsEncryptCommand(cli.ShowAppHelp,
cmds.NewSecretsEncryptSubcommands(
secretsencrypt.Status,
secretsencrypt.Enable,
secretsencrypt.Disable,
secretsencrypt.Prepare,
secretsencrypt.Rotate,
secretsencrypt.Reencrypt),
),
cmds.NewCertCommand(
cmds.NewCertSubcommands(
cert.Run),
),
cmds.NewCompletionCommand(completion.Run),
2019-01-01 08:23:01 +00:00
}
if err := app.Run(configfilearg.MustParse(os.Args)); err != nil && !errors.Is(err, context.Canceled) {
2019-01-01 08:23:01 +00:00
logrus.Fatal(err)
}
}