File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed
Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff 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 ]
Original file line number Diff line number Diff 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 {
You can’t perform that action at this time.
0 commit comments