Pass PROC_ROOT as environment variable to ss#7095
Conversation
Codecov Report
|
`ss` can use a non-standard procfs location thanks to the `PROC_ROOT` environment variable. This is useful when the agent runs inside a container where the host procfs is mounted in `/host/proc`. See https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/tree/misc/ss.c#n474
56286cb to
1101fad
Compare
e82a509 to
73898f7
Compare
73898f7 to
a691bf1
Compare
olivielpeau
left a comment
There was a problem hiding this comment.
@AlexandreYang made relevant comments, overall the logic looks good to me 👍
94514b3 to
2290772
Compare
…naic/network_check_on_containers
493d2cf to
5c864e4
Compare
There was a problem hiding this comment.
Last 2 things:
1/ Any reason the label is changelog/Changed (will trigger a major version bump, breaking changes) instead of changelog/Added (will trigger a minor version bump, enhancements) ?
Same comment for #7479 it's not too late to change since the base is not released yet.
We follow semver for versionning.
2/ We need to release datadog_checks_base, I can help for that, but we need to address 1/ first.
Once done, we need to update
integrations-core/network/setup.py
Line 29 in 7270935
to CHECKS_BASE_REQ = 'datadog_checks_base>=XXX' to the newly released version.
This helps preventing people installing network check (agent integration install datadog-network...) on older agents that doesn't support passing env to get_subprocess_output.
PROC_ROOT to ssPROC_ROOT as environment variable to ss
What does this PR do?
Pass the
PROC_ROOTenvironment variable tossMotivation
When the agent is running inside a container, the host
procfsis mounted under/host/procAdditional Notes
Here is how
ssuses an alternate path forprocfs:https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/tree/misc/ss.c#n474
This PR requires DataDog/datadog-agent#5987 to support the extra
envparameter passed to_util.subprocess_output.Review checklist (to be filled by reviewers)
changelog/andintegration/labels attached