This is an automated email from the ASF dual-hosted git repository.

jscheffl pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 4c0b2c10879 fix(helm): omit api-server replicas when HPA is enabled 
(#62052)
4c0b2c10879 is described below

commit 4c0b2c108798e64ee67ae8a66da5e8822a758457
Author: Joaquin Rodriguez <[email protected]>
AuthorDate: Sun Mar 15 16:01:43 2026 -0400

    fix(helm): omit api-server replicas when HPA is enabled (#62052)
    
    * fix(helm): omit api-server replicas when HPA is enabled
    
    When apiServer.hpa.enabled is true, the deployment must not set a
    replicas field so the HPA can manage replica count. Otherwise GitOps
    tools (e.g. ArgoCD) detect drift and continuously reconcile.
    
    Follows the same pattern used by webserver and workers deployments.
    
    * Addressing PR comments about default version tests.
---
 .../tests/helm_tests/apiserver/test_apiserver.py   | 28 ++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/helm-tests/tests/helm_tests/apiserver/test_apiserver.py 
b/helm-tests/tests/helm_tests/apiserver/test_apiserver.py
index fd0b9a7f85b..0e16b5fa3e3 100644
--- a/helm-tests/tests/helm_tests/apiserver/test_apiserver.py
+++ b/helm-tests/tests/helm_tests/apiserver/test_apiserver.py
@@ -17,12 +17,18 @@
 from __future__ import annotations
 
 import jmespath
+import pytest
 from chart_utils.helm_template_generator import render_chart
 
 
 class TestAPIServerDeployment:
     """Tests API Server deployment."""
 
+    def _get_values_with_version(self, values, version):
+        if version != "default":
+            values["airflowVersion"] = version
+        return values
+
     def test_airflow_2(self):
         """
         API Server only supports Airflow 3.0.0 and later.
@@ -76,6 +82,28 @@ class TestAPIServerDeployment:
             "readOnly": True,
         } in jmespath.search("spec.template.spec.containers[0].volumeMounts", 
docs[0])
 
+    @pytest.mark.parametrize("version", ["3.0.0", "default"])
+    def test_should_remove_replicas_field(self, version):
+        docs = render_chart(
+            values=self._get_values_with_version(
+                values={"apiServer": {"hpa": {"enabled": True}}},
+                version=version,
+            ),
+            show_only=["templates/api-server/api-server-deployment.yaml"],
+        )
+        assert "replicas" not in jmespath.search("spec", docs[0])
+
+    @pytest.mark.parametrize("version", ["3.0.0", "default"])
+    def test_should_not_remove_replicas_field(self, version):
+        docs = render_chart(
+            values=self._get_values_with_version(
+                values={"apiServer": {"hpa": {"enabled": False}}},
+                version=version,
+            ),
+            show_only=["templates/api-server/api-server-deployment.yaml"],
+        )
+        assert "replicas" in jmespath.search("spec", docs[0])
+
 
 class TestAPIServerJWTSecret:
     """Tests API Server JWT secret."""

Reply via email to