Miretpl commented on code in PR #70238:
URL: https://github.com/apache/airflow/pull/70238#discussion_r3714301485
##########
chart/tests/helm_tests/security/test_security_context.py:
##########
@@ -422,6 +422,239 @@ def test_main_pod_setting(self):
for doc in docs[1:]:
assert ctx_value ==
jmespath.search("spec.template.spec.securityContext", doc)
+ def test_disable_defaults_pod_and_container(self):
+ """
+ securityContexts.disableDefaults suppresses the chart's hard-coded
runAsUser/fsGroup
+ and allowPrivilegeEscalation/capabilities defaults, e.g. for OpenShift
SCC compatibility.
+ """
+ docs = render_chart(
+ values={
+ "securityContexts": {"disableDefaults": True},
+ "executor": "CeleryExecutor,KubernetesExecutor",
+ "cleanup": {"enabled": True},
+ "flower": {"enabled": True},
+ "pgbouncer": {"enabled": True},
+ "statsd": {"enabled": True},
+ },
+ show_only=[
+ "templates/cleanup/cleanup-cronjob.yaml",
+ "templates/flower/flower-deployment.yaml",
+ "templates/scheduler/scheduler-deployment.yaml",
+ "templates/api-server/api-server-deployment.yaml",
+ "templates/dag-processor/dag-processor-deployment.yaml",
+ "templates/workers/worker-deployment.yaml",
+ "templates/jobs/create-user-job.yaml",
+ "templates/jobs/migrate-database-job.yaml",
+ "templates/triggerer/triggerer-deployment.yaml",
+ "templates/pgbouncer/pgbouncer-deployment.yaml",
+ "templates/statsd/statsd-deployment.yaml",
+ "templates/redis/redis-statefulset.yaml",
+ ],
+ )
+
+ assert
jmespath.search("spec.jobTemplate.spec.template.spec.securityContext", docs[0])
is None
+ assert (
+
jmespath.search("spec.jobTemplate.spec.template.spec.containers[0].securityContext",
docs[0])
+ is None
+ )
+
+ for doc in docs[1:]:
Review Comment:
Could you move it to `jmespath.search`?
*(valid for more than only this test case)*
##########
chart/tests/helm_tests/security/test_security_context.py:
##########
@@ -422,6 +422,239 @@ def test_main_pod_setting(self):
for doc in docs[1:]:
assert ctx_value ==
jmespath.search("spec.template.spec.securityContext", doc)
+ def test_disable_defaults_pod_and_container(self):
+ """
+ securityContexts.disableDefaults suppresses the chart's hard-coded
runAsUser/fsGroup
+ and allowPrivilegeEscalation/capabilities defaults, e.g. for OpenShift
SCC compatibility.
+ """
Review Comment:
```suggestion
```
I think that there is no value in having that comment next to test case.
##########
chart/values.schema.json:
##########
@@ -126,6 +126,12 @@
"allowPrivilegeEscalation": false
}
]
+ },
+ "disableDefaults": {
+ "description": "If `true`, the chart will not set any
default `securityContext` values when `securityContexts.pod` /
`securityContexts.containers` (or the equivalent per-component overrides) are
left empty. (Default `false` is deprecated and will change to `true` in a
future release.)",
Review Comment:
Not resolved.
##########
chart/tests/helm_tests/security/test_security_context.py:
##########
@@ -422,6 +422,239 @@ def test_main_pod_setting(self):
for doc in docs[1:]:
assert ctx_value ==
jmespath.search("spec.template.spec.securityContext", doc)
+ def test_disable_defaults_pod_and_container(self):
+ """
+ securityContexts.disableDefaults suppresses the chart's hard-coded
runAsUser/fsGroup
+ and allowPrivilegeEscalation/capabilities defaults, e.g. for OpenShift
SCC compatibility.
+ """
+ docs = render_chart(
+ values={
+ "securityContexts": {"disableDefaults": True},
+ "executor": "CeleryExecutor,KubernetesExecutor",
+ "cleanup": {"enabled": True},
+ "flower": {"enabled": True},
+ "pgbouncer": {"enabled": True},
+ "statsd": {"enabled": True},
+ },
+ show_only=[
+ "templates/cleanup/cleanup-cronjob.yaml",
+ "templates/flower/flower-deployment.yaml",
+ "templates/scheduler/scheduler-deployment.yaml",
+ "templates/api-server/api-server-deployment.yaml",
+ "templates/dag-processor/dag-processor-deployment.yaml",
+ "templates/workers/worker-deployment.yaml",
+ "templates/jobs/create-user-job.yaml",
+ "templates/jobs/migrate-database-job.yaml",
+ "templates/triggerer/triggerer-deployment.yaml",
+ "templates/pgbouncer/pgbouncer-deployment.yaml",
+ "templates/statsd/statsd-deployment.yaml",
+ "templates/redis/redis-statefulset.yaml",
+ ],
+ )
+
+ assert
jmespath.search("spec.jobTemplate.spec.template.spec.securityContext", docs[0])
is None
+ assert (
+
jmespath.search("spec.jobTemplate.spec.template.spec.containers[0].securityContext",
docs[0])
+ is None
+ )
+
+ for doc in docs[1:]:
+ assert jmespath.search("spec.template.spec.securityContext", doc)
is None
+ assert
jmespath.search("spec.template.spec.containers[0].securityContext", doc) is None
+
+ def test_disable_defaults_gitsync_containers(self):
+ docs = render_chart(
+ values={
+ "securityContexts": {"disableDefaults": True},
+ "dags": {"gitSync": {"enabled": True}},
+ },
+ show_only=[
+ "templates/workers/worker-deployment.yaml",
+ "templates/triggerer/triggerer-deployment.yaml",
+ "templates/dag-processor/dag-processor-deployment.yaml",
+ ],
+ )
+
+ for doc in docs:
+ assert (
+ jmespath.search(
+
"spec.template.spec.initContainers[?name=='git-sync-init'].securityContext |
[0]",
+ doc,
+ )
+ is None
+ )
+ assert (
+ jmespath.search(
+
"spec.template.spec.containers[?name=='git-sync'].securityContext | [0]",
+ doc,
+ )
+ is None
+ )
+
+ def test_disable_defaults_volume_permissions_init_container_skipped(self):
+ """With no explicit uid/gid override, the volume-permissions init
container is omitted entirely."""
+ docs = render_chart(
+ values={
+ "securityContexts": {"disableDefaults": True},
+ "workers": {
+ "celery": {
+ "persistence": {"enabled": True, "fixPermissions":
True},
+ }
+ },
+ },
+ show_only=["templates/workers/worker-deployment.yaml"],
+ )
+
+ init_container_names = [
+ c["name"] for c in
jmespath.search("spec.template.spec.initContainers", docs[0])
+ ]
Review Comment:
Could you move this `for` logic to `jmespath`?
*(valid for more than only this test case)*
##########
chart/tests/helm_tests/security/test_security_context.py:
##########
@@ -422,6 +422,239 @@ def test_main_pod_setting(self):
for doc in docs[1:]:
assert ctx_value ==
jmespath.search("spec.template.spec.securityContext", doc)
+ def test_disable_defaults_pod_and_container(self):
+ """
+ securityContexts.disableDefaults suppresses the chart's hard-coded
runAsUser/fsGroup
+ and allowPrivilegeEscalation/capabilities defaults, e.g. for OpenShift
SCC compatibility.
+ """
+ docs = render_chart(
+ values={
+ "securityContexts": {"disableDefaults": True},
+ "executor": "CeleryExecutor,KubernetesExecutor",
+ "cleanup": {"enabled": True},
+ "flower": {"enabled": True},
+ "pgbouncer": {"enabled": True},
+ "statsd": {"enabled": True},
+ },
+ show_only=[
+ "templates/cleanup/cleanup-cronjob.yaml",
+ "templates/flower/flower-deployment.yaml",
+ "templates/scheduler/scheduler-deployment.yaml",
+ "templates/api-server/api-server-deployment.yaml",
+ "templates/dag-processor/dag-processor-deployment.yaml",
+ "templates/workers/worker-deployment.yaml",
+ "templates/jobs/create-user-job.yaml",
+ "templates/jobs/migrate-database-job.yaml",
+ "templates/triggerer/triggerer-deployment.yaml",
+ "templates/pgbouncer/pgbouncer-deployment.yaml",
+ "templates/statsd/statsd-deployment.yaml",
+ "templates/redis/redis-statefulset.yaml",
+ ],
+ )
+
+ assert
jmespath.search("spec.jobTemplate.spec.template.spec.securityContext", docs[0])
is None
+ assert (
+
jmespath.search("spec.jobTemplate.spec.template.spec.containers[0].securityContext",
docs[0])
+ is None
+ )
+
+ for doc in docs[1:]:
+ assert jmespath.search("spec.template.spec.securityContext", doc)
is None
+ assert
jmespath.search("spec.template.spec.containers[0].securityContext", doc) is None
+
+ def test_disable_defaults_gitsync_containers(self):
+ docs = render_chart(
+ values={
+ "securityContexts": {"disableDefaults": True},
+ "dags": {"gitSync": {"enabled": True}},
+ },
+ show_only=[
+ "templates/workers/worker-deployment.yaml",
+ "templates/triggerer/triggerer-deployment.yaml",
+ "templates/dag-processor/dag-processor-deployment.yaml",
+ ],
+ )
+
+ for doc in docs:
+ assert (
+ jmespath.search(
+
"spec.template.spec.initContainers[?name=='git-sync-init'].securityContext |
[0]",
+ doc,
+ )
+ is None
+ )
+ assert (
+ jmespath.search(
+
"spec.template.spec.containers[?name=='git-sync'].securityContext | [0]",
+ doc,
+ )
+ is None
+ )
+
+ def test_disable_defaults_volume_permissions_init_container_skipped(self):
+ """With no explicit uid/gid override, the volume-permissions init
container is omitted entirely."""
+ docs = render_chart(
+ values={
+ "securityContexts": {"disableDefaults": True},
+ "workers": {
+ "celery": {
+ "persistence": {"enabled": True, "fixPermissions":
True},
+ }
+ },
+ },
+ show_only=["templates/workers/worker-deployment.yaml"],
+ )
+
+ init_container_names = [
+ c["name"] for c in
jmespath.search("spec.template.spec.initContainers", docs[0])
+ ]
+ assert "volume-permissions" not in init_container_names
+
+ def test_disable_defaults_explicit_override_still_applied(self):
+ """Explicit securityContexts overrides take priority over
disableDefaults."""
+ ctx_value = {"runAsUser": 7000}
+ docs = render_chart(
+ values={
+ "securityContexts": {"disableDefaults": True, "pod":
ctx_value},
+ "workers": {
+ "celery": {
+ "persistence": {"enabled": True, "fixPermissions":
True},
+ }
+ },
+ },
+ show_only=[
+ "templates/scheduler/scheduler-deployment.yaml",
+ "templates/workers/worker-deployment.yaml",
+ ],
+ )
+
+ for doc in docs:
+ assert ctx_value ==
jmespath.search("spec.template.spec.securityContext", doc)
+
+ init_container_names = [
+ c["name"] for c in
jmespath.search("spec.template.spec.initContainers", docs[1])
+ ]
+ assert "volume-permissions" in init_container_names
+
+ @pytest.mark.parametrize(
+ ("component_values", "show_only", "security_context_path"),
+ [
+ (
+ {"scheduler": {"securityContexts": {"pod": {"runAsUser":
8000}}}},
+ "templates/scheduler/scheduler-deployment.yaml",
+ "spec.template.spec.securityContext",
+ ),
+ (
+ {"apiServer": {"securityContexts": {"pod": {"runAsUser":
8000}}}},
+ "templates/api-server/api-server-deployment.yaml",
+ "spec.template.spec.securityContext",
+ ),
+ (
+ {"dagProcessor": {"securityContexts": {"pod": {"runAsUser":
8000}}}},
+ "templates/dag-processor/dag-processor-deployment.yaml",
+ "spec.template.spec.securityContext",
+ ),
+ (
+ {"triggerer": {"securityContexts": {"pod": {"runAsUser":
8000}}}},
+ "templates/triggerer/triggerer-deployment.yaml",
+ "spec.template.spec.securityContext",
+ ),
+ (
+ {"workers": {"celery": {"securityContexts": {"pod":
{"runAsUser": 8000}}}}},
+ "templates/workers/worker-deployment.yaml",
+ "spec.template.spec.securityContext",
+ ),
+ (
+ {"flower": {"enabled": True, "securityContexts": {"pod":
{"runAsUser": 8000}}}},
+ "templates/flower/flower-deployment.yaml",
+ "spec.template.spec.securityContext",
+ ),
+ (
+ {"statsd": {"securityContexts": {"pod": {"runAsUser": 8000}}}},
+ "templates/statsd/statsd-deployment.yaml",
+ "spec.template.spec.securityContext",
+ ),
+ (
+ {"pgbouncer": {"enabled": True, "securityContexts": {"pod":
{"runAsUser": 8000}}}},
+ "templates/pgbouncer/pgbouncer-deployment.yaml",
+ "spec.template.spec.securityContext",
+ ),
+ (
+ {"redis": {"securityContexts": {"pod": {"runAsUser": 8000}}}},
+ "templates/redis/redis-statefulset.yaml",
+ "spec.template.spec.securityContext",
+ ),
+ (
+ {"createUserJob": {"securityContexts": {"pod": {"runAsUser":
8000}}}},
+ "templates/jobs/create-user-job.yaml",
+ "spec.template.spec.securityContext",
+ ),
+ (
+ {"migrateDatabaseJob": {"securityContexts": {"pod":
{"runAsUser": 8000}}}},
+ "templates/jobs/migrate-database-job.yaml",
+ "spec.template.spec.securityContext",
+ ),
+ (
+ {
+ "executor": "CeleryExecutor,KubernetesExecutor",
+ "cleanup": {"enabled": True, "securityContexts": {"pod":
{"runAsUser": 8000}}},
+ },
+ "templates/cleanup/cleanup-cronjob.yaml",
+ "spec.jobTemplate.spec.template.spec.securityContext",
+ ),
+ (
+ {"databaseCleanup": {"enabled": True, "securityContexts":
{"pod": {"runAsUser": 8000}}}},
+ "templates/database-cleanup/database-cleanup-cronjob.yaml",
+ "spec.jobTemplate.spec.template.spec.securityContext",
+ ),
+ ],
+ ids=[
+ "scheduler",
+ "apiServer",
+ "dagProcessor",
+ "triggerer",
+ "workers.celery",
+ "flower",
+ "statsd",
+ "pgbouncer",
+ "redis",
+ "createUserJob",
+ "migrateDatabaseJob",
+ "cleanup",
+ "databaseCleanup",
+ ],
+ )
+ def test_disable_defaults_component_level_override_still_applied(
+ self, component_values, show_only, security_context_path
+ ):
+ """A component-level securityContexts override takes priority over
global disableDefaults."""
+ docs = render_chart(
+ values={"securityContexts": {"disableDefaults": True},
**component_values},
+ show_only=[show_only],
+ )
+
+ assert jmespath.search(security_context_path, docs[0]) ==
{"runAsUser": 8000}
+
+ def
test_disable_defaults_workers_volume_permissions_init_container_still_added(self):
+ """disableDefaults must not suppress the volume-permissions init
container injection."""
Review Comment:
```suggestion
```
Name of the test case means that really.
##########
chart/values.yaml:
##########
@@ -47,6 +47,11 @@ gid: 0
securityContexts:
pod: {}
containers: {}
+ # If `true`, the chart will not set any default `securityContext` values when
+ # securityContexts.pod / securityContexts.containers (or the equivalent
per-component
+ # overrides) are left empty. (Default `false` is deprecated and will change
to `true`
+ # in a future release.)
Review Comment:
Not resolved - please, do not resolve comments which were not addressed by
you and if you believe that something shouldn't be done, you can put a comment
under suggestion to explain why do you think that,
##########
chart/tests/helm_tests/security/test_security_context.py:
##########
@@ -422,6 +422,239 @@ def test_main_pod_setting(self):
for doc in docs[1:]:
assert ctx_value ==
jmespath.search("spec.template.spec.securityContext", doc)
+ def test_disable_defaults_pod_and_container(self):
Review Comment:
We could separate job from deployments.
*(valid for more than only this test case)*
##########
chart/tests/helm_tests/security/test_security_context.py:
##########
@@ -422,6 +422,239 @@ def test_main_pod_setting(self):
for doc in docs[1:]:
assert ctx_value ==
jmespath.search("spec.template.spec.securityContext", doc)
+ def test_disable_defaults_pod_and_container(self):
+ """
+ securityContexts.disableDefaults suppresses the chart's hard-coded
runAsUser/fsGroup
+ and allowPrivilegeEscalation/capabilities defaults, e.g. for OpenShift
SCC compatibility.
+ """
+ docs = render_chart(
+ values={
+ "securityContexts": {"disableDefaults": True},
+ "executor": "CeleryExecutor,KubernetesExecutor",
+ "cleanup": {"enabled": True},
+ "flower": {"enabled": True},
+ "pgbouncer": {"enabled": True},
+ "statsd": {"enabled": True},
+ },
+ show_only=[
+ "templates/cleanup/cleanup-cronjob.yaml",
+ "templates/flower/flower-deployment.yaml",
+ "templates/scheduler/scheduler-deployment.yaml",
+ "templates/api-server/api-server-deployment.yaml",
+ "templates/dag-processor/dag-processor-deployment.yaml",
+ "templates/workers/worker-deployment.yaml",
+ "templates/jobs/create-user-job.yaml",
+ "templates/jobs/migrate-database-job.yaml",
+ "templates/triggerer/triggerer-deployment.yaml",
+ "templates/pgbouncer/pgbouncer-deployment.yaml",
+ "templates/statsd/statsd-deployment.yaml",
+ "templates/redis/redis-statefulset.yaml",
+ ],
+ )
+
+ assert
jmespath.search("spec.jobTemplate.spec.template.spec.securityContext", docs[0])
is None
+ assert (
+
jmespath.search("spec.jobTemplate.spec.template.spec.containers[0].securityContext",
docs[0])
+ is None
+ )
+
+ for doc in docs[1:]:
+ assert jmespath.search("spec.template.spec.securityContext", doc)
is None
+ assert
jmespath.search("spec.template.spec.containers[0].securityContext", doc) is None
+
+ def test_disable_defaults_gitsync_containers(self):
+ docs = render_chart(
+ values={
+ "securityContexts": {"disableDefaults": True},
+ "dags": {"gitSync": {"enabled": True}},
+ },
+ show_only=[
+ "templates/workers/worker-deployment.yaml",
+ "templates/triggerer/triggerer-deployment.yaml",
+ "templates/dag-processor/dag-processor-deployment.yaml",
+ ],
+ )
+
+ for doc in docs:
+ assert (
+ jmespath.search(
+
"spec.template.spec.initContainers[?name=='git-sync-init'].securityContext |
[0]",
+ doc,
+ )
+ is None
+ )
+ assert (
+ jmespath.search(
+
"spec.template.spec.containers[?name=='git-sync'].securityContext | [0]",
+ doc,
+ )
+ is None
+ )
+
+ def test_disable_defaults_volume_permissions_init_container_skipped(self):
+ """With no explicit uid/gid override, the volume-permissions init
container is omitted entirely."""
+ docs = render_chart(
+ values={
+ "securityContexts": {"disableDefaults": True},
+ "workers": {
+ "celery": {
+ "persistence": {"enabled": True, "fixPermissions":
True},
+ }
+ },
+ },
+ show_only=["templates/workers/worker-deployment.yaml"],
+ )
+
+ init_container_names = [
+ c["name"] for c in
jmespath.search("spec.template.spec.initContainers", docs[0])
+ ]
+ assert "volume-permissions" not in init_container_names
+
+ def test_disable_defaults_explicit_override_still_applied(self):
+ """Explicit securityContexts overrides take priority over
disableDefaults."""
Review Comment:
```suggestion
```
IMO, the name of the test means the same.
##########
chart/tests/helm_tests/security/test_security_context.py:
##########
@@ -422,6 +422,239 @@ def test_main_pod_setting(self):
for doc in docs[1:]:
assert ctx_value ==
jmespath.search("spec.template.spec.securityContext", doc)
+ def test_disable_defaults_pod_and_container(self):
+ """
+ securityContexts.disableDefaults suppresses the chart's hard-coded
runAsUser/fsGroup
+ and allowPrivilegeEscalation/capabilities defaults, e.g. for OpenShift
SCC compatibility.
+ """
+ docs = render_chart(
+ values={
+ "securityContexts": {"disableDefaults": True},
+ "executor": "CeleryExecutor,KubernetesExecutor",
+ "cleanup": {"enabled": True},
+ "flower": {"enabled": True},
+ "pgbouncer": {"enabled": True},
+ "statsd": {"enabled": True},
+ },
+ show_only=[
+ "templates/cleanup/cleanup-cronjob.yaml",
+ "templates/flower/flower-deployment.yaml",
+ "templates/scheduler/scheduler-deployment.yaml",
+ "templates/api-server/api-server-deployment.yaml",
+ "templates/dag-processor/dag-processor-deployment.yaml",
+ "templates/workers/worker-deployment.yaml",
+ "templates/jobs/create-user-job.yaml",
+ "templates/jobs/migrate-database-job.yaml",
+ "templates/triggerer/triggerer-deployment.yaml",
+ "templates/pgbouncer/pgbouncer-deployment.yaml",
+ "templates/statsd/statsd-deployment.yaml",
+ "templates/redis/redis-statefulset.yaml",
+ ],
+ )
+
+ assert
jmespath.search("spec.jobTemplate.spec.template.spec.securityContext", docs[0])
is None
+ assert (
+
jmespath.search("spec.jobTemplate.spec.template.spec.containers[0].securityContext",
docs[0])
+ is None
+ )
+
+ for doc in docs[1:]:
+ assert jmespath.search("spec.template.spec.securityContext", doc)
is None
+ assert
jmespath.search("spec.template.spec.containers[0].securityContext", doc) is None
+
+ def test_disable_defaults_gitsync_containers(self):
+ docs = render_chart(
+ values={
+ "securityContexts": {"disableDefaults": True},
+ "dags": {"gitSync": {"enabled": True}},
+ },
+ show_only=[
+ "templates/workers/worker-deployment.yaml",
+ "templates/triggerer/triggerer-deployment.yaml",
+ "templates/dag-processor/dag-processor-deployment.yaml",
+ ],
+ )
+
+ for doc in docs:
+ assert (
+ jmespath.search(
+
"spec.template.spec.initContainers[?name=='git-sync-init'].securityContext |
[0]",
+ doc,
+ )
+ is None
+ )
+ assert (
+ jmespath.search(
+
"spec.template.spec.containers[?name=='git-sync'].securityContext | [0]",
+ doc,
+ )
+ is None
+ )
+
+ def test_disable_defaults_volume_permissions_init_container_skipped(self):
+ """With no explicit uid/gid override, the volume-permissions init
container is omitted entirely."""
+ docs = render_chart(
+ values={
+ "securityContexts": {"disableDefaults": True},
+ "workers": {
+ "celery": {
+ "persistence": {"enabled": True, "fixPermissions":
True},
+ }
+ },
+ },
+ show_only=["templates/workers/worker-deployment.yaml"],
+ )
+
+ init_container_names = [
+ c["name"] for c in
jmespath.search("spec.template.spec.initContainers", docs[0])
+ ]
+ assert "volume-permissions" not in init_container_names
+
+ def test_disable_defaults_explicit_override_still_applied(self):
+ """Explicit securityContexts overrides take priority over
disableDefaults."""
+ ctx_value = {"runAsUser": 7000}
+ docs = render_chart(
+ values={
+ "securityContexts": {"disableDefaults": True, "pod":
ctx_value},
+ "workers": {
+ "celery": {
+ "persistence": {"enabled": True, "fixPermissions":
True},
+ }
+ },
+ },
+ show_only=[
+ "templates/scheduler/scheduler-deployment.yaml",
+ "templates/workers/worker-deployment.yaml",
+ ],
+ )
+
+ for doc in docs:
+ assert ctx_value ==
jmespath.search("spec.template.spec.securityContext", doc)
+
+ init_container_names = [
+ c["name"] for c in
jmespath.search("spec.template.spec.initContainers", docs[1])
+ ]
+ assert "volume-permissions" in init_container_names
+
+ @pytest.mark.parametrize(
+ ("component_values", "show_only", "security_context_path"),
+ [
+ (
+ {"scheduler": {"securityContexts": {"pod": {"runAsUser":
8000}}}},
+ "templates/scheduler/scheduler-deployment.yaml",
+ "spec.template.spec.securityContext",
+ ),
+ (
+ {"apiServer": {"securityContexts": {"pod": {"runAsUser":
8000}}}},
+ "templates/api-server/api-server-deployment.yaml",
+ "spec.template.spec.securityContext",
+ ),
+ (
+ {"dagProcessor": {"securityContexts": {"pod": {"runAsUser":
8000}}}},
+ "templates/dag-processor/dag-processor-deployment.yaml",
+ "spec.template.spec.securityContext",
+ ),
+ (
+ {"triggerer": {"securityContexts": {"pod": {"runAsUser":
8000}}}},
+ "templates/triggerer/triggerer-deployment.yaml",
+ "spec.template.spec.securityContext",
+ ),
+ (
+ {"workers": {"celery": {"securityContexts": {"pod":
{"runAsUser": 8000}}}}},
+ "templates/workers/worker-deployment.yaml",
+ "spec.template.spec.securityContext",
+ ),
+ (
+ {"flower": {"enabled": True, "securityContexts": {"pod":
{"runAsUser": 8000}}}},
+ "templates/flower/flower-deployment.yaml",
+ "spec.template.spec.securityContext",
+ ),
+ (
+ {"statsd": {"securityContexts": {"pod": {"runAsUser": 8000}}}},
+ "templates/statsd/statsd-deployment.yaml",
+ "spec.template.spec.securityContext",
+ ),
+ (
+ {"pgbouncer": {"enabled": True, "securityContexts": {"pod":
{"runAsUser": 8000}}}},
+ "templates/pgbouncer/pgbouncer-deployment.yaml",
+ "spec.template.spec.securityContext",
+ ),
+ (
+ {"redis": {"securityContexts": {"pod": {"runAsUser": 8000}}}},
+ "templates/redis/redis-statefulset.yaml",
+ "spec.template.spec.securityContext",
+ ),
+ (
+ {"createUserJob": {"securityContexts": {"pod": {"runAsUser":
8000}}}},
+ "templates/jobs/create-user-job.yaml",
+ "spec.template.spec.securityContext",
+ ),
+ (
+ {"migrateDatabaseJob": {"securityContexts": {"pod":
{"runAsUser": 8000}}}},
+ "templates/jobs/migrate-database-job.yaml",
+ "spec.template.spec.securityContext",
+ ),
+ (
+ {
+ "executor": "CeleryExecutor,KubernetesExecutor",
+ "cleanup": {"enabled": True, "securityContexts": {"pod":
{"runAsUser": 8000}}},
+ },
+ "templates/cleanup/cleanup-cronjob.yaml",
+ "spec.jobTemplate.spec.template.spec.securityContext",
+ ),
+ (
+ {"databaseCleanup": {"enabled": True, "securityContexts":
{"pod": {"runAsUser": 8000}}}},
+ "templates/database-cleanup/database-cleanup-cronjob.yaml",
+ "spec.jobTemplate.spec.template.spec.securityContext",
+ ),
+ ],
+ ids=[
+ "scheduler",
+ "apiServer",
+ "dagProcessor",
+ "triggerer",
+ "workers.celery",
+ "flower",
+ "statsd",
+ "pgbouncer",
+ "redis",
+ "createUserJob",
+ "migrateDatabaseJob",
+ "cleanup",
+ "databaseCleanup",
+ ],
+ )
+ def test_disable_defaults_component_level_override_still_applied(
+ self, component_values, show_only, security_context_path
+ ):
+ """A component-level securityContexts override takes priority over
global disableDefaults."""
Review Comment:
```suggestion
```
Name of the test case means that really.
--
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]