-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Include the patch containerd/containerd#10917 See siderolabs/talos#9594 Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
- Loading branch information
Showing
3 changed files
with
45 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
See https://github.com/containerd/containerd/pull/10917 | ||
|
||
From 11b1353c12b9f3a1542ffe44a00a988e330f8c56 Mon Sep 17 00:00:00 2001 | ||
From: Andrey Smirnov <andrey.smirnov@siderolabs.com> | ||
Date: Tue, 29 Oct 2024 20:42:02 +0400 | ||
Subject: [PATCH] fix: set the credentials even if not provided | ||
|
||
Fixes #10916 | ||
|
||
Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com> | ||
--- | ||
internal/cri/server/images/image_pull.go | 14 ++++++++++++++ | ||
1 file changed, 14 insertions(+) | ||
|
||
diff --git a/internal/cri/server/images/image_pull.go b/internal/cri/server/images/image_pull.go | ||
index e59b88b4f248..de8445932a11 100644 | ||
--- a/internal/cri/server/images/image_pull.go | ||
+++ b/internal/cri/server/images/image_pull.go | ||
@@ -133,6 +133,20 @@ func (c *CRIImageService) PullImage(ctx context.Context, name string, credential | ||
defer inProgressImagePulls.Dec() | ||
startTime := time.Now() | ||
|
||
+ if credentials == nil { | ||
+ credentials = func(host string) (string, string, error) { | ||
+ var hostauth *runtime.AuthConfig | ||
+ | ||
+ config := c.config.Registry.Configs[host] | ||
+ if config.Auth != nil { | ||
+ hostauth = toRuntimeAuthConfig(*config.Auth) | ||
+ | ||
+ } | ||
+ | ||
+ return ParseAuth(hostauth, host) | ||
+ } | ||
+ } | ||
+ | ||
namedRef, err := distribution.ParseDockerRef(name) | ||
if err != nil { | ||
return "", fmt.Errorf("failed to parse image reference %q: %w", name, err) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters