1
0
mirror of https://github.com/rancher/os.git synced 2025-09-04 16:21:07 +00:00

Config ROS image prefix for install and all rancher/os services (#2272)

This commit is contained in:
niusmallnan
2018-03-06 18:07:21 +08:00
committed by GitHub
parent d263be4bae
commit f6a76a10ae
4 changed files with 29 additions and 3 deletions

View File

@@ -6,6 +6,7 @@ import (
"os"
"strings"
"github.com/rancher/os/config"
"github.com/rancher/os/log"
)
@@ -19,3 +20,11 @@ func yes(question string) bool {
return strings.ToLower(line[0:1]) == "y"
}
func formatImage(image string, cfg *config.CloudConfig) string {
domainRegistry := cfg.Rancher.Environment["REGISTRY_DOMAIN"]
if domainRegistry != "docker.io" && domainRegistry != "" {
return fmt.Sprintf("%s/%s", domainRegistry, image)
}
return image
}