diff --git a/charts/cf-common-test/tests/keda/error_test.yaml b/charts/cf-common-test/tests/keda/error_test.yaml index 3879371..d2fc8e2 100644 --- a/charts/cf-common-test/tests/keda/error_test.yaml +++ b/charts/cf-common-test/tests/keda/error_test.yaml @@ -3,7 +3,7 @@ suite: KEDA ScaledObject error handlers templates: - templates/scaled-object.yaml tests: - - it: Test ScaledObject non-zero idleReplicaCount + - it: Test ScaledObject zero idleReplicaCount values: - values.yaml set: @@ -11,8 +11,9 @@ tests: spec: idleReplicaCount: 1 asserts: - - failedTemplate: - errorMessage: "Only 0 is allowed for idleReplicaCount" + - equal: + path: spec.idleReplicaCount + value: 0 - it: Test ScaledObject fallback values: diff --git a/charts/cf-common-test/tests/keda/spec_test.yaml b/charts/cf-common-test/tests/keda/spec_test.yaml index 7c09270..bec3351 100644 --- a/charts/cf-common-test/tests/keda/spec_test.yaml +++ b/charts/cf-common-test/tests/keda/spec_test.yaml @@ -27,7 +27,6 @@ tests: spec: minReplicaCount: 2 maxReplicaCount: 10 - idleReplicaCount: 0 asserts: - equal: path: spec.minReplicaCount @@ -35,9 +34,8 @@ tests: - equal: path: spec.maxReplicaCount value: 10 - - equal: + - isNull: path: spec.idleReplicaCount - value: 0 - it: Test ScaledObject pollingInterval/cooldownPeriod values: diff --git a/charts/cf-common/templates/keda/_scaledobject.tpl b/charts/cf-common/templates/keda/_scaledobject.tpl index 11a67b4..91b4b59 100644 --- a/charts/cf-common/templates/keda/_scaledobject.tpl +++ b/charts/cf-common/templates/keda/_scaledobject.tpl @@ -42,10 +42,8 @@ spec: {{- end }} pollingInterval: {{ .Values.keda.spec.pollingInterval | default 30 }} cooldownPeriod: {{ .Values.keda.spec.cooldownPeriod | default 300 }} - {{- if (eq 0 (int .Values.keda.spec.idleReplicaCount)) }} + {{- with .Values.keda.spec.idleReplicaCount }} idleReplicaCount: 0 - {{- else }} - {{- fail "ERROR: Only 0 is allowed for idleReplicaCount" }} {{- end }} minReplicaCount: {{ .Values.keda.spec.minReplicaCount | default 1 }} maxReplicaCount: {{ .Values.keda.spec.maxReplicaCount | default 100 }} diff --git a/charts/cf-common/values.yaml b/charts/cf-common/values.yaml index 3afd963..91946fd 100644 --- a/charts/cf-common/values.yaml +++ b/charts/cf-common/values.yaml @@ -574,7 +574,7 @@ keda: envSourceContainerName: null pollingInterval: null # default to 30 cooldownPeriod: null # default to 300 - # idleReplicaCount: null # Only 0 is allowed! + idleReplicaCount: null # Only 0 is allowed! minReplicaCount: null # default to 1 maxReplicaCount: null # default to 100 fallback: {}