1
0
mirror of https://github.com/rancher/rke.git synced 2025-09-01 15:06:23 +00:00

Handle missing backups

This commit is contained in:
moelsayed
2019-02-27 07:34:54 +02:00
committed by Alena Prokharchyk
parent bc5c061527
commit 05d19122ac
3 changed files with 43 additions and 6 deletions

View File

@@ -7,13 +7,14 @@ import (
"strings"
"github.com/coreos/go-semver/semver"
"github.com/rancher/types/apis/management.cattle.io/v3"
v3 "github.com/rancher/types/apis/management.cattle.io/v3"
)
const (
WorkerThreads = 50
SupportedSyncToolsVersion = "0.1.22"
// this should be kept at the latest version of rke released with
// rancher 2.2.0.
SupportedSyncToolsVersion = "0.1.25"
)
func StrToSemVer(version string) (*semver.Version, error) {
@@ -115,6 +116,11 @@ func GetDefaultRKETools() string {
return v3.AllK8sVersions[v3.DefaultK8s].Alpine
}
// with rancher 2.2.0 and rke 0.2.0, etcdbackup was completely refactored
// and the interface for the rke-tools backup command changed significantly.
// This function is used to check the the release rke-tools version to choose
// between the new backup or the legacy backup code paths.
// The released version of rke-tools should be set in the const SupportedSyncToolsVersion
func IsRancherBackupSupported(image string) bool {
v := strings.Split(image, ":")
last := v[len(v)-1]