2021-01-21 21:09:15 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2021-09-08 17:56:18 +00:00
|
|
|
"context"
|
|
|
|
"errors"
|
2021-01-21 21:09:15 +00:00
|
|
|
"os"
|
|
|
|
|
2022-03-02 23:47:27 +00:00
|
|
|
"github.com/k3s-io/k3s/pkg/cli/cmds"
|
|
|
|
"github.com/k3s-io/k3s/pkg/cli/etcdsnapshot"
|
|
|
|
"github.com/k3s-io/k3s/pkg/configfilearg"
|
2021-01-21 21:09:15 +00:00
|
|
|
"github.com/sirupsen/logrus"
|
|
|
|
"github.com/urfave/cli"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
app := cmds.NewApp()
|
|
|
|
app.Commands = []cli.Command{
|
2022-03-01 21:33:01 +00:00
|
|
|
cmds.NewEtcdSnapshotCommand(etcdsnapshot.Save,
|
2021-05-13 20:36:33 +00:00
|
|
|
cmds.NewEtcdSnapshotSubcommands(
|
|
|
|
etcdsnapshot.Delete,
|
|
|
|
etcdsnapshot.List,
|
2021-05-17 17:55:13 +00:00
|
|
|
etcdsnapshot.Prune,
|
2022-03-01 21:33:01 +00:00
|
|
|
etcdsnapshot.Save),
|
2021-05-13 20:36:33 +00:00
|
|
|
),
|
2021-01-21 21:09:15 +00:00
|
|
|
}
|
|
|
|
|
2021-09-08 17:56:18 +00:00
|
|
|
if err := app.Run(configfilearg.MustParse(os.Args)); err != nil && !errors.Is(err, context.Canceled) {
|
2021-01-21 21:09:15 +00:00
|
|
|
logrus.Fatal(err)
|
|
|
|
}
|
|
|
|
}
|