Github user skonto commented on a diff in the pull request:

    https://github.com/apache/spark/pull/21652#discussion_r200136389
  
    --- Diff: 
resource-managers/kubernetes/integration-tests/src/test/scala/org/apache/spark/deploy/k8s/integrationtest/KubernetesSuite.scala
 ---
    @@ -150,6 +177,33 @@ private[spark] class KubernetesSuite extends 
SparkFunSuite
           })
       }
     
    +  test("Run SparkPi with env and mount secrets.") {
    +    createTestSecret()
    +    sparkAppConf
    +      .set(s"spark.kubernetes.driver.secrets.$ENV_SECRET_NAME", 
SECRET_MOUNT_PATH)
    +      .set(s"spark.kubernetes.driver.secretKeyRef.USERNAME", 
s"$ENV_SECRET_NAME:username")
    +      .set(s"spark.kubernetes.driver.secretKeyRef.PASSWORD", 
s"$ENV_SECRET_NAME:password")
    +      .set(s"spark.kubernetes.executor.secrets.$ENV_SECRET_NAME", 
SECRET_MOUNT_PATH)
    +      .set(s"spark.kubernetes.executor.secretKeyRef.USERNAME", 
s"$ENV_SECRET_NAME:username")
    +      .set(s"spark.kubernetes.executor.secretKeyRef.PASSWORD", 
s"$ENV_SECRET_NAME:password")
    +    try {
    +      runSparkPiAndVerifyCompletion(
    +        driverPodChecker = (driverPod: Pod) => {
    +          doBasicDriverPodCheck(driverPod)
    +          checkSecrets(driverPod)
    +        },
    +        executorPodChecker = (executorPod: Pod) => {
    +          doBasicExecutorPodCheck(executorPod)
    +          checkSecrets(executorPod)
    +        },
    +        appArgs = Array("1000") // give it enough time for all execs to be 
visible
    +      )
    +    } finally {
    --- End diff --
    
    @ssuchter moved the secret creation in here. I had the idea of using before 
and after and checking for a flag to identify the current test but I think this 
is cleaner. 


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to