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

 ##########
 File path: 
resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/DriverServiceFeatureStep.scala
 ##########
 @@ -39,14 +39,15 @@ 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))) {
 
 Review comment:
   Yeah I saw that when digging into it. It should be ok from what I read: 
https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/ 
"Assume a Service named foo in the Kubernetes namespace bar. A Pod running in 
namespace bar can look up this service by simply doing a DNS query for foo. A 
Pod running in namespace quux can look up this service by doing a DNS query for 
foo.bar." so it matches the domain label, that is why there are these 
limitations.

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