ThePorgs / Exegol

Fully featured and community-driven hacking environment
https://exegol.readthedocs.io/
GNU General Public License v3.0
1.95k stars 191 forks source link

Refactoring code for podman support #234

Open D3vil0p3r opened 4 weeks ago

D3vil0p3r commented 4 weeks ago

Description

Refactoring code to support Podman

Point of attention

TO DO

Dramelac commented 3 weeks ago

Hello

Thanks for this PR, it is indeed a more complete approach to integrate podman in a stable way in Exegol. A few comments:

Thanks in any case for your help with this integration, there will be a lot of testing to do to make sure everything is compatible with podman and exegol before officially integrating it into the project, but it's certainly a very good starting point.

D3vil0p3r commented 3 weeks ago

I'll try to give answer

  • for the filter, you should test whether “docker.io/” would not be necessary in the current version of the lib.

Already tried, it is not an issue related to the input string, but an issue at code level. And I wouldn't suggest to add docker.io on IMAGE_NAME constant. I would keep it as is because docker does not add that registry name, and adding it could break some if statements.

  • the way DockerUtils tries to load docker or podman doesn't seem right to me, as the original exceptions are caught in the __connect_to_[...] function and therefore never retrieved by the __handle_connection_error function

It can be changed. I did that proposal but I'm sure there are better ways to explore. PS: in the future DockerUtils can be renamed as ContainerUtils.

  • your branch is not up to date with the dev version (which should soon be a new release), there are conflicts to manage

Probably because in the last days Exegol devs submitted new commits after the time I opened my PR. We can manage them once the PR is ready.

  • is the fact that the podman lib is the same as the docker lib done on purpose? aren't there risks of divergence at times?

Not all functions are the same. The risk of divergence depends on how we will adapt podman on Exegol. On this PR we are not using Docker Py functions to manage podman daemon, but we are invoking original Podman Py libs to manage its daemon.

Overall, before to continue to work on this PR, I think we need to wait for those issues/PRs I opened on Podman Py project.