From 02d8b4f107a57a2254de1c1056ff0676d0fd4fa1 Mon Sep 17 00:00:00 2001 From: "Christoph Engelbert (noctarius)" Date: Fri, 20 Nov 2026 09:51:59 +0100 Subject: [PATCH] The image check mirrored an allowlist the CRD dropped two weeks ago shape_images refused any image outside quay.io/simplyblock-io, docker.io/simplyblock and public.ecr.aws/simply-block, on the grounds that the CRD's pattern admitted only those three. Operator 41e55d6b ("fix(api): accept image references from any registry", #751, 2026-10-23) replaced that with a generic OCI reference pattern that takes any registry host. This copy was never updated. So the harness has been failing k8s bring-up for every image on registry.simplyblock.ai -- which is where ultra has been published since operator #223 on 2026-10-28 -- with a message asserting the apiserver would refuse a document it would in fact have accepted. It read as a product defect and was nearly filed as one. Mirror the current pattern from atlas-lib/crdtypes/image.go instead, and say so in the comment, so the next person checks the source before believing this. The check still earns its place: it names the offending variable, where the apiserver returns the regex with no value attached. It now rejects only what the CRD rejects -- an untagged reference, a malformed path. Ported to main from d413fd04c on feat/pnfs-e2e (SFAM-2849). Co-Authored-By: Claude Opus 5.5 --- e2e/scripts/k8s_cluster_bringup.py | 37 +++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/e2e/scripts/k8s_cluster_bringup.py b/e2e/scripts/k8s_cluster_bringup.py index ab0d24d204..37ca267162 100755 --- a/e2e/scripts/k8s_cluster_bringup.py +++ b/e2e/scripts/k8s_cluster_bringup.py @@ -650,12 +650,27 @@ def run_discovery(config_name: str, timeout: int) -> str: # ── step 2: edit the draft ─────────────────────────────────────────────── -#: Registries the CRD's ImageSpec pattern admits. Anything else is refused by -#: the apiserver with a message naming the regex rather than the value, so this -#: is checked here where the offending variable can be named. +#: Mirrors ImageReference in the operator's atlas-lib/crdtypes/image.go, the +#: kubebuilder pattern every image field in the CRDs is held to. The two must +#: move together: this exists only so a bad reference is named here, where the +#: offending variable can be printed, rather than coming back from the +#: apiserver as a regex with no value attached. +#: +#: It used to be an allowlist of three registries. Operator 41e55d6b +#: ("fix(api): accept image references from any registry", #751, 2026-10-23) +#: dropped that and took any registry host, but this copy was not updated, so +#: the harness went on refusing documents the apiserver would have accepted -- +#: every image on registry.simplyblock.ai, which is where ultra has been +#: published since 2026-10-28. A mirror that outlives the rule it mirrors +#: fails runs the product would have passed, so it has to name its source. _IMAGE_RE = re.compile( - r"^(quay\.io/simplyblock-io|docker\.io/simplyblock|public\.ecr\.aws/simply-block)" - r"/[a-z0-9][a-z0-9._-]*:[a-zA-Z0-9][a-zA-Z0-9._-]*(@sha256:[a-f0-9]{64})?$") + r"^($|(([a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?" + r"(\.[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?)*" + r"|\[[a-fA-F0-9:]+\])(:[0-9]+)?/)?" + r"[a-z0-9]+((\.|_|__|-+)[a-z0-9]+)*" + r"(/[a-z0-9]+((\.|_|__|-+)[a-z0-9]+)*)*" + r"(:[a-zA-Z0-9_][a-zA-Z0-9_.-]{0,127}(@sha256:[a-f0-9]{64})?" + r"|@sha256:[a-f0-9]{64}))$") def shape_images(spec: dict) -> None: @@ -691,12 +706,12 @@ def shape_images(spec: dict) -> None: bad = [f"{k}={v}" for k, v in named.items() if not _IMAGE_RE.match(v)] if bad: raise RuntimeError( - "these images name a registry the CRD does not admit, so the " - "document would be refused: " + ", ".join(bad) + ".\n" - " It takes quay.io/simplyblock-io, docker.io/simplyblock or " - "public.ecr.aws/simply-block, each with an explicit tag -- a bare " - "repository like simplyblock/spdk:main-latest is rejected, so the " - "registry has to be written out.") + "these are not well-formed image references, so the document " + "would be refused: " + ", ".join(bad) + ".\n" + " Any registry is accepted. What is required is a lowercase " + "repository path and a tag, a @sha256 digest, or both -- " + "registry.simplyblock.ai/ultra:main-61ff864a is fine, an " + "untagged simplyblock/spdk is not.") images = spec.setdefault("images", {}) for slot, ref in named.items():