Skip to content
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

enh(docker::local): Make compatible with Podman containers #5223

Closed
wants to merge 1 commit into from

Conversation

jensrudolf
Copy link

@jensrudolf jensrudolf commented Oct 8, 2024

Community contributors

Description

Modify the cloud::docker::local::plugin to be compatible with Podman container engine.

Podman uses two whitespaces at minimum to seperate its cli output colums whereas Docker uses three. This reduces the required whichtespaces in the regex filter of the command output accordingly.

Type of change

  • Patch fixing an issue (non-breaking change)
  • New functionality (non-breaking change)
  • Functionality enhancement or optimization (non-breaking change)
  • Breaking change (patch or feature) that might cause side effects breaking part of the Software

How this pull request can be tested ?

Tested locally on RHEL8 with Icinga, Podman and Docker containers.

Checklist

  • I have followed the coding style guidelines provided by Centreon
  • I have commented my code, especially hard-to-understand areas of the PR.
  • I have rebased my development branch on the base branch (develop).
  • I have provide data or shown output displaying the result of this code in the plugin area concerned.

Modify the cloud::docker::local::plugin to be compatible with Podman container engine.

Podman uses two whitespaces at minimum to seperate its cli output colums whereas Docker uses three. This reduces the required whichtespaces in the regex filter of the command output accordingly.
@jensrudolf jensrudolf requested a review from a team as a code owner October 8, 2024 12:36
@jensrudolf jensrudolf requested a review from Evan-Adam October 8, 2024 12:36
@jensrudolf jensrudolf changed the title Develop Make cloud::docker::local compatible with Podman containers Oct 8, 2024
@jensrudolf jensrudolf changed the title Make cloud::docker::local compatible with Podman containers enh(docker::local): Make compatible with Podman containers Oct 9, 2024
@lucie-dubrunfaut
Copy link
Contributor

Hello :)

Thank you for your contribution. We plan to work very soon on a dedicated Podman plugin (you can vote on the idea related in TheWatch). We would be delighted to discuss your specific requirements for a Podman connector with you in more detail.

@jensrudolf
Copy link
Author

Hi Lucie,

thanks for your reply, A dedicated Podman plugin sounds fantastic. Currently, we only monitor whether containers are running or not. This is already possible with this docker plugin if you provide a softlink docker -> podman and apply the patch in this MR to adapt the regex for the number of whitespaces podman uses to separate its output.

Another approach might be to replace the docker plugin with a more generic container plugin that supports both docker and podman via CLI or the REST API preferably with the local socket so the Docker/Podman API does not have to be exposed outside the monitored host.

What do you think?

BR
Jens

@lucie-dubrunfaut
Copy link
Contributor

Hello @jensrudolf :)

We'll try to take your suggestion into account, but I think that the Docker and Podman packs will be separated for maintenance reasons in the future if there's too much divergence between them. However, we have planned a common code base (as in the case of the snmp_standard plugin, which is called in a large number of plugins).
About protocols, for the time being our development team will address the need for a Podman RestAPI plugin. It will be possible to adapt Cli afterwards (our plugins are designed to manage several protocols, generally via custom modes) but this is not planned for the time being (however, you can help us prioritise this need by creating a TheWatch idea on the subject).

Best regards.

@lucie-dubrunfaut
Copy link
Contributor

Hello :)

We just released the new podman plugin with this PR #5427
Feel free to test it and give us feedbacks about it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants