mirror of
https://github.com/rancher/os.git
synced 2025-08-10 02:58:15 +00:00
Merge pull request #832 from joshwget/local-upgrade-image
Only pull upgrade image if not found locally
This commit is contained in:
commit
e483ade336
@ -199,10 +199,18 @@ func startUpgradeContainer(image string, stage, force, reboot, kexec bool) error
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := container.Pull(); err != nil {
|
client, err := docker.NewSystemClient()
|
||||||
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Only pull image if not found locally
|
||||||
|
if _, err := client.InspectImage(image); err != nil {
|
||||||
|
if err := container.Pull(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if !stage {
|
if !stage {
|
||||||
fmt.Printf("Upgrading to %s\n", image)
|
fmt.Printf("Upgrading to %s\n", image)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user