diff --git a/deploy/Dockerfile b/deploy/Dockerfile index 12e21b9c84..6d0b58c36c 100644 --- a/deploy/Dockerfile +++ b/deploy/Dockerfile @@ -41,7 +41,7 @@ COPY . . # Then submit a PR with the changes to `go.mod`, `go.sum`, and `vendor`. # Get GCR credential helper -RUN go install github.com/GoogleCloudPlatform/docker-credential-gcr +RUN go install github.com/GoogleCloudPlatform/docker-credential-gcr/v2 # Get Amazon ECR credential helper RUN go install github.com/awslabs/amazon-ecr-credential-helper/ecr-login/cli/docker-credential-ecr-login diff --git a/go.mod b/go.mod index f819fb79f0..2d4e741c59 100644 --- a/go.mod +++ b/go.mod @@ -1,15 +1,10 @@ module github.com/GoogleContainerTools/kaniko -go 1.19 +go 1.21 require ( cloud.google.com/go/storage v1.38.0 github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.3.0 - // This docker-credential-gcr dependency version is actually the same as v2.1.8. - // See https://github.com/GoogleCloudPlatform/docker-credential-gcr/issues/128 - // To update run: go get github.com/GoogleCloudPlatform/docker-credential-gcr@ - // The version string is a side-effect of Go module version numbering rules. Functionality is otherwise unchanged. - github.com/GoogleCloudPlatform/docker-credential-gcr v1.5.1-0.20230328182921-62afb2723512 github.com/aws/aws-sdk-go-v2 v1.25.0 github.com/aws/aws-sdk-go-v2/config v1.27.0 github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.16.1 @@ -156,6 +151,7 @@ require ( github.com/Azure/azure-sdk-for-go v68.0.0+incompatible // indirect github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.2 // indirect github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.2 // indirect + github.com/GoogleCloudPlatform/docker-credential-gcr/v2 v2.1.22 // indirect github.com/Microsoft/hcsshim v0.11.0 // indirect github.com/aws/aws-sdk-go-v2/service/ecr v1.24.5 // indirect github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.21.5 // indirect diff --git a/go.sum b/go.sum index d72bdb0185..00ffe0aa2e 100644 --- a/go.sum +++ b/go.sum @@ -55,6 +55,8 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/GoogleCloudPlatform/docker-credential-gcr v1.5.1-0.20230328182921-62afb2723512 h1:cauzkEqKnOXwl0L5futNq6BbWWtIRPfJtwDDulac6A8= github.com/GoogleCloudPlatform/docker-credential-gcr v1.5.1-0.20230328182921-62afb2723512/go.mod h1:6u40niDQl1ufFtykax72lx+pcIO67AoUSu9ebOzdA8Q= +github.com/GoogleCloudPlatform/docker-credential-gcr/v2 v2.1.22 h1:HevuUpLsTedep2D6wnIp6AAJbVgP0BiVxaMt3HXeOyA= +github.com/GoogleCloudPlatform/docker-credential-gcr/v2 v2.1.22/go.mod h1:nzCpg7DFIIkQIZB3mdUPXVvqQ5f/GahA6xgWXTjnK7w= github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= diff --git a/tools/tools.go b/tools/tools.go index 3363abf4ca..700efce986 100644 --- a/tools/tools.go +++ b/tools/tools.go @@ -22,7 +22,7 @@ package tools // dependencies https://github.com/golang/go/issues/48332 // These are placeholder imports the make go mod include these tools in its dependency graph. import ( - _ "github.com/GoogleCloudPlatform/docker-credential-gcr" + _ "github.com/GoogleCloudPlatform/docker-credential-gcr/v2" _ "github.com/awslabs/amazon-ecr-credential-helper/ecr-login/cli/docker-credential-ecr-login" _ "github.com/chrismellard/docker-credential-acr-env" ) diff --git a/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/.gitignore b/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/.gitignore similarity index 100% rename from vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/.gitignore rename to vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/.gitignore diff --git a/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/.goreleaser.yml b/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/.goreleaser.yml similarity index 100% rename from vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/.goreleaser.yml rename to vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/.goreleaser.yml diff --git a/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/BUILD b/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/BUILD similarity index 98% rename from vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/BUILD rename to vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/BUILD index a0e0629609..6f501ccc9e 100644 --- a/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/BUILD +++ b/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/BUILD @@ -19,7 +19,7 @@ gazelle( go_library( name = "go_default_library", srcs = ["main.go"], - importpath = "github.com/GoogleCloudPlatform/docker-credential-gcr", + importpath = "github.com/GoogleCloudPlatform/docker-credential-gcr/v2", visibility = ["//visibility:private"], deps = [ "//cli:go_default_library", diff --git a/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/CONTRIBUTING.md b/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/CONTRIBUTING.md similarity index 100% rename from vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/CONTRIBUTING.md rename to vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/CONTRIBUTING.md diff --git a/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/LICENSE b/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/LICENSE similarity index 100% rename from vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/LICENSE rename to vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/LICENSE diff --git a/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/README.md b/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/README.md similarity index 98% rename from vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/README.md rename to vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/README.md index 6968b01ad6..a9c644de40 100644 --- a/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/README.md +++ b/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/README.md @@ -57,7 +57,7 @@ The program in this repository is written with the Go programming language and c You can download the source code, compile the binary, and put it in your `$GOPATH` with `go get`. ```shell -go get -u github.com/GoogleCloudPlatform/docker-credential-gcr +go get -u github.com/GoogleCloudPlatform/docker-credential-gcr/v2 ``` If `$GOPATH/bin` is in your system `$PATH`, this will also automatically install the compiled binary. You can confirm using `which docker-credential-gcr` and continue to the [section on Configuration and Usage](#configuration-and-usage). diff --git a/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/WORKSPACE b/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/WORKSPACE similarity index 100% rename from vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/WORKSPACE rename to vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/WORKSPACE diff --git a/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/auth/BUILD b/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/auth/BUILD similarity index 97% rename from vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/auth/BUILD rename to vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/auth/BUILD index 782f811d64..555188a828 100644 --- a/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/auth/BUILD +++ b/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/auth/BUILD @@ -3,7 +3,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", srcs = ["login.go"], - importpath = "github.com/GoogleCloudPlatform/docker-credential-gcr/auth", + importpath = "github.com/GoogleCloudPlatform/docker-credential-gcr/v2/auth", visibility = ["//visibility:public"], deps = [ "//config:go_default_library", diff --git a/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/auth/login.go b/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/auth/login.go similarity index 99% rename from vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/auth/login.go rename to vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/auth/login.go index 0391399ab6..e9b1ce1731 100644 --- a/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/auth/login.go +++ b/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/auth/login.go @@ -31,7 +31,7 @@ import ( "os" "strings" - "github.com/GoogleCloudPlatform/docker-credential-gcr/config" + "github.com/GoogleCloudPlatform/docker-credential-gcr/v2/config" "github.com/toqueteos/webbrowser" "golang.org/x/oauth2" ) diff --git a/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/cli/BUILD b/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/cli/BUILD similarity index 98% rename from vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/cli/BUILD rename to vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/cli/BUILD index 88ba650350..a79cd232cd 100644 --- a/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/cli/BUILD +++ b/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/cli/BUILD @@ -12,7 +12,7 @@ go_library( "gcr-logout.go", "version.go", ], - importpath = "github.com/GoogleCloudPlatform/docker-credential-gcr/cli", + importpath = "github.com/GoogleCloudPlatform/docker-credential-gcr/v2/cli", visibility = ["//visibility:public"], deps = [ "//auth:go_default_library", diff --git a/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/cli/clear.go b/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/cli/clear.go similarity index 95% rename from vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/cli/clear.go rename to vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/cli/clear.go index 30a6409563..e04f21517f 100644 --- a/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/cli/clear.go +++ b/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/cli/clear.go @@ -20,7 +20,7 @@ import ( "fmt" "os" - "github.com/GoogleCloudPlatform/docker-credential-gcr/store" + "github.com/GoogleCloudPlatform/docker-credential-gcr/v2/store" "github.com/google/subcommands" ) diff --git a/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/cli/common.go b/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/cli/common.go similarity index 100% rename from vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/cli/common.go rename to vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/cli/common.go diff --git a/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/cli/config.go b/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/cli/config.go similarity index 97% rename from vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/cli/config.go rename to vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/cli/config.go index fc7b1996b8..92c27d0131 100644 --- a/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/cli/config.go +++ b/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/cli/config.go @@ -22,7 +22,7 @@ import ( "os" "strings" - "github.com/GoogleCloudPlatform/docker-credential-gcr/config" + "github.com/GoogleCloudPlatform/docker-credential-gcr/v2/config" "github.com/google/subcommands" ) diff --git a/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/cli/configure-docker.go b/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/cli/configure-docker.go similarity index 98% rename from vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/cli/configure-docker.go rename to vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/cli/configure-docker.go index 25ddbf0fc2..114bad54f3 100644 --- a/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/cli/configure-docker.go +++ b/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/cli/configure-docker.go @@ -24,7 +24,7 @@ import ( "path/filepath" "strings" - "github.com/GoogleCloudPlatform/docker-credential-gcr/config" + "github.com/GoogleCloudPlatform/docker-credential-gcr/v2/config" cliconfig "github.com/docker/cli/cli/config" "github.com/docker/cli/cli/config/configfile" "github.com/google/subcommands" diff --git a/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/cli/dockerHelper.go b/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/cli/dockerHelper.go similarity index 92% rename from vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/cli/dockerHelper.go rename to vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/cli/dockerHelper.go index 9b39c25dea..cab34e1b67 100644 --- a/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/cli/dockerHelper.go +++ b/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/cli/dockerHelper.go @@ -20,9 +20,9 @@ import ( "fmt" "os" - "github.com/GoogleCloudPlatform/docker-credential-gcr/config" - "github.com/GoogleCloudPlatform/docker-credential-gcr/credhelper" - "github.com/GoogleCloudPlatform/docker-credential-gcr/store" + "github.com/GoogleCloudPlatform/docker-credential-gcr/v2/config" + "github.com/GoogleCloudPlatform/docker-credential-gcr/v2/credhelper" + "github.com/GoogleCloudPlatform/docker-credential-gcr/v2/store" "github.com/docker/docker-credential-helpers/credentials" "github.com/google/subcommands" ) diff --git a/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/cli/gcr-login.go b/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/cli/gcr-login.go similarity index 93% rename from vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/cli/gcr-login.go rename to vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/cli/gcr-login.go index 9966280f7c..87862c3c06 100644 --- a/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/cli/gcr-login.go +++ b/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/cli/gcr-login.go @@ -20,8 +20,8 @@ import ( "fmt" "os" - "github.com/GoogleCloudPlatform/docker-credential-gcr/auth" - "github.com/GoogleCloudPlatform/docker-credential-gcr/store" + "github.com/GoogleCloudPlatform/docker-credential-gcr/v2/auth" + "github.com/GoogleCloudPlatform/docker-credential-gcr/v2/store" "github.com/google/subcommands" ) diff --git a/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/cli/gcr-logout.go b/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/cli/gcr-logout.go similarity index 95% rename from vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/cli/gcr-logout.go rename to vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/cli/gcr-logout.go index f1b54609dd..7015efcd0a 100644 --- a/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/cli/gcr-logout.go +++ b/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/cli/gcr-logout.go @@ -20,7 +20,7 @@ import ( "fmt" "os" - "github.com/GoogleCloudPlatform/docker-credential-gcr/store" + "github.com/GoogleCloudPlatform/docker-credential-gcr/v2/store" "github.com/google/subcommands" ) diff --git a/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/cli/version.go b/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/cli/version.go similarity index 94% rename from vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/cli/version.go rename to vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/cli/version.go index 4f43e09208..1627e505e1 100644 --- a/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/cli/version.go +++ b/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/cli/version.go @@ -20,7 +20,7 @@ import ( "fmt" "os" - "github.com/GoogleCloudPlatform/docker-credential-gcr/config" + "github.com/GoogleCloudPlatform/docker-credential-gcr/v2/config" "github.com/google/subcommands" ) diff --git a/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/config/BUILD b/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/config/BUILD similarity index 96% rename from vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/config/BUILD rename to vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/config/BUILD index 4e9c5f570e..d670b2bb91 100644 --- a/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/config/BUILD +++ b/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/config/BUILD @@ -6,7 +6,7 @@ go_library( "const.go", "file.go", ], - importpath = "github.com/GoogleCloudPlatform/docker-credential-gcr/config", + importpath = "github.com/GoogleCloudPlatform/docker-credential-gcr/v2/config", visibility = ["//visibility:public"], deps = [ "//util:go_default_library", diff --git a/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/config/const.go b/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/config/const.go similarity index 87% rename from vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/config/const.go rename to vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/config/const.go index 0fee9b4dd3..f5c9ea9844 100644 --- a/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/config/const.go +++ b/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/config/const.go @@ -18,6 +18,7 @@ package config import ( "context" "fmt" + "regexp" "runtime/debug" "strings" @@ -37,16 +38,21 @@ const ( ) // Version can be set via: -// -ldflags="-X 'github.com/GoogleCloudPlatform/docker-credential-gcr/config.Version=$TAG'" +// -ldflags="-X 'github.com/GoogleCloudPlatform/docker-credential-gcr/v2/config.Version=$TAG'" var Version string func init() { if Version == "" { - i, ok := debug.ReadBuildInfo() - if !ok { - return + if i, ok := debug.ReadBuildInfo(); ok { + Version = i.Main.Version } - Version = i.Main.Version + } + Version = strings.TrimPrefix(Version, "v") + re := regexp.MustCompile(`^[0-9]+(?:[\._][0-9]+)*$`) + if re.MatchString(Version) { + GcrOAuth2Username = fmt.Sprintf("_dcgcr_%s_token", strings.ReplaceAll(Version, ".", "_")) + } else { + GcrOAuth2Username = "_dcgcr_0_0_0_token" } } @@ -63,6 +69,7 @@ var DefaultGCRRegistries = [...]string{ // Registry. If the --include-artifact-registry flag is supplied then these // are added in addition to the GCR Registries. var DefaultARRegistries = [...]string{ + "africa-south1-docker.pkg.dev", "asia-docker.pkg.dev", "asia-east1-docker.pkg.dev", "asia-east2-docker.pkg.dev", @@ -86,8 +93,11 @@ var DefaultARRegistries = [...]string{ "europe-west6-docker.pkg.dev", "europe-west8-docker.pkg.dev", "europe-west9-docker.pkg.dev", + "europe-west10-docker.pkg.dev", "europe-west12-docker.pkg.dev", "me-central1-docker.pkg.dev", + "me-central2-docker.pkg.dev", + "docker.me-central2.rep.pkg.dev", "me-west1-docker.pkg.dev", "northamerica-northeast1-docker.pkg.dev", "northamerica-northeast2-docker.pkg.dev", @@ -103,6 +113,7 @@ var DefaultARRegistries = [...]string{ "us-west2-docker.pkg.dev", "us-west3-docker.pkg.dev", "us-west4-docker.pkg.dev", + "us-west8-docker.pkg.dev", } // SupportedGCRTokenSources maps config keys to plain english explanations for @@ -124,4 +135,4 @@ var GCRScopes = []string{"https://www.googleapis.com/auth/devstorage.read_write" var OAuthHTTPContext = context.Background() // GcrOAuth2Username is the Basic auth username accompanying Docker requests to GCR. -var GcrOAuth2Username = fmt.Sprintf("_dcgcr_%s_token", strings.ReplaceAll(Version, ".", "_")) +var GcrOAuth2Username string diff --git a/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/config/file.go b/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/config/file.go similarity index 98% rename from vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/config/file.go rename to vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/config/file.go index 8ad24c117c..9987d9ecdd 100644 --- a/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/config/file.go +++ b/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/config/file.go @@ -21,7 +21,7 @@ import ( "path/filepath" "strings" - "github.com/GoogleCloudPlatform/docker-credential-gcr/util" + "github.com/GoogleCloudPlatform/docker-credential-gcr/v2/util" ) const ( diff --git a/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/credhelper/BUILD b/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/credhelper/BUILD similarity index 97% rename from vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/credhelper/BUILD rename to vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/credhelper/BUILD index a8a1cc683e..aaf4953927 100644 --- a/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/credhelper/BUILD +++ b/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/credhelper/BUILD @@ -3,7 +3,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", srcs = ["helper.go"], - importpath = "github.com/GoogleCloudPlatform/docker-credential-gcr/credhelper", + importpath = "github.com/GoogleCloudPlatform/docker-credential-gcr/v2/credhelper", visibility = ["//visibility:public"], deps = [ "//config:go_default_library", diff --git a/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/credhelper/helper.go b/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/credhelper/helper.go similarity index 81% rename from vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/credhelper/helper.go rename to vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/credhelper/helper.go index 957cb0da18..255adf4aa5 100644 --- a/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/credhelper/helper.go +++ b/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/credhelper/helper.go @@ -19,15 +19,19 @@ for GCR authentication. package credhelper import ( + "encoding/json" "errors" "fmt" + "os" "strings" - "github.com/GoogleCloudPlatform/docker-credential-gcr/config" - "github.com/GoogleCloudPlatform/docker-credential-gcr/store" - "github.com/GoogleCloudPlatform/docker-credential-gcr/util/cmd" + "github.com/GoogleCloudPlatform/docker-credential-gcr/v2/auth" + "github.com/GoogleCloudPlatform/docker-credential-gcr/v2/config" + "github.com/GoogleCloudPlatform/docker-credential-gcr/v2/store" + "github.com/GoogleCloudPlatform/docker-credential-gcr/v2/util/cmd" "github.com/docker/docker-credential-helpers/credentials" + "golang.org/x/oauth2" "golang.org/x/oauth2/google" ) @@ -82,7 +86,34 @@ func (ch *gcrCredHelper) Get(serverURL string) (string, string, error) { func (ch *gcrCredHelper) gcrCreds() (string, string, error) { accessToken, err := ch.getGCRAccessToken() if err != nil { - return "", "", helperErr("could not retrieve GCR's access token", err) + if rerr, ok := err.(*oauth2.RetrieveError); ok { + var resp struct { + Error string `json:"error"` + ErrorSubtype string `json:"error_subtype"` + } + if err := json.Unmarshal(rerr.Body, &resp); err == nil && + resp.Error == "invalid_grant" && + resp.ErrorSubtype == "invalid_rapt" { + fmt.Fprintln(os.Stderr, "Reauth required; opening a browser to proceed...") + tok, err := (&auth.GCRLoginAgent{}).PerformLogin() + if err != nil { + return "", "", fmt.Errorf("unable to authenticate user: %v", err) + } + if err = ch.store.SetGCRAuth(tok); err != nil { + return "", "", fmt.Errorf("unable to persist access token: %v", err) + } + fmt.Fprintln(os.Stderr, "Reauth successful!") + // Attempt the refresh dance again, using the new token. + if accessToken, err := ch.getGCRAccessToken(); err != nil { + return "", "", err + } else { + return config.GcrOAuth2Username, accessToken, nil + } + } + } + if err != nil { + return "", "", helperErr("could not retrieve GCR's access token", err) + } } return config.GcrOAuth2Username, accessToken, nil } diff --git a/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/main.go b/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/main.go similarity index 96% rename from vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/main.go rename to vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/main.go index 9d68761410..80398c589d 100644 --- a/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/main.go +++ b/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/main.go @@ -25,7 +25,7 @@ import ( "flag" "os" - "github.com/GoogleCloudPlatform/docker-credential-gcr/cli" + "github.com/GoogleCloudPlatform/docker-credential-gcr/v2/cli" "github.com/google/subcommands" ) diff --git a/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/store/BUILD b/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/store/BUILD similarity index 98% rename from vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/store/BUILD rename to vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/store/BUILD index ebd7772d6b..6a51d872ce 100644 --- a/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/store/BUILD +++ b/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/store/BUILD @@ -3,7 +3,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", srcs = ["store.go"], - importpath = "github.com/GoogleCloudPlatform/docker-credential-gcr/store", + importpath = "github.com/GoogleCloudPlatform/docker-credential-gcr/v2/store", visibility = ["//visibility:public"], deps = [ "//config:go_default_library", diff --git a/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/store/store.go b/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/store/store.go similarity index 97% rename from vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/store/store.go rename to vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/store/store.go index b768779d24..b6166f77f7 100644 --- a/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/store/store.go +++ b/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/store/store.go @@ -28,8 +28,8 @@ import ( "strings" "time" - "github.com/GoogleCloudPlatform/docker-credential-gcr/config" - "github.com/GoogleCloudPlatform/docker-credential-gcr/util" + "github.com/GoogleCloudPlatform/docker-credential-gcr/v2/config" + "github.com/GoogleCloudPlatform/docker-credential-gcr/v2/util" "github.com/docker/docker-credential-helpers/credentials" "golang.org/x/oauth2" "golang.org/x/oauth2/google" diff --git a/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/util/BUILD b/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/util/BUILD similarity index 93% rename from vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/util/BUILD rename to vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/util/BUILD index 2ef636d8d0..c052f0acee 100644 --- a/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/util/BUILD +++ b/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/util/BUILD @@ -3,6 +3,6 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library") go_library( name = "go_default_library", srcs = ["util.go"], - importpath = "github.com/GoogleCloudPlatform/docker-credential-gcr/util", + importpath = "github.com/GoogleCloudPlatform/docker-credential-gcr/v2/util", visibility = ["//visibility:public"], ) diff --git a/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/util/cmd/BUILD b/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/util/cmd/BUILD similarity index 91% rename from vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/util/cmd/BUILD rename to vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/util/cmd/BUILD index d28e523703..a9f6f119e2 100644 --- a/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/util/cmd/BUILD +++ b/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/util/cmd/BUILD @@ -3,6 +3,6 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library") go_library( name = "go_default_library", srcs = ["exec.go"], - importpath = "github.com/GoogleCloudPlatform/docker-credential-gcr/util/cmd", + importpath = "github.com/GoogleCloudPlatform/docker-credential-gcr/v2/util/cmd", visibility = ["//visibility:public"], ) diff --git a/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/util/cmd/exec.go b/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/util/cmd/exec.go similarity index 100% rename from vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/util/cmd/exec.go rename to vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/util/cmd/exec.go diff --git a/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/util/util.go b/vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/util/util.go similarity index 100% rename from vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/util/util.go rename to vendor/github.com/GoogleCloudPlatform/docker-credential-gcr/v2/util/util.go diff --git a/vendor/modules.txt b/vendor/modules.txt index 3734360d16..239530e175 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -105,16 +105,16 @@ github.com/Azure/go-autorest/logger # github.com/Azure/go-autorest/tracing v0.6.0 ## explicit; go 1.12 github.com/Azure/go-autorest/tracing -# github.com/GoogleCloudPlatform/docker-credential-gcr v1.5.1-0.20230328182921-62afb2723512 -## explicit; go 1.17 -github.com/GoogleCloudPlatform/docker-credential-gcr -github.com/GoogleCloudPlatform/docker-credential-gcr/auth -github.com/GoogleCloudPlatform/docker-credential-gcr/cli -github.com/GoogleCloudPlatform/docker-credential-gcr/config -github.com/GoogleCloudPlatform/docker-credential-gcr/credhelper -github.com/GoogleCloudPlatform/docker-credential-gcr/store -github.com/GoogleCloudPlatform/docker-credential-gcr/util -github.com/GoogleCloudPlatform/docker-credential-gcr/util/cmd +# github.com/GoogleCloudPlatform/docker-credential-gcr/v2 v2.1.22 +## explicit; go 1.21 +github.com/GoogleCloudPlatform/docker-credential-gcr/v2 +github.com/GoogleCloudPlatform/docker-credential-gcr/v2/auth +github.com/GoogleCloudPlatform/docker-credential-gcr/v2/cli +github.com/GoogleCloudPlatform/docker-credential-gcr/v2/config +github.com/GoogleCloudPlatform/docker-credential-gcr/v2/credhelper +github.com/GoogleCloudPlatform/docker-credential-gcr/v2/store +github.com/GoogleCloudPlatform/docker-credential-gcr/v2/util +github.com/GoogleCloudPlatform/docker-credential-gcr/v2/util/cmd # github.com/Microsoft/go-winio v0.6.1 ## explicit; go 1.17 github.com/Microsoft/go-winio