1
0
mirror of https://github.com/rancher/os.git synced 2025-09-01 14:48:55 +00:00

Merge pull request #832 from joshwget/local-upgrade-image

Only pull upgrade image if not found locally
This commit is contained in:
Darren Shepherd
2016-03-31 11:45:30 -07:00

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)