Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release/v1.1] Fix restoring backups when custom certs are used #2191

Merged
merged 1 commit into from
Aug 7, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions cmd/etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,23 @@ func EtcdCommand() cli.Command {
Usage: "Specify s3 folder name",
},
}
snapshotFlags = append(snapshotFlags, commonFlags...)
snapshotSaveFlags := append(snapshotFlags, commonFlags...)

snapshotRestoreFlags := []cli.Flag{
cli.StringFlag{
Name: "cert-dir",
Usage: "Specify a certificate dir path",
},
cli.BoolFlag{
Name: "custom-certs",
Usage: "Use custom certificates from a cert dir",
},
cli.BoolFlag{
Name: "use-local-state",
Usage: "Use local state file (do not check or use snapshot archive for state file)",
},
}
snapshotRestoreFlags = append(append(snapshotFlags, snapshotRestoreFlags...), commonFlags...)

return cli.Command{
Name: "etcd",
Expand All @@ -74,13 +90,13 @@ func EtcdCommand() cli.Command {
{
Name: "snapshot-save",
Usage: "Take snapshot on all etcd hosts",
Flags: snapshotFlags,
Flags: snapshotSaveFlags,
Action: SnapshotSaveEtcdHostsFromCli,
},
{
Name: "snapshot-restore",
Usage: "Restore existing snapshot",
Flags: snapshotFlags,
Flags: snapshotRestoreFlags,
Action: RestoreEtcdSnapshotFromCli,
},
},
Expand Down