ci(images): fail the controller self-check on an empty locked version
Build / build (pull_request) Successful in 33s
Lint / lint (pull_request) Successful in 3m25s
Molecule / molecule (pull_request) Canceled after 7m3s

The self-check reads the ansible-core and molecule versions from the
lock with sed; an empty result made the grep match any version. It now
fails the build instead.

Refs #477

Assisted-by: Claude Code
This commit is contained in:
Defame1297 committed 2026-11-29 17:34:17 +00:00
1 parent c3a7cef195
commit 56c5c6dd72
1 file changed
+2
+2
View File
@@ -115,8 +115,10 @@ RUN set -eu; \
sha256sum --quiet -c /opt/molecule-pins.sha256; \ sha256sum --quiet -c /opt/molecule-pins.sha256; \
python -c "import sys; assert '%d.%d' % sys.version_info[:2] == '${PYTHON_VERSION}', sys.version"; \ python -c "import sys; assert '%d.%d' % sys.version_info[:2] == '${PYTHON_VERSION}', sys.version"; \
core="$(sed -n 's/^ansible-core==\([^ ]*\).*/\1/p' requirements-molecule.lock)"; \ core="$(sed -n 's/^ansible-core==\([^ ]*\).*/\1/p' requirements-molecule.lock)"; \
test -n "$core"; \
ansible --version | head -n1 | grep -F "core ${core}]"; \ ansible --version | head -n1 | grep -F "core ${core}]"; \
mol="$(sed -n 's/^molecule==\([^ ]*\).*/\1/p' requirements-molecule.lock)"; \ mol="$(sed -n 's/^molecule==\([^ ]*\).*/\1/p' requirements-molecule.lock)"; \
test -n "$mol"; \
molecule --version | grep -F "molecule ${mol}"; \ molecule --version | grep -F "molecule ${mol}"; \
molecule drivers | grep -qw docker; \ molecule drivers | grep -qw docker; \
python -c "import docker"; \ python -c "import docker"; \