Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
* [BUGFIX] Memberlist: Add `-memberlist.packet-read-timeout`, `-memberlist.max-packet-size`, and `-memberlist.max-concurrent-connections` flags to bound inbound gossip TCP connections, preventing slow-read, OOM, and connection-flood attacks on the gossip port. #7518
* [BUGFIX] Distributor: Add `WrappedHistogram` with configurable size limit (`-validation.max-native-histogram-size-bytes`, default 16 KB) to cap native histogram protobuf size before unmarshalling, preventing memory amplification attacks via packed varint deltas. #7570
* [BUGFIX] Distributor: Fix a panic (`slice bounds out of range`) in the stream push path when the context deadline expires while the worker goroutine is still marshalling a `WriteRequest`. #7541
* [BUGFIX] Config: Fix CSV-list flags/YAML fields (e.g. `-compactor.enabled-tenants`, `-compactor.disabled-tenants`) treating an explicitly empty string (`""`) as a one-element list containing an empty tenant name instead of an empty list. This caused every tenant to be skipped when `enabled_tenants: ""` was set in config, since only the (nonexistent) empty-string tenant matched the allow-list. #6581

## 1.21.0 2026-04-24

Expand Down
4 changes: 4 additions & 0 deletions pkg/util/flagext/stringslicecsv.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ func (v StringSliceCSV) String() string {

// Set implements flag.Value
func (v *StringSliceCSV) Set(s string) error {
if s == "" {
*v = nil
return nil
}
*v = strings.Split(s, ",")
return nil
}
Expand Down
18 changes: 18 additions & 0 deletions pkg/util/flagext/stringslicecsv_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,21 @@ func Test_StringSliceCSV(t *testing.T) {
assert.Nil(t, err)
assert.Equal(t, testStruct, testStruct2)
}

func Test_StringSliceCSV_Empty(t *testing.T) {
var v StringSliceCSV
assert.Nil(t, v.Set(""))
assert.Equal(t, []string(nil), []string(v))
assert.Len(t, v, 0)
}

func Test_StringSliceCSV_UnmarshalYAML_Empty(t *testing.T) {
type TestStruct struct {
CSV StringSliceCSV `yaml:"csv"`
}

var testStruct TestStruct
err := yaml.Unmarshal([]byte(`csv: ""`), &testStruct)
assert.Nil(t, err)
assert.Len(t, testStruct.CSV, 0)
}
Loading