-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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
[SPARK-26420][k8s] Generate more unique IDs when creating k8s resource names. #23805
Closed
Closed
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Hi, @vanzin . Can we check the actual pattern you introduced here? Maybe, we can use
.startWith
and.endWith
.Negative assertions(at line 106 and 109) looks insufficient to check the new logic. I know this test case is focusing only on the long name case. If something happens on the patterns, this test doesn't catch the change at all. Previously, we check the name pattern exactly in this test case.
Another test case is doing some check the post-fix pattern, but it's also partial because it used kconf.resourceNamePrefix.
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.
I'm not sure what you mean by that.
It's not possible to have a positive test. The whole point of the change is to introduce randomness to the identifier being generated.
The tests set the resource prefix to something that does not start with
spark-
, which is the prefix that is used in the auto-generated path. So checking that the final identifier does not start with the requested prefix is enough to test that the change is occurring.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.
The randomness is not about the whole string. It's only about a part of it. Specifically, this PR changes this test case from
spark-10000-driver-svc
tospark-b805936936efbcd5-driver-svc
.Previously, the randomness is determined by time,
10000
. Now, it has a better string,b805936936efbcd5
.What I asked is adding the following two lines as a positive test case.
The other stuff of this PR looks good. I like this PR.
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.
I totally agree with you. So, I mentioned like
I know this test case is focusing only on the long name case
.There was no other test case to check this new pattern. So, I asked to keep some coverage.
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.
What new pattern? The generated service name? Why is it interesting to test it?
The test checks that the long name is not used. It doesn't matter what name is used as long as it's not the long name. And that's already achieved by the test. As you've said yourself.
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.
I changed the test to check uniqueness. But checking that the generated name follows a specific pattern is a rather pointless test.