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:
@@ -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)
|
||||
|
Reference in New Issue
Block a user