Merge branch 'release-1.2'
This commit is contained in:
commit
b2f28a9e82
|
@ -1019,6 +1019,9 @@ func (c *RelabelConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {
|
|||
if err := checkOverflow(c.XXX, "relabel_config"); err != nil {
|
||||
return err
|
||||
}
|
||||
if c.Regex.Regexp == nil {
|
||||
c.Regex = MustNewRegexp("")
|
||||
}
|
||||
if c.Modulus == 0 && c.Action == RelabelHashMod {
|
||||
return fmt.Errorf("relabel configuration for hashmod requires non-zero modulus")
|
||||
}
|
||||
|
|
|
@ -115,6 +115,12 @@ var expectedConf = &Config{
|
|||
Regex: DefaultRelabelConfig.Regex,
|
||||
Replacement: "static",
|
||||
Action: RelabelReplace,
|
||||
}, {
|
||||
TargetLabel: "abc",
|
||||
Separator: ";",
|
||||
Regex: MustNewRegexp(""),
|
||||
Replacement: "static",
|
||||
Action: RelabelReplace,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
@ -54,6 +54,9 @@ scrape_configs:
|
|||
target_label: cde
|
||||
- replacement: static
|
||||
target_label: abc
|
||||
- regex:
|
||||
replacement: static
|
||||
target_label: abc
|
||||
|
||||
bearer_token_file: valid_token_file
|
||||
|
||||
|
|
Loading…
Reference in New Issue