Skip to content

Commit

Permalink
Fix issue with pulling image credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
JamieMagee committed Dec 1, 2023
1 parent 61c5794 commit 6710e50
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions internal/infra/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -489,11 +489,12 @@ func pullImage(ctx context.Context, cli *client.Client, image string) error {
log.Printf("Failed to find credentials for pulling image: %s\n.", image)
}

encodedAuth, err := privilegeFunc()
if err != nil {
return fmt.Errorf("failed to get credentials for %v: %w", image, err)
if privilegeFunc == nil {
return fmt.Errorf("failed to get credentials to pull image: %s", image)
}

encodedAuth, _ := privilegeFunc()

log.Printf("pulling image: %s\n", image)
out, err := cli.ImagePull(ctx, image, types.ImagePullOptions{
RegistryAuth: encodedAuth,
Expand Down

0 comments on commit 6710e50

Please sign in to comment.