Skip to content

Commit

Permalink
Bump go-containerregistry, pick up new features (sigstore#1442)
Browse files Browse the repository at this point in the history
- pick up google.Keychain log spam improvements when Google auth is not
  configured
- add github.Keychain which uses $GITHUB_TOKEN to auth to ghcr.io, if
  set

Signed-off-by: Jason Hall <jasonhall@redhat.com>
  • Loading branch information
imjasonh authored and mlieberman85 committed May 6, 2022
1 parent 46e497e commit e448f18
Show file tree
Hide file tree
Showing 3 changed files with 256 additions and 12 deletions.
2 changes: 2 additions & 0 deletions cmd/cosign/cli/options/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"github.com/awslabs/amazon-ecr-credential-helper/ecr-login/api"
"github.com/chrismellard/docker-credential-acr-env/pkg/credhelper"
"github.com/google/go-containerregistry/pkg/authn"
"github.com/google/go-containerregistry/pkg/authn/github"
"github.com/google/go-containerregistry/pkg/name"
"github.com/google/go-containerregistry/pkg/v1/google"
"github.com/google/go-containerregistry/pkg/v1/remote"
Expand Down Expand Up @@ -77,6 +78,7 @@ func (o *RegistryOptions) GetRegistryClientOpts(ctx context.Context) []remote.Op
google.Keychain,
authn.NewKeychainFromHelper(ecr.ECRHelper{ClientFactory: api.DefaultClientFactory{}}),
authn.NewKeychainFromHelper(credhelper.NewACRCredentialsHelper()),
github.Keychain,
)
opts = append(opts, remote.WithAuthFromKeychain(kc))
} else {
Expand Down
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ require (
github.com/go-piv/piv-go v1.9.0
github.com/google/certificate-transparency-go v1.1.2
github.com/google/go-cmp v0.5.7
github.com/google/go-containerregistry v0.8.1-0.20220125170349-50dfc2733d10
github.com/google/go-containerregistry v0.8.1-0.20220209165246-a44adc326839
github.com/google/go-containerregistry/pkg/authn/k8schain v0.0.0-20220125170349-50dfc2733d10
github.com/google/go-github/v42 v42.0.0
github.com/google/trillian v1.4.0
Expand Down Expand Up @@ -56,7 +56,6 @@ require (
github.com/urfave/cli v1.22.5 // indirect
go.opentelemetry.io/contrib v1.3.0 // indirect
go.opentelemetry.io/proto/otlp v0.12.0 // indirect
golang.org/x/net v0.0.0-20220121210141-e204ce36a2ba // indirect
k8s.io/kube-openapi v0.0.0-20220124234850-424119656bbf // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
)

0 comments on commit e448f18

Please sign in to comment.