fix panic when use cpu/memory and other scaler together
@@ -88,6 +88,10 @@ func (p *KedaProvider) GetExternalMetric(namespace string, metricSelector labels
scalerName := strings.Replace(fmt.Sprintf("%T", scaler), "*scalers.", "", 1)
for _, metricSpec := range metricSpecs {
+ //skip cpu/memory resource scaler
+ if metricSpec.External == nil {
+ continue
+ }
// Filter only the desired metric
if strings.EqualFold(metricSpec.External.Metric.Name, info.Metric) {
metrics, err := scaler.GetMetrics(context.TODO(), info.Metric, metricSelector)
