Skip to content

Commit 45834c5

Browse files
committed
fix mistake
1 parent 848c379 commit 45834c5

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

pkg/templates/deployment.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ func (a *PrometheusRuleTemplateManager) CreateFromDeployment(deployment *apps.De
6969

7070
prometheusRules := map[string]*monitoringv1.PrometheusRule{}
7171
annotations := params.Deployment.GetAnnotations()
72+
params.CustomLabels = extractCustomLabels(annotations)
73+
7274
for k, v := range annotations {
7375
if !strings.HasPrefix(k, heimPrefix) {
7476
continue
@@ -79,8 +81,6 @@ func (a *PrometheusRuleTemplateManager) CreateFromDeployment(deployment *apps.De
7981
continue
8082
}
8183

82-
params.CustomLabels = extractCustomLabels(annotations)
83-
8484
templateName := strings.TrimLeft(k, fmt.Sprintf("%s/", heimPrefix))
8585
logger.Infow("template selected", "template", templateName)
8686
template, ok := a.templates[templateName]

pkg/templates/ingress.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ func (a *PrometheusRuleTemplateManager) CreateFromIngress(ingress *networkingv1.
5151

5252
prometheusRules := map[string]*monitoringv1.PrometheusRule{}
5353
annotations := ingress.GetAnnotations()
54+
params.CustomLabels = extractCustomLabels(annotations)
5455

5556
for k, v := range annotations {
5657
if !strings.HasPrefix(k, heimPrefix) {
@@ -62,8 +63,6 @@ func (a *PrometheusRuleTemplateManager) CreateFromIngress(ingress *networkingv1.
6263
continue
6364
}
6465

65-
params.CustomLabels = extractCustomLabels(annotations)
66-
6766
templateName := strings.TrimLeft(k, fmt.Sprintf("%s/", heimPrefix))
6867
template, ok := a.templates[templateName]
6968
if !ok {

0 commit comments

Comments
 (0)