containers / prometheus-podman-exporter

Prometheus exporter for podman environments exposing containers, pods, images, volumes and networks information.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Flag `--version` require conmon to be installed

mjtrangoni opened this issue · comments

Describe the bug
The flag --version can't be used in a CI as it needs the conmon utility to be available, and it seems that we are not exposing any conmon information at this stage.

To Reproduce
Steps to reproduce the behavior:

Compile the program and try to use the flag --version

$ ./bin/prometheus-podman-exporter --version
2022/10/11 12:11:59 could not find a working conmon binary (configured options: [/usr/libexec/podman/conmon /usr/local/libexec/podman/conmon /usr/local/lib/podman/conmon /usr/bin/conmon /usr/sbin/conmon /usr/local/bin/conmon /usr/local/sbin/conmon /run/current-system/sw/bin/conmon]): invalid argument

Expected behavior

$ bin/prometheus-podman-exporter --version
prometheus-podman-exporter (version=1.2.0, branch=main, revision=dev.1)

Additional context
Building inside of a rockylinux:8 container image, without conmon installed.

Hi @mjtrangoni
Thanks for this. #45 will fix the issue.

@navidys a nit here, --version works without conmon now, but the return code is still not 0.

# /home/trangoni/podman_exporter --version ; echo $?
prometheus-podman-exporter (version=1.2.0, branch=release-v1.2, revision=1)
1