Skip to content

Commit

Permalink
fix: provide auth when pulling images in the imager
Browse files Browse the repository at this point in the history
Use standard Docker/Podman auth methods plus `GITHUB_TOKEN`.

See #8363

Signed-off-by: Andrey Smirnov <[email protected]>
(cherry picked from commit 4575078)
  • Loading branch information
smira committed Mar 6, 2024
1 parent 4af77b5 commit 38b5aed
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/imager/profile/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import (
"os"
"path/filepath"

"github.com/google/go-containerregistry/pkg/authn"
"github.com/google/go-containerregistry/pkg/authn/github"
"github.com/google/go-containerregistry/pkg/crane"
v1 "github.com/google/go-containerregistry/pkg/v1"
"github.com/google/go-containerregistry/pkg/v1/layout"
Expand Down Expand Up @@ -264,6 +266,12 @@ func (c *ContainerAsset) Pull(ctx context.Context, arch string, printf func(stri
OS: "linux",
}),
crane.WithContext(ctx),
crane.WithAuthFromKeychain(
authn.NewMultiKeychain(
authn.DefaultKeychain,
github.Keychain,
),
),
}

if c.ForceInsecure {
Expand Down

0 comments on commit 38b5aed

Please sign in to comment.