From bff2df30ffee018f5532cf2b627bc55b7a59349b Mon Sep 17 00:00:00 2001 From: Bartosz Brodecki Date: Tue, 29 Oct 2024 13:42:18 +0100 Subject: [PATCH] fix: Adjusting to --- internal/store/broadcastjob.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/store/broadcastjob.go b/internal/store/broadcastjob.go index 9a26dc2..63e9741 100644 --- a/internal/store/broadcastjob.go +++ b/internal/store/broadcastjob.go @@ -217,10 +217,14 @@ func broadcastJobMetricFamilies(allowAnnotationsList, allowLabelsList []string) metric.Gauge, "", wrapBroadcastJobFunc(func(bj *v1alpha1.BroadcastJob) *metric.Family { + value := 0.0 + if bj != nil && bj.Spec.CompletionPolicy.ActiveDeadlineSeconds != nil { + value = float64(*bj.Spec.CompletionPolicy.ActiveDeadlineSeconds) + } return &metric.Family{ Metrics: []*metric.Metric{ { - Value: float64(*bj.Spec.CompletionPolicy.ActiveDeadlineSeconds), + Value: value, }, }, }