Skip to content

Commit

Permalink
replace isDigt with isLetter
Browse files Browse the repository at this point in the history
  • Loading branch information
hehuiyuan authored and hehuiyuan committed Mar 27, 2019
1 parent 3a53d48 commit 6af6557
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ private[spark] class DriverServiceFeatureStep(

private val preferredServiceName = s"${kubernetesConf.resourceNamePrefix}$DRIVER_SVC_POSTFIX"
private val resolvedServiceName = if (preferredServiceName.length <= MAX_SERVICE_NAME_LENGTH
&& !Character.isDigit(preferredServiceName.charAt(0))) {
&& 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) " +
s"or the first character of $preferredServiceName is digit which is not support." +
s"or the first character of $preferredServiceName is not letter which is not support." +
s" Falling back to use $shorterServiceName as the driver service's name.")
shorterServiceName
}
Expand Down

0 comments on commit 6af6557

Please sign in to comment.