Skip to content

Commit 8eddf3e

Browse files
authored
Merge pull request #34008 from def-/pr-mz-ghcr-1
mzcompose: Default to using GHCR mirror
2 parents c360b51 + e76d087 commit 8eddf3e

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

bin/ci-builder

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ print(hash.decode())
167167
cache_tag=cache-$flavor-$rust_version-$arch_go
168168

169169
image_registry="materialize"
170-
if is_truthy "${CI:-0}" || is_truthy "${MZ_GHCR:-0}"; then
170+
if is_truthy "${CI:-0}" || is_truthy "${MZ_GHCR:-1}"; then
171171
image_registry="ghcr.io/materializeinc/materialize"
172172
fi
173173

misc/python/materialize/cli/mzcompose.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,10 @@ def run(self, args: argparse.Namespace) -> None:
411411
composition.default_port(args.service)
412412

413413
image = service["image"].rsplit(":", 1)[0]
414+
ghcr_prefix = "ghcr.io/materializeinc/"
415+
if image.startswith(ghcr_prefix):
416+
image.removeprefix(ghcr_prefix)
417+
414418
if image == "materialize/materialized":
415419
deps = composition.repo.resolve_dependencies(
416420
[composition.repo.images["psql"]]

misc/python/materialize/mzbuild.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,7 +1183,7 @@ def __init__(
11831183
sanitizer: Sanitizer = Sanitizer.none,
11841184
image_registry: str = (
11851185
"ghcr.io/materializeinc/materialize"
1186-
if ui.env_is_truthy("CI") or ui.env_is_truthy("MZ_GHCR")
1186+
if ui.env_is_truthy("CI") or ui.env_is_truthy("MZ_GHCR", "1")
11871187
else "materialize"
11881188
),
11891189
image_prefix: str = "",
@@ -1289,7 +1289,7 @@ def install_arguments(parser: argparse.ArgumentParser) -> None:
12891289
"--image-registry",
12901290
default=(
12911291
"ghcr.io/materializeinc/materialize"
1292-
if ui.env_is_truthy("CI") or ui.env_is_truthy("MZ_GHCR")
1292+
if ui.env_is_truthy("CI") or ui.env_is_truthy("MZ_GHCR", "1")
12931293
else "materialize"
12941294
),
12951295
help="the Docker image registry to pull images from and push images to",

0 commit comments

Comments
 (0)