ulysses-you commented on a change in pull request #33550:
URL: https://github.com/apache/spark/pull/33550#discussion_r693642658
##########
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:
@attilapiros sorry for the late response. I checked existed code,
seems there are many places which produce the different `uniqueID`:
* `KubernetesDriverConf`
* `KubernetesExecutorConf`
* `KubernetesClientUtils`
* `DriverServiceFeatureStep`
Do you think we should make `uniqueID` as a global value ? If so, seems it's
worth to do this change in a new PR.
--
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]