yunikorn-k8shim icon indicating copy to clipboard operation
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.

Open 0yukali0 opened this issue 2 years ago • 1 comments

What is this PR for?

  1. The iteration is not required for searching userLabelKey.
  2. The logger adopting debug level show the current userLabelKey
  3. 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. 截圖 2022-09-09 下午11 24 30

Questions:

  • [ ] - The licenses files need update.
  • [ ] - There is breaking changes for older versions.
  • [ ] - It needs documentation.

0yukali0 avatar Sep 09 '22 16:09 0yukali0

Codecov Report

Merging #462 (cbadd8b) into master (1f050c4) will decrease coverage by 0.01%. The diff coverage is 100.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

codecov[bot] avatar Sep 09 '22 16:09 codecov[bot]

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?

0yukali0 avatar Sep 16 '22 04:09 0yukali0

re-running the tests see if it is consistently breaking or not.

wilfred-s avatar Sep 27 '22 04:09 wilfred-s

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.

wilfred-s avatar Sep 29 '22 07:09 wilfred-s

Hi @wilfred-s I will check this case and update the commit tonight.

0yukali0 avatar Sep 30 '22 09:09 0yukali0