util: tools to drain and uncordon cluster#1060
Conversation
b46d854 to
221a497
Compare
| return nil, err | ||
| } | ||
|
|
||
| hubClient, err := client.New(restConfig, client.Options{Scheme: scheme}) |
There was a problem hiding this comment.
does this client use cache?
There was a problem hiding this comment.
Currently it doesn't use cache https://github.com/kubernetes-sigs/controller-runtime/blob/main/pkg/client/client.go#L82-L89
|
Hi Arvind! Below are some of the points I've been thinking about since our earlier discussion; hopefully they can be of use/relevance to you: |
a) The |
|
b) as discussed earlier in our sync, if we would like to implement stronger consistency in the draining tool, options would include
There might not be a very easily approachable solution here 😞 |
|
c) With that being said, it might make more sense for us to evaluate how important the stronger consistency is to our users, esp. considering that |
|
d) A side note is that, |
|
Persistent review updated to latest commit 7fa0c3f |
|
Persistent review updated to latest commit 729c015 |
|
Persistent review updated to latest commit e657966 |
|
Persistent review updated to latest commit d7eebb8 |
michaelawyu
left a comment
There was a problem hiding this comment.
Added a number of comments, PTAL
|
Persistent review updated to latest commit fc6ae91 |
|
Persistent review updated to latest commit 7c34d23 |
|
Persistent review updated to latest commit c715acf |
|
Persistent review updated to latest commit e4717e6 |
|
Persistent review updated to latest commit eb20eee |
|
Persistent review updated to latest commit a369776 |
|
Persistent review updated to latest commit f00d3ad |
| } | ||
| } | ||
| executedCondition := eviction.GetCondition(string(placementv1beta1.PlacementEvictionConditionTypeExecuted)) | ||
| if executedCondition == nil || executedCondition.Status == metav1.ConditionFalse { |
There was a problem hiding this comment.
Hi Arvind! It's not a blocker per se but I still believe that we should reply on API semantics for validations in this regard.
| } | ||
| } | ||
| executedCondition := eviction.GetCondition(string(placementv1beta1.PlacementEvictionConditionTypeExecuted)) | ||
| if executedCondition == nil || executedCondition.Status == metav1.ConditionFalse { |
There was a problem hiding this comment.
Plus, even with the function you mentioned, unknown Valid condition can still pass the check, so are unknown Executed conditions.
michaelawyu
left a comment
There was a problem hiding this comment.
Added a few other nits; otherwise LGTM.
|
Persistent review updated to latest commit 1885458 |
Description of your changes
Adding new tools to drain and uncordon cluster
Fixes #
I have:
make reviewableto ensure this PR is ready for review.How has this code been tested
Special notes for your reviewer
If drain fails we automatically uncordon cluster