From de402ac2c57660fe0e0d537206cc0c723fd3452c Mon Sep 17 00:00:00 2001 From: Yifan Gu Date: Wed, 24 Aug 2016 12:23:55 -0700 Subject: [PATCH] rkt: Force `rkt fetch` to fetch from remote to conform the fetch policy. --- pkg/kubelet/rkt/image.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/kubelet/rkt/image.go b/pkg/kubelet/rkt/image.go index 2b96ce5cc23..5487a07f6fb 100644 --- a/pkg/kubelet/rkt/image.go +++ b/pkg/kubelet/rkt/image.go @@ -76,7 +76,10 @@ func (r *Runtime) PullImage(image kubecontainer.ImageSpec, pullSecrets []api.Sec return err } - if _, err := r.cli.RunCommand(&config, "fetch", dockerPrefix+img); err != nil { + // Today, `--no-store` will fetch the remote image regardless of whether the content of the image + // has changed or not. This causes performance downgrades when the image tag is ':latest' and + // the image pull policy is 'always'. The issue is tracked in https://github.com/coreos/rkt/issues/2937. + if _, err := r.cli.RunCommand(&config, "fetch", "--no-store", dockerPrefix+img); err != nil { glog.Errorf("Failed to fetch: %v", err) return err }