aaron-y-chen commented on code in PR #72555:
URL: https://github.com/apache/airflow/pull/72555#discussion_r4058315944
##########
chart/tests/helm_tests/airflow_aux/test_pod_template_file.py:
##########
@@ -1293,6 +1296,80 @@ def
test_runtime_class_name_values_are_configurable(self):
assert jmespath.search("spec.runtimeClassName", docs[0]) == "nvidia"
+ def test_kerberos_sidecar_is_native_sidecar(self):
+ docs = render_chart(
+ values={"workers": {"kubernetes": {"kerberosSidecar": {"enabled":
True}}}},
+ show_only=["templates/pod-template-file.yaml"],
+ chart_dir=self.temp_chart_dir,
+ )
+ sidecar =
jmespath.search("spec.initContainers[?name=='worker-kerberos'] | [0]", docs[0])
+ assert sidecar is not None
+ assert sidecar["restartPolicy"] == "Always"
+ assert jmespath.search("spec.containers[?name=='worker-kerberos'] |
[0]", docs[0]) is None
+
+ @pytest.mark.parametrize(
+ ("sidecar_enabled", "probe_enabled", "expected_names"),
+ [
+ (False, True, []),
+ (True, True, ["worker-kerberos"]),
+ (True, False, ["worker-kerberos"]),
+ ],
+ )
+ def test_kerberos_initialization(self, sidecar_enabled, probe_enabled,
expected_names):
+ docs = render_chart(
+ values={
+ "workers": {
+ "kubernetes": {
+ "kerberosSidecar": {
+ "enabled": sidecar_enabled,
+ "startupProbe": {"enabled": probe_enabled},
+ },
+ }
+ }
+ },
+ show_only=["templates/pod-template-file.yaml"],
+ chart_dir=self.temp_chart_dir,
+ )
+ assert (jmespath.search("spec.initContainers[].name", docs[0]) or [])
== expected_names
+ assert (
+ jmespath.search('metadata.annotations."checksum/kerberos-keytab"',
docs[0]) is not None
+ ) == sidecar_enabled
+ if sidecar_enabled:
+ sidecar =
jmespath.search("spec.initContainers[?name=='worker-kerberos'] | [0]", docs[0])
+ assert sidecar["args"] == ["kerberos"]
+ assert sidecar["restartPolicy"] == "Always"
+ assert ("startupProbe" in sidecar) == probe_enabled
+
+ def test_pod_override_reconciliation_with_kerberos_sidecar(self):
+ docs = render_chart(
+ values={"workers": {"kubernetes": {"kerberosSidecar": {"enabled":
True}}}},
+ show_only=["templates/pod-template-file.yaml"],
+ chart_dir=self.temp_chart_dir,
+ )
+ base_pod = PodGenerator.deserialize_model_dict(docs[0])
Review Comment:
I added this to verify that the native sidecar survives KubernetesExecutor
pod override reconciliation. However, this exercises existing `PodGenerator`
behavior rather than chart rendering, so I removed the test and kept the chart
tests focused on the rendered Pod.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]