From d5e17554f4919a68f2f4fd17820d794859feaf4c Mon Sep 17 00:00:00 2001 From: Ray Tien Date: Mon, 22 Dec 2025 21:36:55 +0800 Subject: [PATCH] fix(filesystem): add comma separator in mountOptionsString mountOptionsString was concatenating options without commas, breaking readonly dete Signed-off-by: Ray Tien --- collector/filesystem_linux.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/collector/filesystem_linux.go b/collector/filesystem_linux.go index 3739f0fe..0a3055f3 100644 --- a/collector/filesystem_linux.go +++ b/collector/filesystem_linux.go @@ -16,7 +16,6 @@ package collector import ( - "bytes" "errors" "fmt" "log/slog" @@ -237,13 +236,13 @@ func isFilesystemReadOnly(labels filesystemLabels) bool { } func mountOptionsString(m map[string]string) string { - b := new(bytes.Buffer) + var parts []string for key, value := range m { if value == "" { - fmt.Fprintf(b, "%s", key) + parts = append(parts, key) } else { - fmt.Fprintf(b, "%s=%s", key, value) + parts = append(parts, key+"="+value) } } - return b.String() + return strings.Join(parts, ",") }