yunikorn-k8shim
yunikorn-k8shim copied to clipboard
[YUNIKORN-1314] The current UserkeyLabel is showed in log when user name couldn't be found in pod's labels.
What is this PR for?
- The iteration is not required for searching userLabelKey.
- The logger adopting debug level show the current userLabelKey
- The userLabelKey would be replaced by the default userLabelKey when the userLabelKey returned from the configuration is empty.
What type of PR is it?
- [ ] - Bug Fix
- [x] - Improvement
- [ ] - Feature
- [ ] - Documentation
- [ ] - Hot Fix
- [ ] - Refactoring
Todos
- [ ] - Task
What is the Jira issue?
https://issues.apache.org/jira/browse/YUNIKORN-1314
How should this be tested?
Pods' labels contains userLabelKey and the username rule is added to the partition.
metadata:
labels:
app: nginx
applicationId: "username-rule-example02"
yunikorn.apache.org/username: developer
name: task1
spec:
schedulerName: yunikorn
partitions:
-
name: default
placementrules:
- name: user
create: true
- name: tag
value: namespace
create: true
queues:
- name: root
submitacl: '*'
Screenshots (if appropriate)
For example, an user, called developer, owns a pod.
The queue doesn't exist or the queue label is not added in the pod.
The pod would be assigned to root.developer.
Questions:
- [ ] - The licenses files need update.
- [ ] - There is breaking changes for older versions.
- [ ] - It needs documentation.
Codecov Report
Merging #462 (cbadd8b) into master (1f050c4) will decrease coverage by
0.01%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## master #462 +/- ##
==========================================
- Coverage 67.00% 66.98% -0.02%
==========================================
Files 41 41
Lines 6767 6769 +2
==========================================
Hits 4534 4534
- Misses 2062 2064 +2
Partials 171 171
Impacted Files | Coverage Δ | |
---|---|---|
pkg/common/utils/utils.go | 59.39% <100.00%> (+0.49%) |
:arrow_up: |
pkg/dispatcher/dispatcher.go | 74.82% <0.00%> (-1.40%) |
:arrow_down: |
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more
Hi @wilfred-s, Is the time-out event for waiting yunikorn pod related to GetUserFromPod in e2e test when the Kubernetes version is 1.25? Should I re-run the pre-commit check?
re-running the tests see if it is consistently breaking or not.
Test failed, not sure if it is the same one. Plugin with K8s 1.25 has been the problem, maybe @craigcondit knows more. @0yukali0 can you have a look at my comment around the empty value that point is not resolved yet.
Hi @wilfred-s I will check this case and update the commit tonight.