mirror of
https://github.com/rancher/os.git
synced 2025-08-16 05:54:51 +00:00
Warn if upgrading to the currently running version
This commit is contained in:
parent
e861ae65ca
commit
82ec567d52
@ -193,10 +193,15 @@ func startUpgradeContainer(image string, stage, force, reboot bool) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if !stage {
|
if !stage {
|
||||||
|
imageSplit := strings.Split(image, ":")
|
||||||
|
if len(imageSplit) > 1 && imageSplit[1] == config.VERSION {
|
||||||
|
if !force && !yes(in, fmt.Sprintf("Already at version %s. Continue anyways", imageSplit[1])) {
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
fmt.Printf("Upgrading to %s\n", image)
|
fmt.Printf("Upgrading to %s\n", image)
|
||||||
|
|
||||||
if !force {
|
if !force && !yes(in, "Continue") {
|
||||||
if !yes(in, "Continue") {
|
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user