Merge branch 'release-1.2'

This commit is contained in:
beorn7 2016-11-03 14:42:15 +01:00
commit b2f28a9e82
3 changed files with 12 additions and 0 deletions

View File

@ -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")
}

View File

@ -115,6 +115,12 @@ var expectedConf = &Config{
Regex: DefaultRelabelConfig.Regex,
Replacement: "static",
Action: RelabelReplace,
}, {
TargetLabel: "abc",
Separator: ";",
Regex: MustNewRegexp(""),
Replacement: "static",
Action: RelabelReplace,
},
},
},

View File

@ -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