From 27a3a49d1ea1f81d071a09d1cb6f47a41ef79d8b Mon Sep 17 00:00:00 2001 From: kinarashah Date: Fri, 9 Aug 2019 13:59:59 -0700 Subject: [PATCH] don't override tag of custom system images for defaultRKETools --- util/util.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/util/util.go b/util/util.go index f830a3d2..b472c719 100644 --- a/util/util.go +++ b/util/util.go @@ -2,12 +2,13 @@ package util import ( "fmt" - "github.com/rancher/rke/metadata" "net/url" "os" "reflect" "strings" + "github.com/rancher/rke/metadata" + "github.com/coreos/go-semver/semver" ref "github.com/docker/distribution/reference" "github.com/sirupsen/logrus" @@ -87,6 +88,10 @@ func IsFileExists(filePath string) (bool, error) { } func GetDefaultRKETools(image string) (string, error) { + // don't override tag of custom system images + if !strings.Contains(image, "rancher/rke-tools") { + return image, nil + } tag, err := GetImageTagFromImage(image) if err != nil || tag == "" { return "", fmt.Errorf("defaultRKETools: no tag %s", image)