Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions internal/store/cronjob.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ import (
"k8s.io/client-go/tools/cache"
basemetrics "k8s.io/component-base/metrics"

"k8s.io/klog/v2"

"k8s.io/kube-state-metrics/v2/pkg/metric"
generator "k8s.io/kube-state-metrics/v2/pkg/metric_generator"
)
Expand Down Expand Up @@ -251,8 +253,10 @@ func cronJobMetricFamilies(allowAnnotationsList, allowLabelsList []string) []gen
// If the cron job is suspended, don't track the next scheduled time
nextScheduledTime, err := getNextScheduledTime(j.Spec.Schedule, j.Status.LastScheduleTime, j.CreationTimestamp, j.Spec.TimeZone)
if err != nil {
panic(err)
} else if !*j.Spec.Suspend {
klog.Errorf("failed to compute next schedule time for cronjob %s/%s: %v", j.Namespace, j.Name, err)
Comment thread
aryanputta marked this conversation as resolved.
Outdated
return &metric.Family{Metrics: ms}
}
Comment thread
aryanputta marked this conversation as resolved.
if !*j.Spec.Suspend {
ms = append(ms, &metric.Metric{
Comment thread
aryanputta marked this conversation as resolved.
LabelKeys: []string{},
LabelValues: []string{},
Expand Down
Loading