Refactoring code for podman support #234
Draft
+199
−107
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Refactoring code to support Podman
Point of attention
TO DO
DockerUtils.py:
Mounts
attribute values. It causes Exegol to raise the errorapi.build/remove_volume
function to podman if needed: [FEATURE] - Implement "decode" parameter in pull() function and add build/remove_volume function as api/image.py in docker py containers/podman-py#456podman.from_env()
seems to return exit status0
even when podman service is down or uninstalled. It causes to produce AssertionError on Exegol when podman is down instead of running the right exception. Reported in a comment here: fix: Enhance environment connection error handling containers/podman-py#472 . Currently, it can be managed by usingclient.ping()
.ConstantConfig.IMAGE_NAME in [repo_tag.split(':')[0] for repo_tag in img.attrs.get("RepoTags", [])]:
does not manage well cases where user pulled manually exegol image containing also the registry name, for exampledocker.io/nwodtuhs/exegol
. In this scenario, it won't enter in if statement. It is needed to addany
to manage cases where locally I have more container images. [Fixed in PR]ExegolImage.py:
[FIXED]
As above, cannot enter in if statement in case user pulled manually an image by specifying
docker.io
. Need to usein
instead ofstartswith
. [Fixed in PR]Evaluate if it is needed to manage
if
statements involvingConstantConfig.IMAGE_NAME
in other files to manage the presence of prefixdocker.io
in the image name.[FIXED] ExegolController.py - Import
podman
and manageconsole.print_exception(show_locals=True, suppress=[docker, requests, git])
to consider podman module too.ConstantConfig.py:
Implement the samePodman should already manage mount. Just open this PR on podman py upstream Support uppercase mount attributes containers/podman-py#487from docker.types import Mount
for podman: [FEATURE] - Implement Mount type containers/podman-py#458