You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/03/28 10:12:43 UTC

[GitHub] [spark] hehuiyuan commented on a change in pull request #24219: [SPARK-27258][K8S]Deal with the k8s resource names that don't match their own regular expression

hehuiyuan commented on a change in pull request #24219: [SPARK-27258][K8S]Deal with the k8s resource names that don't match their own regular expression 
URL: https://github.com/apache/spark/pull/24219#discussion_r269184055
 
 

 ##########
 File path: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/KubernetesConf.scala
 ##########
 @@ -198,5 +198,6 @@ private[spark] object KubernetesConf {
       .replaceAll("\\.", "-")
       .replaceAll("[^a-z0-9\\-]", "")
       .replaceAll("-+", "-")
+      .replaceAll("^-", "")
 
 Review comment:
   Please look at the code carefully. **I replaced the first character**.
   
   The first character is '-',which is not allowed for Pod and Secret and Service etc .
   
   `private val preferredServiceName = s"${kubernetesConf.resourceNamePrefix}$DRIVER_SVC_POSTFIX"
   `
   
   Then the first character of preferredServiceName is 0-9 or a-z, we only check the first character that is 0-9 or a-z.
   if the first character is a-z,we use preferredServiceName as the Service name.
   Otherwise ,the first character is 0-9,we use shorterServiceName as the Service name.
   

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org