Skip to content

Commit

Permalink
Add GCP credential provider
Browse files Browse the repository at this point in the history
This was originally added in #540 but removed in #560. The GCP credential provider from
github.com/vdemeester/k8s-pkg-credentialprovider/gcp would loop forever when the metadata
server could not be reached (see kubernetes/kubernetes#86245).

However it appears that the GGCR re-implementation in github.com/google/go-containerregistry/pkg/v1/google
doesn't suffer from this problem, and therefore support for GCP might be safe to add back.

Signed-off-by: Natalie Arellano <[email protected]>
  • Loading branch information
natalieparellano committed Jul 26, 2022
1 parent 81da253 commit 3869725
Show file tree
Hide file tree
Showing 3 changed files with 148 additions and 32 deletions.
2 changes: 2 additions & 0 deletions auth/keychain.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/chrismellard/docker-credential-acr-env/pkg/credhelper"
"github.com/google/go-containerregistry/pkg/authn"
"github.com/google/go-containerregistry/pkg/name"
"github.com/google/go-containerregistry/pkg/v1/google"
"github.com/pkg/errors"
)

Expand All @@ -38,6 +39,7 @@ func DefaultKeychain(images ...string) (authn.Keychain, error) {
NewResolvedKeychain(authn.DefaultKeychain, images...),
NewResolvedKeychain(amazonKeychain, images...),
NewResolvedKeychain(azureKeychain, images...),
NewResolvedKeychain(google.Keychain, images...),
), nil
}

Expand Down
27 changes: 16 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
module github.com/buildpacks/lifecycle

require (
github.com/BurntSushi/toml v1.1.0
github.com/BurntSushi/toml v1.2.0
github.com/apex/log v1.9.0
github.com/awslabs/amazon-ecr-credential-helper/ecr-login v0.0.0-20220706184558-ce46abcd012b
github.com/awslabs/amazon-ecr-credential-helper/ecr-login v0.0.0-20220722192216-ed618c2c4e43
github.com/buildpacks/imgutil v0.0.0-20220719152357-7e8f958d617a
github.com/chrismellard/docker-credential-acr-env v0.0.0-20220327082430-c57b701bfc08
github.com/docker/docker v20.10.17+incompatible
github.com/golang/mock v1.6.0
github.com/google/go-cmp v0.5.8
github.com/google/go-containerregistry v0.10.0
github.com/google/go-containerregistry v0.11.0
github.com/heroku/color v0.0.6
github.com/pkg/errors v0.9.1
github.com/sclevine/spec v1.4.0
golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f
)

require (
cloud.google.com/go/compute v1.7.0 // indirect
github.com/Azure/azure-sdk-for-go v66.0.0+incompatible // indirect
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
github.com/Azure/go-autorest/autorest v0.11.27 // indirect
github.com/Azure/go-autorest/autorest/adal v0.9.20 // indirect
github.com/Azure/go-autorest/autorest v0.11.28 // indirect
github.com/Azure/go-autorest/autorest/adal v0.9.21 // indirect
github.com/Azure/go-autorest/autorest/azure/auth v0.5.11 // indirect
github.com/Azure/go-autorest/autorest/azure/cli v0.4.5 // indirect
github.com/Azure/go-autorest/autorest/azure/cli v0.4.6 // indirect
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
github.com/Azure/go-autorest/logger v0.2.1 // indirect
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
Expand All @@ -51,8 +52,9 @@ require (
github.com/docker/go-units v0.4.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v4 v4.4.2 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/klauspost/compress v1.15.8 // indirect
github.com/klauspost/compress v1.15.9 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
Expand All @@ -62,8 +64,11 @@ require (
github.com/opencontainers/image-spec v1.0.3-0.20220114050600-8b9d41f48198 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/vbatts/tar-split v0.11.2 // indirect
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d // indirect
golang.org/x/net v0.0.0-20220708220712-1185a9018129 // indirect
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa // indirect
golang.org/x/net v0.0.0-20220725212005-46097bf591d3 // indirect
golang.org/x/oauth2 v0.0.0-20220722155238-128564f6959c // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.28.0 // indirect
)

go 1.17
Expand Down
Loading

0 comments on commit 3869725

Please sign in to comment.