-
Notifications
You must be signed in to change notification settings - Fork 868
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[KYUUBI #3385] Set executor pod name prefix if missing in spark on k8…
…s case ### _Why are the changes needed?_ See more in #3590 For #3590 this PR is reverted, and author not reply for long time. Fix this issue #3385 here. ### _How was this patch tested?_ - [x] Add some test cases that check the changes thoroughly including negative and positive cases if possible - [ ] Add screenshots for manual tests if appropriate - [ ] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request Closes #3913 from zwangsheng/k8s/set_executor_pod_name_prefix. Closes #3385 64b2c6b [zwangsheng] fix for review b58ff3f [zwangsheng] add unit test cb0ad9f [zwangsheng] fix 7a36292 [zwangsheng] init Authored-by: zwangsheng <2213335496@qq.com> Signed-off-by: Cheng Pan <chengpan@apache.org>
- Loading branch information
1 parent
4efd4d0
commit 46ffc7b
Showing
4 changed files
with
77 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
...-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/SparkSQLEngineSuite.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.kyuubi.engine.spark | ||
|
||
import org.apache.kyuubi.KyuubiFunSuite | ||
|
||
class SparkSQLEngineSuite extends KyuubiFunSuite { | ||
|
||
test("[KYUUBI #3385] generate executor pod name prefix with user or UUID") { | ||
val userName1 = "/kyuubi_user+-*" | ||
val executorPodNamePrefix1 = SparkSQLEngine.generateExecutorPodNamePrefixForK8s(userName1) | ||
assert(executorPodNamePrefix1.contains("-kyuubi-user-")) | ||
|
||
val userName2 = "LongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLong" + | ||
"LongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLong" + | ||
"LongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLong" + | ||
"LongLongLongLongLongLongLongLongLongLongLongLongName" | ||
val executorPodNamePrefix2 = SparkSQLEngine.generateExecutorPodNamePrefixForK8s(userName2) | ||
assert(!executorPodNamePrefix2.contains(userName2)) | ||
assert(executorPodNamePrefix2.length <= SparkSQLEngine.EXECUTOR_POD_NAME_PREFIX_MAX_LENGTH) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters