Skip to content

FEAT: support idleReplicaCount=0 rendering in Rollout Deployment KEDA template#6972

Open
lokesh-devtron wants to merge 1 commit into
mainfrom
keda-idleReplicaCount-fix
Open

FEAT: support idleReplicaCount=0 rendering in Rollout Deployment KEDA template#6972
lokesh-devtron wants to merge 1 commit into
mainfrom
keda-idleReplicaCount-fix

Conversation

@lokesh-devtron

@lokesh-devtron lokesh-devtron commented Jun 25, 2026

Copy link
Copy Markdown

Type of change

  • Bug fix

Description

Problem Statement

When kedaAutoscaling.idleReplicaCount is configured with the value 0, the generated KEDA ScaledObject does not render the idleReplicaCount field.

The existing Helm template uses the following condition:

{{- if $.Values.kedaAutoscaling.idleReplicaCount }}

Since Helm evaluates 0 as a false value, the condition fails and the field is omitted from the rendered manifest.

As a result, users cannot explicitly configure:

idleReplicaCount: 0

even when it is provided in the deployment template values.

Root Cause

The template checks the truthiness of the value instead of checking whether the value is defined.

Fix

Updated the template condition to explicitly check for nil:

{{- if ne $.Values.kedaAutoscaling.idleReplicaCount nil }}

This ensures that:

  • idleReplicaCount: 0 is rendered correctly.
  • Any non-zero value is also rendered.
  • The field is omitted only when it is not configured.

Additionally, added the default idleReplicaCount: 0 in values.yaml for consistency.

Testing

  • Updated the Rollout Deployment reference chart.
  • Verified the rendered ScaledObject manifest includes:
idleReplicaCount: 0

when configured in values.

Impact

This change preserves existing behavior while correctly supporting explicit zero values for idleReplicaCount.

Summary by Bito

  • Updated KEDA autoscaling template to correctly handle idleReplicaCount when set to 0 by checking for nil instead of truthiness.
  • Added idleReplicaCount with a default value of 0 to the autoscaling configuration in values.yaml.

@github-actions

Copy link
Copy Markdown

Some linked issues are invalid. Please update the issue links:\nIssue # in is not found or invalid (HTTP }404).\n

@github-actions

Copy link
Copy Markdown

Some linked issues are invalid. Please update the issue links:\nIssue # in is not found or invalid (HTTP }404).\n

@sonarqubecloud

Copy link
Copy Markdown

@lokesh-devtron lokesh-devtron changed the title fix: support idleReplicaCount=0 rendering in Rollout Deployment KEDA template FEAT: support idleReplicaCount=0 rendering in Rollout Deployment KEDA template Jun 25, 2026
@github-actions

Copy link
Copy Markdown

Some linked issues are invalid. Please update the issue links:\nIssue # in is not found or invalid (HTTP }404).\n

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant