mirror of
https://github.com/rancher/rke.git
synced 2025-09-02 07:24:20 +00:00
always use DefaultRKETools for etcd snapshot
This commit is contained in:
committed by
Alena Prokharchyk
parent
bc09408581
commit
1a1080a234
34
util/util.go
34
util/util.go
@@ -8,15 +8,13 @@ import (
|
||||
|
||||
"github.com/coreos/go-semver/semver"
|
||||
ref "github.com/docker/distribution/reference"
|
||||
v3 "github.com/rancher/types/apis/management.cattle.io/v3"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
const (
|
||||
WorkerThreads = 50
|
||||
// SupportedSyncToolsVersion this should be kept at the latest version of rke released with
|
||||
// rancher 2.2.0.
|
||||
SupportedSyncToolsVersion = "0.1.25"
|
||||
|
||||
DefaultRKETools = "rancher/rke-tools:v0.1.30"
|
||||
)
|
||||
|
||||
func StrToSemVer(version string) (*semver.Version, error) {
|
||||
@@ -70,34 +68,6 @@ func IsSymlink(file string) (bool, error) {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
func GetDefaultRKETools() string {
|
||||
return v3.AllK8sVersions[v3.DefaultK8s].Alpine
|
||||
}
|
||||
|
||||
// IsRancherBackupSupported 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]
|
||||
|
||||
sv, err := StrToSemVer(last)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
supported, err := StrToSemVer(SupportedSyncToolsVersion)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
if sv.LessThan(*supported) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func GetTagMajorVersion(tag string) string {
|
||||
splitTag := strings.Split(tag, ".")
|
||||
if len(splitTag) < 2 {
|
||||
|
Reference in New Issue
Block a user