-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Allow to balance nodes using specified labels #3839
Closed
Closed
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
As suggested, I created a new
comparator
to acceptlabels
instead ofextraIgnoredLabels
, and compare nodes based on the specified labels. This--balancing-labels
arg here bypasses the--balancing-ignored-labels
flag. This also ignores the cloud provider-specific basic ignored flags. This calls for some discussion.Rather than creating a new
comparator
, I'd personally prefer to edit the signature of the current comparator creators to accept an extra argument forlabels
in addition toextraIgnoredLabels
, and compare the nodes for matching labels specified inlabels
iflabels
is not empty. If check fails, then we return, else we proceed to callIsCloudProviderNodeInfoSimilar
, which takes care of ignored labels.@MaciekPytel please share your thoughts and review here.
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 think the second implementation idea doesn't change current behavior at all. Currently every label that is not on ignored-labels list will cause the node groups to compare as different. Checking
--balancing-labels
first doesn't change the ultimate result, it just fails the comparison slightly earlier.My understanding of #3615 is that specifying
--balancing-labels
makes comparison treat any label not on the list as ignored-label (current implementation treats any label that is not on ignored list as "balancing labels"). I think that:--balancing-labels
and--balancing-ignored-labels
makes no sense. What would be the behavior for any label not on either list?--balancing-labels
(since we would be ignoring all labels not on the list).--balancing-labels are specified
, but there are plenty of other ways to refactor and I don't feel particularly strongly about which is the right one.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.
👍 to
--balancing-labels
and--balancing-ignored-labels
mutually exclusive--balancing-labels
IsCloudProviderNodeInfoSimilar
as you said. Since this is my first issue on CA, I was a bit hesitant to do much refactoring. Thanks for asserting my thoughts.