Skip to content
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

fix: bcj doesn't make pod on node that has erased taint #1204

Merged
merged 1 commit into from
Mar 23, 2023

Conversation

weldonlwz
Copy link
Contributor

@weldonlwz weldonlwz commented Mar 6, 2023

Ⅰ. Describe what this PR does

fix the bug that broadcastjob won't make pod when a tainted node has erased its taint

Ⅱ. Does this pull request fix one issue?

fixes #1199

Ⅲ. Describe how to verify it

1.cordon a node
2.apply a new broadcastjob, and the pod will not appear on that cordoned node
3.uncordon that node, a new pod is made

Ⅳ. Special notes for reviews

the returned err of function checkNodeFitness is not error actually, but the reason why the node is not fit

@kruise-bot kruise-bot requested review from Fei-Guo and zmberg March 6, 2023 09:12
@kruise-bot
Copy link

Welcome @weldonlwz! It looks like this is your first PR to openkruise/kruise 🎉

@kruise-bot kruise-bot added the size/M size/M: 30-99 label Mar 6, 2023
@veophi
Copy link
Member

veophi commented Mar 6, 2023

/lgtm

@weldonlwz
Copy link
Contributor Author

@veophi it said check not success, does the commit need any update?

@veophi
Copy link
Member

veophi commented Mar 7, 2023

@veophi it said check not success, does the commit need any update?

@weldonlwz Retried. It is e2e accidental failure.

Maybe we need another reviewer to approve this pr.

/cc @zmberg
/cc @furykerry

@kruise-bot kruise-bot requested a review from furykerry March 7, 2023 02:11
@zmberg
Copy link
Member

zmberg commented Mar 9, 2023

@caniszczyk very good, can you add e2e test in e2e file for this scenarios?

if err != nil {
klog.Errorf("pod %s failed to checkNodeFitness for node %s, %v", pod.Name, node.Name, err)
continue
}
if !canFit {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if !canFit && pod.DeletionTimestamp == nil {
.......
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if !canFit && pod.DeletionTimestamp == nil {
	klog.Infof("Pod %s does not fit on node %s due to %v", pod.Name, node.Name, err)
	podsToDelete = append(podsToDelete, pod)
	continue
}

Am i correct?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

@codecov-commenter
Copy link

codecov-commenter commented Mar 9, 2023

Codecov Report

Attention: Patch coverage is 14.28571% with 6 lines in your changes missing coverage. Please review.

Project coverage is 50.02%. Comparing base (f34bb3d) to head (7b82a58).
Report is 237 commits behind head on master.

Files with missing lines Patch % Lines
...controller/broadcastjob/broadcastjob_controller.go 25.00% 2 Missing and 1 partial ⚠️
...troller/broadcastjob/broadcastjob_event_handler.go 0.00% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1204   +/-   ##
=======================================
  Coverage   50.02%   50.02%           
=======================================
  Files         143      143           
  Lines       19912    19897   -15     
=======================================
- Hits         9960     9954    -6     
+ Misses       8856     8847    -9     
  Partials     1096     1096           
Flag Coverage Δ
unittests 50.02% <14.28%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@zmberg
Copy link
Member

zmberg commented Mar 9, 2023

@weldonlwz Can you add some e2e test, so it can verify whether the function works.

@weldonlwz
Copy link
Contributor Author

it occurs to me that when I taint a node with 'unschedule', we dont expect the pod on that node to be removed, right? if then the logic to set podsToDelete still needs some update.

@zmberg
Copy link
Member

zmberg commented Mar 13, 2023

it occurs to me that when I taint a node with 'unschedule', we dont expect the pod on that node to be removed, right? if then the logic to set podsToDelete still needs some update.

yes, i think so. And what do you want to update PodsToDelete? I see current code logic already meet this scenarios.

@zmberg zmberg added this to the v1.5 milestone Mar 17, 2023
@zmberg
Copy link
Member

zmberg commented Mar 17, 2023

/lgtm

@zmberg
Copy link
Member

zmberg commented Mar 23, 2023

/approve

@kruise-bot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: zmberg

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kruise-bot kruise-bot merged commit 002c5b5 into openkruise:master Mar 23, 2023
kevin1689-cloud pushed a commit to kevin1689-cloud/kruise that referenced this pull request Mar 31, 2023
diannaowa pushed a commit to diannaowa/kruise that referenced this pull request Jun 2, 2023
diannaowa pushed a commit to diannaowa/kruise that referenced this pull request Jun 2, 2023
ppbits pushed a commit to ppbits/kruise that referenced this pull request Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] node has erased its taint,but broadcastjob won't make a pod on that node
5 participants