Skip to content

Commit a73e2c4

Browse files
authored
fix(diskstats): only fail on mutually exclusive when present (#3617)
#3603 introduced a subtle regression for existing configs where device-exclude was intentionally set to `=''` to clear the Linux default. This breaks configs that are valid (exclude is intentionally cleared). Update the mutual exclusivity check to only fail when the value is non-empty. Signed-off-by: winston <me@winstondurand.com>
1 parent a1b9b3b commit a73e2c4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

collector/diskstats_common.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ func newDiskstatsDeviceFilter(logger *slog.Logger) (deviceFilter, error) {
100100
}
101101
}
102102
if *diskstatsDeviceInclude != "" {
103-
if diskstatsDeviceExcludeSet {
103+
if diskstatsDeviceExcludeSet && *diskstatsDeviceExclude != "" {
104104
return deviceFilter{}, errors.New("device-exclude & device-include are mutually exclusive")
105105
}
106106
*diskstatsDeviceExclude = ""

0 commit comments

Comments
 (0)