From 7bf18c61fdb5703b00053278b1b4012ca05c7996 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Steenis Date: Sun, 17 Jan 2021 16:09:12 +0100 Subject: [PATCH] Warn when snapshot name contains file extension --- cmd/etcd.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/etcd.go b/cmd/etcd.go index 4916bc5c..608757a5 100644 --- a/cmd/etcd.go +++ b/cmd/etcd.go @@ -341,6 +341,10 @@ func RestoreEtcdSnapshotFromCli(ctx *cli.Context) error { if etcdSnapshotName == "" { return fmt.Errorf("you must specify the snapshot name to restore") } + // Warn user if etcdSnapshotName contains extension (should just be snapshotname, not the filename) + if strings.HasSuffix(etcdSnapshotName, ".zip") { + logrus.Warnf("The snapshot name [%s] ends with the file extension (.zip) which is not needed, the snapshot name should be provided without the extension", etcdSnapshotName) + } // setting up the flags // flag to use local state file useLocalState := ctx.Bool("use-local-state")