1
0
mirror of https://github.com/rancher/rke.git synced 2025-08-31 14:36:32 +00:00

don't override tag of custom system images for defaultRKETools

This commit is contained in:
kinarashah
2019-08-09 13:59:59 -07:00
parent 0b89560832
commit 27a3a49d1e

View File

@@ -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)