Skip to content

Commit 54a400d

Browse files
committed
address
1 parent b286be2 commit 54a400d

5 files changed

Lines changed: 7 additions & 7 deletions

File tree

disk/assets/configuration/spec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ files:
2727
Instruct the check to always add these patterns to `mount_point_blacklist`.
2828
value:
2929
example:
30-
- /proc/sys/fs/binfmt_misc$
30+
- (/host)?/proc/sys/fs/binfmt_misc$
3131
type: array
3232
items:
3333
type: string

disk/datadog_checks/disk/data/conf.yaml.default

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ init_config:
1717
## Instruct the check to always add these patterns to `mount_point_blacklist`.
1818
#
1919
# mount_point_global_blacklist:
20-
# - /proc/sys/fs/binfmt_misc$
20+
# - (/host)?/proc/sys/fs/binfmt_misc$
2121

2222
## Every instance is scheduled independent of the others.
2323
#

disk/datadog_checks/disk/disk.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,5 +441,5 @@ def get_default_mount_mount_blacklist():
441441
return [
442442
# https://github.com/DataDog/datadog-agent/issues/1961
443443
# https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-1049
444-
'/proc/sys/fs/binfmt_misc$'
444+
'(/host)?/proc/sys/fs/binfmt_misc$'
445445
]

disk/tests/test_filter.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def test_bad_config_string_regex():
3939
assert_regex_equal(c._device_whitelist, re.compile('test', IGNORE_CASE))
4040
assert_regex_equal(c._device_blacklist, re.compile('test', IGNORE_CASE))
4141
assert_regex_equal(c._mount_point_whitelist, re.compile('test', IGNORE_CASE))
42-
assert_regex_equal(c._mount_point_blacklist, re.compile('test|/proc/sys/fs/binfmt_misc$', IGNORE_CASE))
42+
assert_regex_equal(c._mount_point_blacklist, re.compile('test|(/host)?/proc/sys/fs/binfmt_misc$', IGNORE_CASE))
4343

4444

4545
def test_ignore_empty_regex():
@@ -58,7 +58,7 @@ def test_ignore_empty_regex():
5858
assert_regex_equal(c._device_whitelist, re.compile('test', IGNORE_CASE))
5959
assert_regex_equal(c._device_blacklist, re.compile('test', IGNORE_CASE))
6060
assert_regex_equal(c._mount_point_whitelist, re.compile('test', IGNORE_CASE))
61-
assert_regex_equal(c._mount_point_blacklist, re.compile('test|/proc/sys/fs/binfmt_misc$', IGNORE_CASE))
61+
assert_regex_equal(c._mount_point_blacklist, re.compile('test|(/host)?/proc/sys/fs/binfmt_misc$', IGNORE_CASE))
6262

6363

6464
def test_exclude_bad_devices():
@@ -191,7 +191,7 @@ def test_legacy_config():
191191

192192
assert_regex_equal(c._file_system_blacklist, re.compile('iso9660$|test$', re.I))
193193
assert_regex_equal(c._device_blacklist, re.compile('test1$|test2', IGNORE_CASE))
194-
assert_regex_equal(c._mount_point_blacklist, re.compile('/proc/sys/fs/binfmt_misc$|test', IGNORE_CASE))
194+
assert_regex_equal(c._mount_point_blacklist, re.compile('(/host)?/proc/sys/fs/binfmt_misc$|test', IGNORE_CASE))
195195

196196

197197
def test_legacy_exclude_disk():

disk/tests/test_unit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def test_default_options():
2727
assert check._device_whitelist is None
2828
assert check._device_blacklist is None
2929
assert check._mount_point_whitelist is None
30-
assert check._mount_point_blacklist == re.compile('/proc/sys/fs/binfmt_misc$', IGNORE_CASE)
30+
assert check._mount_point_blacklist == re.compile('(/host)?/proc/sys/fs/binfmt_misc$', IGNORE_CASE)
3131
assert check._tag_by_filesystem is False
3232
assert check._device_tag_re == []
3333
assert check._service_check_rw is False

0 commit comments

Comments
 (0)