-
Notifications
You must be signed in to change notification settings - Fork 57
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
error: The argument '--prepend_sudo <prepend_sudo>' requires a value but none was supplied #99
Comments
Just bumped into this. |
The README.md change is this PR #93 However, that is only the comment / documentation fix to address a previous change in behaviour. I think that this was back in this PR #83 It was documented as a breaking change as well. The specific change that impacted the use of
The use of This appears to be the clap library - https://docs.rs/clap/2.33.0/clap/index.html While I've written some Rust - I'm not an expert. There may be a way to recode this to permit an optional value vs. forcing the use of a value - but it seems clear from the doc that |
I'm having this same issue with trying to start a container. |
Just run the container with that argument like this: docker run -d --net=host --cap-add=NET_ADMIN mindflavor/prometheus-wireguard-exporter -a true |
How would I do this via a docker-compose? The following doesn't seem to work. ---
version: '3'
services:
wg_metrics:
image: mindflavor/prometheus-wireguard-exporter
container_name: wg_metrics
environment:
TZ: 'America/Los_Angeles'
EXPORT_LATEST_HANDSHAKE_DELAY: 'true'
PROMETHEUS_WIREGUARD_EXPORTER_CONFIG_FILE_NAMES: '/etc/wireguard/wg0.conf'
PROMETHEUS_WIREGUARD_EXPORTER_PREPEND_SUDO_ENABLED: 'true'
cap_add:
- NET_ADMIN
network_mode: host
``` |
Try this: version: '3'
services:
wg_metrics:
image: mindflavor/prometheus-wireguard-exporter
container_name: wg_metrics
command: -a true
cap_add:
- NET_ADMIN
network_mode: host |
Thanks @hatamiarash7 that works! @MindFlavor Could the above be added to the readme as an example of using |
While the workaround is useful (fixed it for me!), I still think it's a bug that it seems to ignore the environment variable and only work when a command is specified. |
This should either be resolved so no initial |
Previously reported in #89
I suspect that was closed because the original issue was dealt with - but this same issue was called out.
The Dockerfile has this line https://github.com/MindFlavor/prometheus_wireguard_exporter/blob/master/Dockerfile#L133
Which appears to make
-a
the default command line. Unfortunately - the-a
command line is invalid - it requires a parameter which is exactly the error that is being shown.Reproduce this using
granted, that's not a useful invocation of the container - but it does show the problem.
Adding a command line option fixes this
Alternatively - any valid command line will fix this
I suspect all active installations are using some version of the command line flags .. so they don't run into this default behaviour
Should be easy to fix by modifying the Dockerfile
The text was updated successfully, but these errors were encountered: