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-492065168 > There are some public utility methods that could be used offered by the fabric8io client for this purprose: > https://github.com/fabric8io/kubernetes-client/blob/v4.2.2/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/utils/KubernetesResourceUtil.java > For example `io.fabric8.kubernetes.client.utils.KubernetesResourceUtil.{sanitizeName(),isValidName()}` methods etc. > This way code is cleaner and we dont need to maintain changes as K8s evolves. Hi, that sounds good. This class supports many methods. But I don't found the method that processes the first character of resourceName is `-` and checks the name of Service in KubernetesResourceUtil . Service is different from the others. ``` The regex of Servive is ^[a-z]([-a-z0-9]*[a-z0-9])?. The regex of Pod is ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*. The regex of Secret is ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*. ```
---------------------------------------------------------------- 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]
