1
0
mirror of https://github.com/rancher/os.git synced 2025-07-24 19:46:47 +00:00

Only pull upgrade image if not found locally

This commit is contained in:
Josh Curl 2016-03-28 11:27:27 -07:00
parent 529e7dab06
commit b965a2c0e3

View File

@ -199,10 +199,18 @@ func startUpgradeContainer(image string, stage, force, reboot, kexec bool) error
return err
}
if err := container.Pull(); err != nil {
client, err := docker.NewSystemClient()
if err != nil {
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 {
fmt.Printf("Upgrading to %s\n", image)