mirror of
https://github.com/rancher/rke.git
synced 2025-09-01 15:06:23 +00:00
Add correct env vars if etcd 3.3 is used
This commit is contained in:
committed by
Alena Prokharchyk
parent
471146b25c
commit
1127a90a9c
12
util/util.go
12
util/util.go
@@ -7,7 +7,9 @@ import (
|
||||
"strings"
|
||||
|
||||
"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 (
|
||||
@@ -113,3 +115,13 @@ func IsFileExists(filePath string) (bool, error) {
|
||||
return false, err
|
||||
}
|
||||
}
|
||||
|
||||
func GetImageTagFromImage(image string) (string, error) {
|
||||
parsedImage, err := ref.ParseNormalizedNamed(image)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
imageTag := parsedImage.(ref.Tagged).Tag()
|
||||
logrus.Debugf("Extracted version [%s] from image [%s]", imageTag, image)
|
||||
return imageTag, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user