From 14f13495af2d807e1a528fdfcc34719cfbadcc08 Mon Sep 17 00:00:00 2001 From: Arjun Naik Date: Thu, 4 Apr 2019 10:22:25 +0200 Subject: [PATCH] Fix nil dereference panics Signed-off-by: Arjun Naik --- pkg/collector/collector.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/collector/collector.go b/pkg/collector/collector.go index 7f992e2..a7a7e01 100644 --- a/pkg/collector/collector.go +++ b/pkg/collector/collector.go @@ -174,7 +174,7 @@ func ParseHPAMetrics(hpa *autoscalingv2.HorizontalPodAutoscaler) ([]*MetricConfi // TODO: validate that the specified metric names are defined // in the HPA - var parser annotations.AnnotationConfigMap + parser := make(annotations.AnnotationConfigMap) err := parser.Parse(hpa.Annotations) if err != nil { return nil, err