path.udev.data is not currently using the --path.rootfs prefix #3216
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.
Currently when running the docker img you need to explicitly set the path.udev.data flag or it will run in:
the non-mounted location
/run/udev/data
is searched by default, when instead it should look in${path.rootfs}/run/udev/data
if--path.rootfs
is set.This is confusing because this flag is basically compulsory and is not well documented and doesn't align with the plug and play behavior of /proc
and
/sys`.This PR suggests to prepend the
path.rootfs
to the udev data path.The drawback is that it might make setting
--path.udev.data
confusing if the user tries to already pass the prepended path like/host/run/udev/data
but the error log in this case becomes helpful.Testing
When running the current latest tag
docker run -d --net="host" --pid="host" -v "/:/host:ro,rslave" quay.io/prometheus/node-exporter:latest --path.rootfs=/host
When running the local image built from branch
docker run -d --net="host" --pid="host" -v "/:/host:ro,rslave" node_exporter_local --path.rootfs=/host