diff --git a/pkg/skaffold/gcp/projectid.go b/pkg/skaffold/gcp/projectid.go index 19847a91b8a..9657d03bd34 100644 --- a/pkg/skaffold/gcp/projectid.go +++ b/pkg/skaffold/gcp/projectid.go @@ -32,7 +32,7 @@ func ExtractProjectID(imageName string) (string, error) { } registry := ref.Context().Registry.Name() - if registry == "gcr.io" || strings.HasSuffix(registry, ".gcr.io") { + if registry == "gcr.io" || strings.HasSuffix(registry, ".gcr.io") || strings.HasSuffix(registry, "-docker.pkg.dev") { parts := strings.Split(imageName, "/") if len(parts) >= 2 { return parts[1], nil diff --git a/pkg/skaffold/gcp/projectid_test.go b/pkg/skaffold/gcp/projectid_test.go index 02e4f83828c..f95717de0ca 100644 --- a/pkg/skaffold/gcp/projectid_test.go +++ b/pkg/skaffold/gcp/projectid_test.go @@ -39,6 +39,11 @@ func TestExtractProjectID(t *testing.T) { imageName: "gcr.io/project/image", expected: "project", }, + { + description: "us-east1-docker.pkg.dev", + imageName: "us-east1-docker.pkg.dev/project/yyy/go-hello-world:latest", + expected: "project", + }, { description: "docker hub", imageName: "project/image",