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-12-05 23:28:01 +00:00
|
|
|
cmds.NewEtcdSnapshotCommands(
|
|
|
|
etcdsnapshot.Delete,
|
|
|
|
etcdsnapshot.List,
|
|
|
|
etcdsnapshot.Prune,
|
|
|
|
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)
|
|
|
|
}
|
|
|
|
}
|