-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
feat(source): optional exclusion of unschedulable nodes #5045
base: master
Are you sure you want to change the base?
feat(source): optional exclusion of unschedulable nodes #5045
Conversation
Welcome @Hayajiro! |
Hi @Hayajiro. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
@Hayajiro you need to sign the CLA in order for this PR to be reviewed. |
I'm fully aware of this, but CLA signing is still in process. |
44aaa51
to
66fcece
Compare
CLA is finally signed. 🎉 Also rebased with master and fixed the conflicts. So I guess this is ready for review now? |
/ok-to-test |
@@ -102,7 +104,7 @@ func (ns *nodeSource) Endpoints(ctx context.Context) ([]*endpoint.Endpoint, erro | |||
continue | |||
} | |||
|
|||
if node.Spec.Unschedulable { | |||
if node.Spec.Unschedulable && ns.excludeUnschedulable { |
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.
Can we add tests that capture debug logging?
external-dns/internal/testutils/log.go
Line 36 in e64e536
func LogsToBuffer(level log.Level, t *testing.T) *bytes.Buffer { |
You could search for example usages in the code.
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.
Sorry for the late response, but I've been pretty busy the last couple weeks.
I've now added an example of how this could be implemented in the existing test method (which would allow the other testcases to check for logs, as well. Not quite ideal, as this requires disabling parallelism for these testcases, but the alternative would be having to duplicate more of the test logic, which I'm not really a fan of, either.
66fcece
to
3d75a27
Compare
Not sure why there are apparently data races, as I can't really reproduce them locally... |
Feels like our logger is not implemented correctly for tests. Could you try something like here external-dns/source/gateway_httproute_test.go Line 1222 in e456a45
external-dns/source/gateway_httproute_test.go Line 1252 in e456a45
If not going to work, will test logging next time, when I have a more stable framework |
When running with Turns out the problem lies with the fact that, after calling to When calling to @ivankatliarchuk How do you want to proceed with this? While the fix itself seems to be fairly simple, I'm not quite sure if this is still in scope for this PR. Edit: Okay, now I can't reproduce this locally anymore and the CI is also green. I feel like this is definitely a flake. |
Yeah, is another bug that not related to current work/fix. |
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.
/lgtm
cc: @mloiseleur
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: ivankatliarchuk The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This fixes a behavioral regression introduced in kubernetes-sigs#4761, where nodes that were previously added to DNS are removed when they are considered unschedulable, for example due to automated maintenance tasks. This change will introduce a new flag called `exclude-unschedulable`, which defaults to `true` in order to keep in line with the current behavior. However, it would also be reasonable to restore the initial behavior before
This commit adds the required logic to be able to test for the existence (and absence) of certain log messages in testNodeSourceEndpoints. As an example, this is implemented for the tests around excludeUnschedulable. A side effect of using LogsToBuffer is that tests can't run in parallel due to the log buffer being shared across all parallel test cases. As such, these specific tests are now executed one after another.
2b4e844
to
8f61c0f
Compare
New changes are detected. LGTM label has been removed. |
Hi @Hayajiro any chance not to force push? I'm not sure now what was reviewed |
/label tide/merge-method-squash |
Well, it was stated that the MR needs rebasing, sooo.... |
/retitle feat(source): optional exclusion of unschedulable nodes |
Description
This fixes a behavioral regression introduced in #4761, where nodes that were previously added to DNS are removed when they are considered unschedulable, for example due to automated maintenance tasks.
This change will introduce a new flag called
exclude-unschedulable
, which defaults totrue
in order to keep in line with the current behavior. However, it would also be reasonable to restore the initial behavior before #4761, which would mean to not exclude unschedulable nodes by default.Fixes #4991
Checklist