소스 검색

builder: avoid unset credentials in containerd

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Tonis Tiigi 6 년 전
부모
커밋
effb2bd9d2
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 1
      builder/builder-next/adapters/containerimage/pull.go

+ 4 - 1
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)