Skip to content

Commit

Permalink
[SPARK-24963][K8S][TESTS] Add user-specified service account name for…
Browse files Browse the repository at this point in the history
… client mode test driver pod

## What changes were proposed in this pull request?

Adds the user-set service account name for the driver pod in the client mode integration test

## How was this patch tested?

Manual test against a custom Kubernetes cluster

Author: mcheah <[email protected]>

Closes apache#21924 from mccheah/fix-service-account.
  • Loading branch information
mccheah committed Jul 30, 2018
1 parent abbb4ab commit 2fbe294
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ trait ClientModeTestsSuite { k8sSuite: KubernetesSuite =>
.withLabels(labels.asJava)
.endMetadata()
.withNewSpec()
.withServiceAccountName(kubernetesTestComponents.serviceAccountName)
.addNewContainer()
.withName("spark-example")
.withImage(image)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ private[spark] class KubernetesTestComponents(defaultClient: DefaultKubernetesCl
val namespaceOption = Option(System.getProperty("spark.kubernetes.test.namespace"))
val hasUserSpecifiedNamespace = namespaceOption.isDefined
val namespace = namespaceOption.getOrElse(UUID.randomUUID().toString.replaceAll("-", ""))
private val serviceAccountName =
val serviceAccountName =
Option(System.getProperty("spark.kubernetes.test.serviceAccountName"))
.getOrElse("default")
val kubernetesClient = defaultClient.inNamespace(namespace)
Expand Down

0 comments on commit 2fbe294

Please sign in to comment.