fix(image): no single quote in a label (kaniko rejects it) and a check for it
Molecule / molecule (pull_request) Skipped
Build / build (pull_request) Successful in 11s
Lint / lint (pull_request) Successful in 13s

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 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
This commit is contained in:
Defame1297andClaude Sonnet 5.5 committed 2026-10-26 19:44:12 +00:00
1 parent c5c98bb543
commit 6c85d61827
4 files changed
+8 -2

No files matched your search

+1 -1
View File
@@ -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
+1 -1
View File
@@ -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" \
+4
View File
@@ -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()
@@ -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")