Uh oh!
There was an error while loading. Please reload this page.
[SPARK-27258][K8S]Deal with the k8s resource names that don't match their own regular expression - #24219
[SPARK-27258][K8S]Deal with the k8s resource names that don't match their own regular expression #24219hehuiyuan wants to merge 4 commits into
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
vanzin
commented
Mar 26, 2019
Instead of adding more ad-hoc tests, I think it's better to just check if the preferred name is valid using |
Uh oh!
There was an error while loading. Please reload this page.
hehuiyuan
commented
Mar 30, 2019
|
SparkQA
commented
Mar 31, 2019
Test build #4671 has finished for PR 24219 at commit
|
There are some public utility methods that could be used offered by the fabric8io client for this purprose: |
hehuiyuan
commented
May 14, 2019
Hi, that sounds good. This class supports many methods. But I don't found the method that processes the first character of resourceName is Service is different from the others. |
|
hehuiyuan
commented
May 14, 2019
That sounds good. |
hehuiyuan
commented
May 14, 2019
via email
service name is a-z ,which is not a-z0-9 …---Original---
From: "Stavros Kontopoulos"<notifications@github.com>
Date: Tue, May 14, 2019 17:06 PM
To: "apache/spark"<spark@noreply.github.com>;
Cc: "Author"<author@noreply.github.com>;"hehuiyuan"<471627698@qq.com>;
Subject: Re: [apache/spark] [SPARK-27258][K8S]Deal with the k8s resource names that don't match their own regular expression (#24219)
isValidName() method uses "a-z0-9?" which is in compliance with the k8s codebase for DNS-1123 labels and works for service names.
Sanitize does not fix the dash issue as a first character I agree, btw this happened before because of truncation, but the sanitize method could be improved or re-use the logic for the executor pod names here.
So its not just dash. I would refactor the code and use only one method to sanitize resourceNamePrefix because resourceNamePrefix can be used by the executor pods for the hostname thing anyway.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread. |
@hehuiyuan I removed that comment :) , yes indeed no digits. |
Hi, I have extracted the methods to get the name of the resources for Service / Pod / Secret / ConfigMap etc. But this PR doesn't found my branch. |
skonto
commented
Jun 3, 2019
@hehuiyuan any progress on this one? |
Is this your meaning ? |
skonto
commented
Jun 7, 2019
I mean are all the comments addressed? I think vanzin has one above. @srowen should this be merged? |
| s"too long (must be <= $MAX_SERVICE_NAME_LENGTH characters). Falling back to use " + | ||
| s"$shorterServiceName as the driver service's name.") | ||
| s"too long (must be <= $MAX_SERVICE_NAME_LENGTH characters) " + | ||
| s"or the first character of $preferredServiceName is not letter which is not support." + |
There was a problem hiding this comment.
support -> supported.
You could just say "or is not a valid service name"
There was a problem hiding this comment.
OK! But there are some conflicts at present.
There was a problem hiding this comment.
@srowen Hi, i have a question that is how to deal with the prefix of user-defined pod.
It handles the default prefix of podName in this PR .
Is there any need for further treatment or it's necessary to explain it for KUBERNETES_EXECUTOR_POD_NAME_PREFIX and KUBERNETES_DRIVER_POD_NAME in the doc.
overridevalresourceNamePrefix:String= {
get(KUBERNETES_EXECUTOR_POD_NAME_PREFIX).getOrElse(
KubernetesConf.getResourceNamePrefix(appName))
}
privatevaldriverPodName= conf
.get(KUBERNETES_DRIVER_POD_NAME)
.getOrElse(s"${conf.resourceNamePrefix}-driver")
Uh oh!
There was an error while loading. Please reload this page.


What changes were proposed in this pull request?
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 Servive is
^[a-z]([-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])?)*.If --name=-min, the first character is '-' ,which does not satisfy the regex for Pod ,Service,Secret.
if --name=1min, the first character is digit, which does not satisfy the regex for Service.