Merge pull request 'fix(image): no single quote in a label (kaniko rejects it) and a check for it' (#41) from fix/image-label-apostrophe into main
Build / build (push) Successful in 10s
Images / image (Dockerfile, ubuntu:24.04@sha256:68ee22004a9109b44973313b02ff7b1de250f1de0f5ecb628d73f579aaff33ac, molecule-ubuntu2404, images/molecule-ubuntu2404, 0.1.3) (push) Successful in 10s
Lint / lint (push) Successful in 12s
Images / image (Dockerfile, ubuntu:26.04@sha256:c098726dd9b9733f3e885f8de0ef375206a311b0a317eadc40d347b1115fb944, molecule-ubuntu2604, images/molecule-ubuntu2604, 0.1.1) (push) Successful in 10s
Images / image (images/ci/Dockerfile, ubuntu:26.04@sha256:c098726dd9b9733f3e885f8de0ef375206a311b0a317eadc40d347b1115fb944, ci, , 0.2.7) (push) Successful in 3m8s

Reviewed-on: #41
This commit was merged in pull request #41.
This commit is contained in:
Defame1297 committed 2026-10-26 19:45:35 +00:00
commit f37f448e12
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")