Merge pull request #2511 from prometheus/fix-go-build

Only truncate buildVersion if it's set
This commit is contained in:
Fabian Reinartz 2017-03-20 08:46:57 +01:00 committed by GitHub
commit 0958c83d5d
1 changed files with 1 additions and 1 deletions

View File

@ -425,7 +425,7 @@ func tmplFuncs(consolesPath string, opts *Options) template_text.FuncMap {
}, },
"consolesPath": func() string { return consolesPath }, "consolesPath": func() string { return consolesPath },
"pathPrefix": func() string { return opts.ExternalURL.Path }, "pathPrefix": func() string { return opts.ExternalURL.Path },
"buildVersion": func() string { return opts.Version.Revision[:7] }, "buildVersion": func() string { return opts.Version.Revision },
"stripLabels": func(lset model.LabelSet, labels ...model.LabelName) model.LabelSet { "stripLabels": func(lset model.LabelSet, labels ...model.LabelName) model.LabelSet {
for _, ln := range labels { for _, ln := range labels {
delete(lset, ln) delete(lset, ln)