-
Notifications
You must be signed in to change notification settings - Fork 46
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
Add taint function and taints property to Node #530
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #530 +/- ##
==========================================
+ Coverage 94.61% 95.14% +0.52%
==========================================
Files 29 30 +1
Lines 3141 4077 +936
==========================================
+ Hits 2972 3879 +907
- Misses 169 198 +29 ☔ View full report in Codecov by Sentry. |
kr8s/_objects.py
Outdated
await self.async_patch( | ||
{"spec": {"taints": [{"effect": effect, "key": key, "value": value}]}} | ||
) |
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.
If there are already taints will this not replace them all with this new taint? We might need to do "op": "add"
here instead.
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.
Good point.
Looking at kubectl taint nodes ... my-key=value1:NoSchedule -v10
, I see it makes two calls, one to get all the taints, and another one update it. I updated this PR to copy what kubectl
does.
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.
Awesome thanks @thomasjpfan
Addresses part of #326
This PR adds:
taints
property, sonodes.taints
gives you access to the taints.taint
function to add a tainteffect="NoSchedule-"
that remove the taint. This is consistent with howkubectl
works for removing a taint.