Skip to content

Commit

Permalink
fix test issues
Browse files Browse the repository at this point in the history
Signed-off-by: Jorge Turrado <jorge.turrado@scrm.lidl>
  • Loading branch information
JorTurFer committed Sep 25, 2023
1 parent 5627851 commit 09e2fd9
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion pkg/scaling/scale_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,9 @@ func (h *scaleHandler) getScaledObjectState(ctx context.Context, scaledObject *k
for k, v := range result.Pairs {
metricTriggerPairList[k] = v
}
for k, v := range result.Records {
metricsRecord[k] = v
}
}

// invalidate the cache for the ScaledObject, if we hit an error in any scaler
Expand Down Expand Up @@ -665,7 +668,13 @@ func (*scaleHandler) processScaledObjectStateScaler(
logger logr.Logger,
scaledObject *kedav1alpha1.ScaledObject,
) ScaledObjectStateScalerResult {
result := ScaledObjectStateScalerResult{}
result := ScaledObjectStateScalerResult{
IsActive: false,
IsError: false,
Metrics: []external_metrics.ExternalMetricValue{},
Pairs: map[string]string{},
Records: map[string]metricscache.MetricsRecord{},
}

scalerName := strings.Replace(fmt.Sprintf("%T", scaler), "*scalers.", "", 1)
if scalerConfig.TriggerName != "" {
Expand Down

0 comments on commit 09e2fd9

Please sign in to comment.