From 54654abf3a00213382f1be1d430e38a4458e4ab3 Mon Sep 17 00:00:00 2001 From: Tonis Tiigi Date: Mon, 19 Nov 2018 17:40:08 -0800 Subject: [PATCH] builder: avoid unset credentials in containerd Signed-off-by: Tonis Tiigi (cherry picked from commit effb2bd9d23cc05305c4772338b9eb39423e92c6) Upstream-commit: 0d17f4099496ba3de583273eeebefa3cce4694ca Component: engine --- .../builder/builder-next/adapters/containerimage/pull.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/engine/builder/builder-next/adapters/containerimage/pull.go b/components/engine/builder/builder-next/adapters/containerimage/pull.go index f6e55f4b6b..b1e44d95e9 100644 --- a/components/engine/builder/builder-next/adapters/containerimage/pull.go +++ b/components/engine/builder/builder-next/adapters/containerimage/pull.go @@ -88,7 +88,10 @@ func (is *imageSource) getResolver(ctx context.Context, rfn resolver.ResolveOpti func (is *imageSource) getCredentialsFromSession(ctx context.Context) func(string) (string, string, error) { id := session.FromContext(ctx) if id == "" { - return nil + // can be removed after containerd/containerd#2812 + return func(string) (string, string, error) { + return "", "", nil + } } return func(host string) (string, string, error) { timeoutCtx, cancel := context.WithTimeout(context.Background(), 5*time.Second)