Skip to content

Fix: Properly format --build-arg values in Podman image build task #306

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

GSSparks
Copy link

@GSSparks GSSparks commented Apr 9, 2025

Summary: This PR fixes an issue in the Molecule playbook where Podman build arguments were not being separated by whitespace, causing command-line parsing errors when passing complex values (e.g. values containing --dns, environment substitutions, etc.).

Problem: The original extra_args Jinja2 block rendered build arguments like this:
--build-arg=FOO=BAR --dns=1.2.3.4--build-arg=BAR=baz
Because there were no spaces between build arguments generated in the loop, arguments would be concatenated incorrectly, breaking the podman build command.

Fix: The fix uses Ansible's zip_longest filter to format --build-arg=KEY=VALUE strings cleanly and space-separated. This ensures that each argument is properly delimited, even when values contain CLI-like content.

@github-actions github-actions bot added the bug Something isn't working label Apr 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant