-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-27258][K8S]Add the prefix 'spark-' for resourceNamePrefix that starts with number #24188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -78,7 +78,10 @@ private[spark] class KubernetesDriverConf( | |
|
|
||
| override val resourceNamePrefix: String = { | ||
| val custom = if (Utils.isTesting) get(KUBERNETES_DRIVER_POD_NAME_PREFIX) else None | ||
| custom.getOrElse(KubernetesConf.getResourceNamePrefix(appName)) | ||
| val resourceNamePrefix = custom.getOrElse(KubernetesConf.getResourceNamePrefix(appName)) | ||
| // If the first character of resourceNamePrefix is number,add the extra prefix : "spark-". | ||
| val prefix = "spark-" + resourceNamePrefix.charAt(0) | ||
| resourceNamePrefix.replaceAll("^[0-9]", prefix) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. BTW, did you run the test locally?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
After execute this code:
resourceNamePrefix = spark-1min-xxx,which satisfies the regular expression
After execute this code:
resourceNamePrefix = min-xxx,which does not change. Local testing was done for this
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not just prepend "spark-" if the first character is a digit?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Hi, this code does not change the resourceNamePrefix that the first character is not a digit. 1: For example: resourceNamePrefix = 1min-xxx
resourceNamePrefix = spark-1min-xxx, 2 : For example : resourceNamePrefix = min-xxx
resourceNamePrefix = min-xxx,which does not change.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know, it's just more complex than it needs to be, and doesn't catch all the cases that would fail the pattern you show above: |
||
| } | ||
|
|
||
| override def labels: Map[String, String] = { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This variable name is confusing since this is in
override val resourceNamePrefix: String = {}.