@@ -291,10 +291,13 @@ def test_should_add_extra_init_containers(self):
291291 show_only = ["templates/workers/worker-deployment.yaml" ],
292292 )
293293
294- assert jmespath .search ("spec.template.spec.initContainers[-1]" , docs [0 ]) == {
295- "name" : "test-init-container" ,
296- "image" : "test-registry/test-repo:test-tag" ,
297- }
294+ # [1:] -> Skipping wait-for-airflow-migrations init container
295+ assert jmespath .search ("spec.template.spec.initContainers[1:]" , docs [0 ]) == [
296+ {
297+ "name" : "test-init-container" ,
298+ "image" : "test-registry/test-repo:test-tag" ,
299+ }
300+ ]
298301
299302 def test_should_template_extra_init_containers (self ):
300303 docs = render_chart (
@@ -306,9 +309,10 @@ def test_should_template_extra_init_containers(self):
306309 show_only = ["templates/workers/worker-deployment.yaml" ],
307310 )
308311
309- assert jmespath .search ("spec.template.spec.initContainers[-1]" , docs [0 ]) == {
310- "name" : "release-name-test-init-container"
311- }
312+ # [1:] -> Skipping wait-for-airflow-migrations init container
313+ assert jmespath .search ("spec.template.spec.initContainers[1:]" , docs [0 ]) == [
314+ {"name" : "release-name-test-init-container" }
315+ ]
312316
313317 def test_should_add_extra_volume_and_extra_volume_mount (self ):
314318 docs = render_chart (
@@ -952,7 +956,10 @@ def test_extra_init_container_restart_policy_is_configurable(self):
952956 show_only = ["templates/workers/worker-deployment.yaml" ],
953957 )
954958
955- assert jmespath .search ("spec.template.spec.initContainers[1].restartPolicy" , docs [0 ]) == "Always"
959+ # [1:] -> Skipping wait-for-airflow-migrations init container
960+ assert jmespath .search ("spec.template.spec.initContainers[1:] | [*].restartPolicy" , docs [0 ]) == [
961+ "Always"
962+ ]
956963
957964 @pytest .mark .parametrize (
958965 ("log_values" , "expected_volume" ),
0 commit comments