File tree Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,11 @@ import (
2222)
2323
2424func TestAlertValidate (t * testing.T ) {
25+ oldScheme := NameValidationScheme
26+ NameValidationScheme = LegacyValidation
27+ defer func () {
28+ NameValidationScheme = oldScheme
29+ }()
2530ts := time .Now ()
2631
2732cases := []struct {
Original file line number Diff line number Diff line change @@ -28,13 +28,13 @@ import (
2828
2929var (
3030// NameValidationScheme determines the method of name validation to be used by
31- // all calls to IsValidMetricName() and LabelName IsValid(). Setting UTF-8 mode
32- // in isolation from other components that don't support UTF-8 may result in
33- // bugs or other undefined behavior. This value is intended to be set by
34- // UTF-8-aware binaries as part of their startup. To avoid need for locking,
35- // this value should be set once, ideally in an init(), before multiple
36- // goroutines are started.
37- NameValidationScheme = LegacyValidation
31+ // all calls to IsValidMetricName() and LabelName IsValid(). Setting UTF-8
32+ // mode in isolation from other components that don't support UTF-8 may result
33+ // in bugs or other undefined behavior. This value can be set to
34+ // LegacyValidation during startup if a binary is not UTF-8-aware binaries. To
35+ // avoid need for locking, this value should be set once, ideally in an
36+ // init(), before multiple goroutines are started.
37+ NameValidationScheme = UTF8Validation
3838
3939// NameEscapingScheme defines the default way that names will be escaped when
4040// presented to systems that do not support UTF-8 names. If the Content-Type
You can’t perform that action at this time.
0 commit comments