Skip to content
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.

Commit

Permalink
Merge pull request #209 from justinsb/restore_from_same_minor
Browse files Browse the repository at this point in the history
Support restoring from compatible minor version
  • Loading branch information
justinsb authored May 16, 2019
2 parents f7f8ae2 + c9e630c commit 5d315dc
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions pkg/etcd/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,15 @@ func RunEtcdFromBackup(backupStore backup.Store, backupName string, basedir stri
return nil, fmt.Errorf("error restoring backup: %v", err)
}

binDir, err := BindirForEtcdVersion(backupInfo.EtcdVersion, "etcd")
etcdVersion := backupInfo.EtcdVersion
// A few known-safe restore-from-backup options
switch etcdVersion {
case "3.1.11":
glog.Warningf("restoring backup from etcd 3.1.11, will restore with 3.1.12")
etcdVersion = "3.1.12"
}

binDir, err := BindirForEtcdVersion(etcdVersion, "etcd")
if err != nil {
return nil, err
}
Expand All @@ -130,7 +138,7 @@ func RunEtcdFromBackup(backupStore backup.Store, backupName string, basedir stri
CreateNewCluster: true,
ForceNewCluster: true,
BinDir: binDir,
EtcdVersion: backupInfo.EtcdVersion,
EtcdVersion: etcdVersion,
DataDir: dataDir,
Cluster: &protoetcd.EtcdCluster{
ClusterToken: clusterToken,
Expand Down

0 comments on commit 5d315dc

Please sign in to comment.