mirror of
https://github.com/rancher/rke.git
synced 2025-09-01 06:56:29 +00:00
don't override tag of custom system images for defaultRKETools
This commit is contained in:
@@ -2,12 +2,13 @@ package util
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/rancher/rke/metadata"
|
|
||||||
"net/url"
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
"reflect"
|
"reflect"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/rancher/rke/metadata"
|
||||||
|
|
||||||
"github.com/coreos/go-semver/semver"
|
"github.com/coreos/go-semver/semver"
|
||||||
ref "github.com/docker/distribution/reference"
|
ref "github.com/docker/distribution/reference"
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
@@ -87,6 +88,10 @@ func IsFileExists(filePath string) (bool, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func GetDefaultRKETools(image string) (string, 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)
|
tag, err := GetImageTagFromImage(image)
|
||||||
if err != nil || tag == "" {
|
if err != nil || tag == "" {
|
||||||
return "", fmt.Errorf("defaultRKETools: no tag %s", image)
|
return "", fmt.Errorf("defaultRKETools: no tag %s", image)
|
||||||
|
Reference in New Issue
Block a user