-
Notifications
You must be signed in to change notification settings - Fork 26
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
Nodereaper skip label #32
Conversation
Codecov Report
@@ Coverage Diff @@
## master #32 +/- ##
==========================================
+ Coverage 59.10% 59.19% +0.08%
==========================================
Files 5 5
Lines 939 941 +2
==========================================
+ Hits 555 557 +2
Misses 319 319
Partials 65 65
Continue to review full report at Codecov.
|
} | ||
} | ||
|
||
func (u *ReaperUnitTest) RunWithSkipLabel(t *testing.T, timeTest bool, skipLabels []SkipLabel) { |
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.
Mm, do we need a separate method vs. Run()
? seems like extra duplicate code here.
Can we just use Run()
and add Labels
as part of type ReaperUnitTest
? then you can create nodes with the extra argument if len(u.Labels) != 0
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 wanted to minimize touching the existing tests and went with this implementation as there isn't method overloading in Go. But editing the ReaperUnitTest
does seem cleaner. I'll update that.
… moved node label creation to ReaperUnitTest field to remove duplicate code
…he node type label (master/slave) to the list of nodes specified in FakeNode.nodeLabels
…e still get reaped
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.
🥇 Looks good! Thanks
* added node label checks that can be used to skip node reaping * simplify SkipLabel type usage to use existing string label constants, moved node label creation to ReaperUnitTest field to remove duplicate code * moved node labels to FakeNode struct, createNodeLabels will combine the node type label (master/slave) to the list of nodes specified in FakeNode.nodeLabels * updated skipLabelTest's to have skip labels with false to ensure those still get reaped
Added 5 node label flag checks that can be used to skip reaping for a specific node with the given label:
Each label correspond to a specific criteria for reaping, except for governor.keikoproj.io/node-reaper-disabled which ignore reaping regardless of the criteria.
Fixes #30