Skip to content

Commit bb97d40

Browse files
committed
fix: Admission Webhook blocks ScaledObject without metricType with fallback
Signed-off-by: rickbrouwer <[email protected]>
1 parent 720ae0e commit bb97d40

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ To learn more about active deprecations, we recommend checking [GitHub Discussio
7272

7373
### Fixes
7474

75-
- TODO ([#XXX](https://github.com/kedacore/keda/issues/XXX))
75+
- **General**: fix: Admission Webhook blocks ScaledObject without metricType with fallback([#6696] (https://github.com/kedacore/keda/issues/6696))
7676

7777
### Deprecations
7878

apis/keda/v1alpha1/scaledobject_types.go

+7-2
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,13 @@ func CheckFallbackValid(scaledObject *ScaledObject) error {
305305
if trigger.Type == cpuString || trigger.Type == memoryString {
306306
continue
307307
}
308-
// If at least one trigger is of the type `AverageValue`, then having fallback is valid.
309-
if trigger.MetricType == autoscalingv2.AverageValueMetricType {
308+
309+
effectiveMetricType := trigger.MetricType
310+
if effectiveMetricType == "" {
311+
effectiveMetricType = autoscalingv2.AverageValueMetricType
312+
}
313+
314+
if effectiveMetricType == autoscalingv2.AverageValueMetricType {
310315
fallbackValid = true
311316
break
312317
}

0 commit comments

Comments
 (0)