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 @@ -28,13 +28,13 @@ import (
28
28
29
29
var (
30
30
// 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
38
38
39
39
// NameEscapingScheme defines the default way that names will be escaped when
40
40
// 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