diff --git a/dev/sg/internal/images/gcr.go b/dev/sg/internal/images/gcr.go index 60ae438892f7..ba65079bd6e0 100644 --- a/dev/sg/internal/images/gcr.go +++ b/dev/sg/internal/images/gcr.go @@ -9,6 +9,7 @@ import ( "strings" "github.com/opencontainers/go-digest" + "github.com/sourcegraph/sourcegraph/lib/errors" ) @@ -38,9 +39,8 @@ func (r *GCR) Org() string { } // Public returns if the registry is used for public purposes or not. -// Right now, we never use GCR for public releases, so it's always false. func (r *GCR) Public() bool { - return false + return r.Org() == "sourcegraph-public-images" } // LoadToken gets the access-token to reach GCR through the environment. @@ -76,7 +76,6 @@ func (r *GCR) fetchDigest(repo string, tag string) (digest.Digest, error) { return "", err } return g, nil - } // GetByTag returns a container repository, on that registry, for a given service at diff --git a/dev/sg/sg_ops.go b/dev/sg/sg_ops.go index 2799bd8d3691..5274060e7dda 100644 --- a/dev/sg/sg_ops.go +++ b/dev/sg/sg_ops.go @@ -56,8 +56,8 @@ var OpsUpdateImagesCommand = &cli.Command{ &cli.StringFlag{ Name: "registry", Usage: `Sets the registry we want images to update to. If you specify "public" or "internal" as a value it will use: - - docker.io (public) - - us.gcr.io (internal) + - us-docker.pkg.dev/sourcegraph-public-images/sourcegraph-public-images (public) + - us.gcr.io/sourcegraph-dev (internal) Alternatively, you can provide a custom registry of the format '/'. `, Value: "public", @@ -194,7 +194,7 @@ func opsUpdateImages( } registry = gcr case "public": - registry = images.NewDockerHub("sourcegraph", dockerUsername, dockerPassword) + registry = images.NewGCR("us-docker.pkg.dev", "sourcegraph-public-images/sourcegraph-public-images") default: parts := strings.SplitN(registryType, "/", 2) if len(parts) < 2 {