mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
Merge pull request #3336 from briandowns/issue-3309
Add etcd snapshot save subcommand
This commit is contained in:
commit
424d75ad43
@ -17,7 +17,8 @@ func main() {
|
||||
cmds.NewEtcdSnapshotSubcommands(
|
||||
etcdsnapshot.Delete,
|
||||
etcdsnapshot.List,
|
||||
etcdsnapshot.Prune),
|
||||
etcdsnapshot.Prune,
|
||||
etcdsnapshot.Run),
|
||||
),
|
||||
}
|
||||
|
||||
|
@ -46,6 +46,7 @@ func main() {
|
||||
cmds.NewCheckConfigCommand(externalCLIAction("check-config", dataDir)),
|
||||
cmds.NewEtcdSnapshotCommand(etcdsnapshotCommand,
|
||||
cmds.NewEtcdSnapshotSubcommands(
|
||||
etcdsnapshotCommand,
|
||||
etcdsnapshotCommand,
|
||||
etcdsnapshotCommand,
|
||||
etcdsnapshotCommand),
|
||||
|
@ -47,7 +47,8 @@ func main() {
|
||||
cmds.NewEtcdSnapshotSubcommands(
|
||||
etcdsnapshot.Delete,
|
||||
etcdsnapshot.List,
|
||||
etcdsnapshot.Prune),
|
||||
etcdsnapshot.Prune,
|
||||
etcdsnapshot.Run),
|
||||
),
|
||||
}
|
||||
|
||||
|
3
main.go
3
main.go
@ -31,7 +31,8 @@ func main() {
|
||||
cmds.NewEtcdSnapshotSubcommands(
|
||||
etcdsnapshot.Delete,
|
||||
etcdsnapshot.List,
|
||||
etcdsnapshot.Prune),
|
||||
etcdsnapshot.Prune,
|
||||
etcdsnapshot.Run),
|
||||
),
|
||||
}
|
||||
|
||||
|
@ -95,7 +95,7 @@ func NewEtcdSnapshotCommand(action func(*cli.Context) error, subcommands []cli.C
|
||||
}
|
||||
}
|
||||
|
||||
func NewEtcdSnapshotSubcommands(delete, list, prune func(ctx *cli.Context) error) []cli.Command {
|
||||
func NewEtcdSnapshotSubcommands(delete, list, prune, save func(ctx *cli.Context) error) []cli.Command {
|
||||
return []cli.Command{
|
||||
{
|
||||
Name: "delete",
|
||||
@ -127,5 +127,17 @@ func NewEtcdSnapshotSubcommands(delete, list, prune func(ctx *cli.Context) error
|
||||
Value: defaultSnapshotRentention,
|
||||
}),
|
||||
},
|
||||
{
|
||||
Name: "save",
|
||||
Usage: "Trigger an immediate etcd snapshot",
|
||||
SkipFlagParsing: false,
|
||||
SkipArgReorder: true,
|
||||
Action: save,
|
||||
Flags: append(EtcdSnapshotFlags, &cli.StringFlag{
|
||||
Name: "dir",
|
||||
Usage: "(db) Directory to save etcd on-demand snapshot. (default: ${data-dir}/db/snapshots)",
|
||||
Destination: &ServerConfig.EtcdSnapshotDir,
|
||||
}),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user