-
Notifications
You must be signed in to change notification settings - Fork 74
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
Pass extra args to podman run and ansible run #278
Conversation
I can definitely see that this might be useful in some cases 🙂 Looks good to me! One little request that will help other users out: It would be really awesome if you could quickly document these new options in the configuration documentation. 🙂 (this is what is shown on the documentation website). |
Co-authored-by: Richard H <rafmagns-skepa-dreag@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a great addition for the definition in yaml.
+1 @themkat's comment
also please include at least a single test case for both podman run and buildah run
self.build_parser.add_argument( | ||
"--extra-buildah-run-args", | ||
help="arguments passed to buildah run command (be careful!)" | ||
) | ||
self.build_parser.add_argument( | ||
"--extra-podman-run-args", | ||
help="arguments passed to podman run command (be careful!)" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm afraid this won't work as:
- some translation would have to be done: turn a string into list of strings
- the arguments would need to be escaped somehow so ansible-bender CLI won't interpret them actually
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please let me know if the CLI interface actually worked for you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't actually tried the CLI interface, but I tried to follow the format of how --extra-ansible-args
worked, going from a single string to a list of strings using shlex.split(). I'm not sure of the specifics around escaping, but these new flags should behave the same way as existing ones. I'll add some tests, try out the cli, and let you know.
@TomasTomecek Sorry for the delay on this. I added a test to ensure the yaml config works correctly as well as one to make sure the extra arguments were getting split correctly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finally getting back to this since I returned from my vacation. Thank you for taking the time to finish this!
@themkat are you okay with merging? :)
@TomasTomecek Looks good to me 🙂 Had an extra overview just now. Extra tests and documentation are awesome! 🙂 |
Thanks @TomasTomecek and @themkat! Let me know if you'd like me to squash the commits before merge. |
Looks good, thank you so much @ArmaanT! |
This PR adds two new options so that users can pass additional arguments to
buildah run
andpodman run
commands.cc @rafmagns-skepa-dreag