hehuiyuan commented on issue #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#issuecomment-478238554
 
 
   > Instead of adding more ad-hoc tests, I think it's better to just check if 
the preferred name is valid using 
`com.google.common.net.InternetDomainName.isValid`. It seems to do a better job 
than the checks that were put in this code originally.
   
   `.replaceAll("^-", "")` ,we can use the code to avoid that the first 
character of all kubernetes resources(Pod ,Service,Secret,etc) name is '-'.
   Then `Character.isLetter(preferredServiceName.charAt(0)` is used to checking 
the Service name

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