From 6c85d61827eac932c81055a5cc9e144c03a6e0d3 Mon Sep 17 00:00:00 2001 From: Defame1297 Date: Mon, 26 Oct 2026 19:44:12 +0000 Subject: [PATCH] fix(image): no single quote in a label (kaniko rejects it) and a check for it Run 2556: the ci image failed at its LABEL step (unexpected end of statement while looking for matching single-quote) on the apostrophe in 'the distribution's python3'. Docker accepts it, kaniko's own LABEL parser does not, and the molecule images built only because their labels have none. The label text is reworded and check_image_versions.py pins now fails on a single quote in any label. ci 0.2.6 was never pushed; the gate wants a higher version than main's, so the fix is 0.2.7. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm --- .gitea/workflows/image.yml | 2 +- images/ci/Dockerfile | 2 +- scripts/check_image_versions.py | 4 ++++ tests/scripts/test_check_image_versions.py | 2 ++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/image.yml b/.gitea/workflows/image.yml index 4614f7c..d34bfdf 100644 --- a/.gitea/workflows/image.yml +++ b/.gitea/workflows/image.yml @@ -86,7 +86,7 @@ jobs: dockerfile: Dockerfile job_image: ubuntu:26.04@sha256:c098726dd9b9733f3e885f8de0ef375206a311b0a317eadc40d347b1115fb944 - name: ci - version: 0.2.6 + version: 0.2.7 subpath: "" dockerfile: images/ci/Dockerfile job_image: ubuntu:26.04@sha256:c098726dd9b9733f3e885f8de0ef375206a311b0a317eadc40d347b1115fb944 diff --git a/images/ci/Dockerfile b/images/ci/Dockerfile index 4269966..31182cb 100644 --- a/images/ci/Dockerfile +++ b/images/ci/Dockerfile @@ -115,7 +115,7 @@ RUN set -eu; \ FROM os AS final LABEL org.opencontainers.image.title="ci" \ - org.opencontainers.image.description="CI tooling image for the mortis.kamino Ansible Collection: the Lint and Build workflows run in it, so a job only checks out the code and runs. It bakes in ansible-core, ansible-lint, pre-commit with every hook environment of the repository, antsibull-changelog, galaxy-importer, reuse, git, shellcheck, Python 3.11 and 3.13 next to the distribution's python3 and primed ansible-test sanity virtualenvs. Use it as a job container pinned by tag and digest; it has no Node, so clone with git." \ + org.opencontainers.image.description="CI tooling image for the mortis.kamino Ansible Collection: the Lint and Build workflows run in it, so a job only checks out the code and runs. It bakes in ansible-core, ansible-lint, pre-commit with every hook environment of the repository, antsibull-changelog, galaxy-importer, reuse, git, shellcheck, Python 3.11 and 3.13 next to the distribution python3 and primed ansible-test sanity virtualenvs. Use it as a job container pinned by tag and digest; it has no Node, so clone with git." \ org.opencontainers.image.source="https://git.rkdr.net/mortis/kamino" \ org.opencontainers.image.url="https://git.rkdr.net/mortis/kamino" \ org.opencontainers.image.documentation="https://git.rkdr.net/mortis/kamino/src/branch/main/docs/images/ci.md" \ diff --git a/scripts/check_image_versions.py b/scripts/check_image_versions.py index 8f1e61d..a2e1749 100644 --- a/scripts/check_image_versions.py +++ b/scripts/check_image_versions.py @@ -441,6 +441,10 @@ def check_image_metadata(matrix, read_file, size_of): missing = [key for key in REQUIRED_LABELS if not labels.get(key, "").strip()] if missing: errors.append(f"image '{name}': the last stage of {path} lacks the label(s) {', '.join(missing)}") + quoted = sorted(key for key, value in labels.items() if "'" in value) + if quoted: + errors.append(f"image '{name}': the label(s) {', '.join(quoted)} contain a single quote, which kaniko's " + "LABEL parser rejects (run 2556); reword the text") doc = f"docs/images/{name}.md" source = labels.get("org.opencontainers.image.source", "").strip() link = labels.get("org.opencontainers.image.documentation", "").strip() diff --git a/tests/scripts/test_check_image_versions.py b/tests/scripts/test_check_image_versions.py index 0ad00c5..165b5d7 100644 --- a/tests/scripts/test_check_image_versions.py +++ b/tests/scripts/test_check_image_versions.py @@ -311,6 +311,8 @@ class PureTest(unittest.TestCase): self.assertIn("documentation label must be", check()[0]) files["images/ci/Dockerfile"] = labelled("renamed") self.assertTrue(any("expected the image name" in e for e in check())) + files["images/ci/Dockerfile"] = labelled("ci").replace('net.rkdr.mortis.usage="x"', 'net.rkdr.mortis.usage="the distribution\'s tool"') + self.assertIn("contain a single quote", check()[0]) files["images/ci/Dockerfile"] = labelled("ci").replace('base.name="ubuntu:24.04"', 'base.name="ubuntu:22.04"') self.assertIn("base.name label 'ubuntu:22.04' differs", check()[0]) files["images/ci/Dockerfile"] = labelled("ci")