Github user susanxhuynh commented on a diff in the pull request:
https://github.com/apache/spark/pull/19437#discussion_r143540778
--- Diff:
resource-managers/mesos/src/test/scala/org/apache/spark/scheduler/cluster/mesos/Utils.scala
---
@@ -105,4 +108,108 @@ object Utils {
def createTaskId(taskId: String): TaskID = {
TaskID.newBuilder().setValue(taskId).build()
}
+
+ def configEnvBasedRefSecrets(secretConfig: MesosSecretConfig):
Map[String, String] = {
+ val secretName = "/path/to/secret,/anothersecret"
+ val envKey = "SECRET_ENV_KEY,PASSWORD"
+ Map(
+ secretConfig.SECRET_NAME.key -> secretName,
+ secretConfig.SECRET_ENVKEY.key -> envKey
+ )
+ }
+
+ def verifyEnvBasedRefSecrets(launchedTasks: List[TaskInfo]): Unit = {
+ val envVars = launchedTasks.head
+ .getCommand
+ .getEnvironment
+ .getVariablesList
+ .asScala
+ assert(envVars
+ .filter(!_.getName.startsWith("SPARK_")).length == 2) //
user-defined secret env vars
--- End diff --
Thanks, I'll fix it.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]