From 3f9ac8b89a5bd2d6cce259b674b8188054b16811 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Mon, 19 Oct 2020 16:18:33 -0700 Subject: [PATCH] Fix local images not being pulled correctly; closes #2559 --- CHANGELOG.md | 4 ++++ environment/docker/container.go | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a058b66..9973091 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ ### Fixed * Fixed a few docker clients not having version negotiation enabled. +## v1.0.1 +### Fixed +* Fixes local images prefixed with `~` getting pulled from remote sources rather than just using the local copy. + ## v1.0.0 This is the first official stable release of Wings! Please be aware that while this specific version changelog is very short, it technically includes all of the previous beta and alpha releases within it. For the sake of version history and following diff --git a/environment/docker/container.go b/environment/docker/container.go index 8d60efd..61c18aa 100644 --- a/environment/docker/container.go +++ b/environment/docker/container.go @@ -310,12 +310,15 @@ func (e *Environment) followOutput() error { // need to block all of the servers from booting just because of that. I'd imagine in a lot of // cases an outage shouldn't affect users too badly. It'll at least keep existing servers working // correctly if anything. -// -// TODO: local images func (e *Environment) ensureImageExists(image string) error { e.Events().Publish(environment.DockerImagePullStarted, "") defer e.Events().Publish(environment.DockerImagePullCompleted, "") + // Images prefixed with a ~ are local images that we do not need to try and pull. + if strings.HasPrefix(image, "~") { + return nil + } + // Give it up to 15 minutes to pull the image. I think this should cover 99.8% of cases where an // image pull might fail. I can't imagine it will ever take more than 15 minutes to fully pull // an image. Let me know when I am inevitably wrong here...