Skip to content

Commit

Permalink
fix: propagate service account + test (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
rivamarco authored Jul 24, 2024
1 parent 43fab67 commit 1e0d779
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions spark_on_k8s/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ def submit_app(
image=image,
image_pull_policy=image_pull_policy,
namespace=namespace,
service_account=service_account,
args=driver_command_args,
extra_labels={**extra_labels, **driver_labels},
annotations=driver_annotations,
Expand Down
2 changes: 2 additions & 0 deletions tests/test_spark_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ def test_submit_app(self, mock_create_namespaced_service, mock_create_namespaced
assert created_pod.metadata.labels["spark-app-id"] == expected_app_id
assert created_pod.metadata.labels["spark-role"] == "driver"
assert created_pod.spec.containers[0].image == "pyspark-job"
assert created_pod.spec.service_account_name == "spark"
assert created_pod.spec.containers[0].args == [
"driver",
"--master",
Expand Down Expand Up @@ -296,6 +297,7 @@ def test_submit_app_with_env_configurations(

created_pod = mock_create_namespaced_pod.call_args[1]["body"]
assert created_pod.spec.containers[0].image == "test-spark-on-k8s-docker-image"
assert created_pod.spec.service_account_name == "test-service-account"
assert created_pod.spec.containers[0].args == [
"driver",
"--master",
Expand Down

0 comments on commit 1e0d779

Please sign in to comment.