attilapiros commented on a change in pull request #33550:
URL: https://github.com/apache/spark/pull/33550#discussion_r726236287



##########
File path: 
resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/BasicExecutorFeatureStep.scala
##########
@@ -104,11 +105,14 @@ private[spark] class BasicExecutorFeatureStep(
     // hostname must be no longer than `KUBERNETES_DNSNAME_MAX_LENGTH`(63) 
characters,
     // so take the last 63 characters of the pod name as the hostname.
     // This preserves uniqueness since the end of name contains executorId
-    val hostname = name.substring(Math.max(0, name.length - 
KUBERNETES_DNSNAME_MAX_LENGTH))
-      // Remove non-word characters from the start of the hostname
-      .replaceAll("^[^\\w]+", "")
-      // Replace dangerous characters in the remaining string with a safe 
alternative.
-      .replaceAll("[^\\w-]+", "_")
+    val hostname = if (executorPodNamePrefix.length > 
KUBERNETES_POD_NAME_PREFIX_MAX_LENGTH) {
+      val mamePrefix = KubernetesConf.getResourceNamePrefix(

Review comment:
       Sorry @ulysses-you I was busy with other stuff but I would like to have 
a fix for this problem so yes a new PR is fine for me. 




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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



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

Reply via email to