1
0
mirror of https://github.com/rancher/os.git synced 2025-09-01 14:48:55 +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

@@ -121,7 +121,11 @@ func installAction(c *cli.Context) error {
image := c.String("image")
cfg := config.LoadConfig()
if image == "" {
image = cfg.Rancher.Upgrade.Image + ":" + config.Version + config.Suffix
image = fmt.Sprintf("%s:%s%s",
cfg.Rancher.Upgrade.Image,
config.Version,
config.Suffix)
image = formatImage(image, cfg)
}
installType := c.String("install-type")
@@ -202,7 +206,7 @@ func runInstall(image, installType, cloudConfig, device, partition, statedir, ka
}
// Versions before 0.8.0-rc3 use the old calling convention (from the lay-down-os shell script)
imageVersion := strings.TrimPrefix(image, "rancher/os:")
imageVersion := strings.Split(image, ":")[1]
if version.GreaterThan("v0.8.0-rc3", imageVersion) {
log.Infof("user specified to install pre v0.8.0: %s", image)
imageVersion = strings.Replace(imageVersion, "-", ".", -1)