HeartSaVioR commented on a change in pull request #23820: 
[SPARK-22860][CORE][YARN] Redact command line arguments for running Driver and 
Executor before logging (standalone and YARN)
URL: https://github.com/apache/spark/pull/23820#discussion_r260034765
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/util/Utils.scala
 ##########
 @@ -2617,6 +2619,17 @@ private[spark] object Utils extends Logging {
     redact(redactionPattern, kvs.toArray)
   }
 
+  def redactCommandLineArgs(conf: SparkConf, commands: Seq[String]): 
Seq[String] = {
+    val redactionPattern = conf.get(SECRET_REDACTION_PATTERN)
+    commands.map {
+      case PATTERN_FOR_COMMAND_LINE_ARG(key, value) =>
+        val (newKey, newValue) = redact(redactionPattern, Seq((key, 
value))).head
 
 Review comment:
   While I assign key as newKey, actually `key` will not be reacted. Please 
refer `def redact(redactionPattern: Regex, kvs: Seq[(String, String)])` in this 
class.
   
   
https://github.com/apache/spark/blob/4808393449ccad2c6bc73c91d0ed8dd8f60c7054/core/src/main/scala/org/apache/spark/util/Utils.scala#L2584-L2604
   
   I'd just like to rely on the return value for that method to fully leverage 
the method in case of further modification on that method.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to