Skip to content

Commit a499040

Browse files
authored
Pass the docker client connection to daemon (#1035)
Signed-off-by: Radoslav Dimitrov <[email protected]>
1 parent b9d67a7 commit a499040

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/container/images/registry.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ func getDefaultPlatform() *v1.Platform {
4444
}
4545

4646
// ImageExists checks if an image exists locally in the daemon or remotely in the registry
47-
func (*RegistryImageManager) ImageExists(_ context.Context, imageName string) (bool, error) {
47+
func (r *RegistryImageManager) ImageExists(_ context.Context, imageName string) (bool, error) {
4848
// Parse the image reference
4949
ref, err := name.ParseReference(imageName)
5050
if err != nil {
5151
return false, fmt.Errorf("failed to parse image reference %q: %w", imageName, err)
5252
}
5353

5454
// First check if image exists locally in daemon
55-
if _, err := daemon.Image(ref); err != nil {
55+
if _, err := daemon.Image(ref, daemon.WithClient(r.dockerClient)); err != nil {
5656
// Image does not exist locally
5757
return false, nil
5858
}
@@ -97,7 +97,7 @@ func (r *RegistryImageManager) PullImage(ctx context.Context, imageName string)
9797
}
9898

9999
// Save the image to the local daemon
100-
response, err := daemon.Write(tag, img)
100+
response, err := daemon.Write(tag, img, daemon.WithClient(r.dockerClient))
101101
if err != nil {
102102
return fmt.Errorf("failed to write image to daemon: %w", err)
103103
}

0 commit comments

Comments
 (0)