srowen 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_r292055604
 
 

 ##########
 File path: 
resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/DriverServiceFeatureStep.scala
 ##########
 @@ -39,14 +39,16 @@ private[spark] class DriverServiceFeatureStep(
       "managed via a Kubernetes service.")
 
   private val preferredServiceName = 
s"${kubernetesConf.resourceNamePrefix}$DRIVER_SVC_POSTFIX"
-  private val resolvedServiceName = if (preferredServiceName.length <= 
MAX_SERVICE_NAME_LENGTH) {
+  private val resolvedServiceName = if (preferredServiceName.length <= 
MAX_SERVICE_NAME_LENGTH
+    && Character.isLetter(preferredServiceName.charAt(0))) {
     preferredServiceName
   } else {
     val randomServiceId = KubernetesUtils.uniqueID(clock = clock)
     val shorterServiceName = s"spark-$randomServiceId$DRIVER_SVC_POSTFIX"
     logWarning(s"Driver's hostname would preferably be $preferredServiceName, 
but this is " +
-      s"too long (must be <= $MAX_SERVICE_NAME_LENGTH characters). Falling 
back to use " +
-      s"$shorterServiceName as the driver service's name.")
+      s"too long (must be <= $MAX_SERVICE_NAME_LENGTH characters) " +
+      s"or the first character of $preferredServiceName is not letter which is 
not support." +
 
 Review comment:
   That I don't know ... @skonto?

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

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

Reply via email to