Skip to content

Commit 3bf0f67

Browse files
prakarsh-dtkartik-579jatin-jangir-0220
authored
SYNC: OSS sync for 260f871 (#221)
* updated audit info for cd pipeline delete req (#3404) * feat: Added condition for notifying HPA if Keda is enabled and handle HPA part in KEDA (#3391) * added condition for kedaAutoScaleEnabled * added new notification line * added nil condition --------- Co-authored-by: kartik-579 <[email protected]> Co-authored-by: jatin-jangir-0220 <[email protected]>
1 parent be944f5 commit 3bf0f67

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

util/ValidatorHelper.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,13 @@ func AutoScale(dat map[string]interface{}) (bool, error) {
228228
if dat == nil {
229229
return true, nil
230230
}
231+
kedaAutoScaleEnabled := false
232+
if dat["kedaAutoscaling"] != nil {
233+
kedaAutoScale, ok := dat["kedaAutoscaling"].(map[string]interface{})["enabled"]
234+
if ok {
235+
kedaAutoScaleEnabled=kedaAutoScale.(bool)
236+
}
237+
}
231238
if dat["autoscaling"] != nil {
232239
autoScaleEnabled, ok := dat["autoscaling"].(map[string]interface{})["enabled"]
233240
if !ok {
@@ -244,6 +251,9 @@ func AutoScale(dat map[string]interface{}) (bool, error) {
244251
if minReplicas.(float64) > maxReplicas.(float64) {
245252
return false, errors.New("autoscaling.MinReplicas can not be greater than autoscaling.MaxReplicas")
246253
}
254+
if kedaAutoScaleEnabled {
255+
return false, errors.New("autoscaling and kedaAutoscaling can not be enabled at the same time. Use additional scalers in kedaAutoscaling instead.")
256+
}
247257
}
248258
}
249259
return true, nil

0 commit comments

Comments
 (0)