File tree 2 files changed +12
-7
lines changed
2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,11 @@ import (
22
22
)
23
23
24
24
func TestAlertValidate (t * testing.T ) {
25
+ oldScheme := NameValidationScheme
26
+ NameValidationScheme = LegacyValidation
27
+ defer func () {
28
+ NameValidationScheme = oldScheme
29
+ }()
25
30
ts := time .Now ()
26
31
27
32
cases := []struct {
Original file line number Diff line number Diff line change @@ -27,13 +27,13 @@ import (
27
27
28
28
var (
29
29
// NameValidationScheme determines the method of name validation to be used by
30
- // all calls to IsValidMetricName() and LabelName IsValid(). Setting UTF-8 mode
31
- // in isolation from other components that don't support UTF-8 may result in
32
- // bugs or other undefined behavior. This value is intended to be set by
33
- // UTF-8-aware binaries as part of their startup. To avoid need for locking,
34
- // this value should be set once, ideally in an init(), before multiple
35
- // goroutines are started.
36
- NameValidationScheme = LegacyValidation
30
+ // all calls to IsValidMetricName() and LabelName IsValid(). Setting UTF-8
31
+ // mode in isolation from other components that don't support UTF-8 may result
32
+ // in bugs or other undefined behavior. This value can be set to
33
+ // LegacyValidation during startup if a binary is not UTF-8-aware binaries. To
34
+ // avoid need for locking, this value should be set once, ideally in an
35
+ // init(), before multiple goroutines are started.
36
+ NameValidationScheme = UTF8Validation
37
37
38
38
// NameEscapingScheme defines the default way that names will be escaped when
39
39
// 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