-
Notifications
You must be signed in to change notification settings - Fork 39.8k
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
Fix setNodeAddress when a node IP and a cloud provider are set #49202
Conversation
Hi @cbonte. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with 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/test-infra repository. I understand the commands that are listed here. |
/lint |
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.
@spxtr: no lint warnings.
In response to this:
/lint
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/test-infra repository.
/ok-to-test |
/retest |
/assign @Random-Liu |
b7e7da4
to
9749d4b
Compare
/retest |
PR has been rebased according to current master branch. |
Does this issue also occur in the cloud controller manager? |
@cbonte Thanks for the PR. It LGTM, except for the part where host IP addresses are used.
I don't think there is a simple answer to this. You could "inject" a interface here - https://github.com/cbonte/kubernetes/blob/25767ae38906ca7dc00c6c6a2935de583c12eaa5/pkg/kubelet/kubelet.go#L846 and in the test, while creating the kubelet object (newTestKubelet method), pass a mock struct to that interface. This is quite a bit of refactoring! Tbh, I'm not entirely sure that relying on the host IP addresses is a bad idea. If that is ok, then we don't need any of this refactoring, and the current tests will suffice. @luxas what would you suggest? |
I tend to agree. Note : I'm currently rebasing the PR again, as some changes since yesterday introduce new conflicts. |
@luxas, sorry this was a bulk remove from the milestone since the PR was unmergable at the time of code freeze (missing either, lgtm, or approve, or had test failures). Added the PR back to the milestone but the PR itself is still unmergable |
/retest |
flake on #50695 |
/test pull-kubernetes-e2e-gce-etcd3 |
/retest |
@Random-Liu @vishh @tallclair @dchen1107 - Can one of you please approve? |
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
Spec: v1.NodeSpec{}, | ||
} | ||
|
||
// TODO : is it possible to mock kubelet.validateNodeIP() to avoid relying on the host interface addresses ? |
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 looked at validateNodeIP()
and there is nothing to prevent it from being a standalone function. I think that'd make testing much easier.
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cbonte, cheftako, liggitt, yujuhong Associated issue: 45201 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
Automatic merge from submit-queue (batch tested with PRs 51728, 49202) |
Hi @yujuhong, is it possible to make this PR as a cherry-pick candidate for release-1.6 ? |
@cbonte you can submit a cherrypick PR. |
Commit found in the "release-1.7" branch appears to be this PR. Removing the "cherrypick-candidate" label. If this is an error find help to get your PR picked. |
What this PR does / why we need it:
When a node IP is set and a cloud provider returns the same address with
several types, only the first address was accepted. With the changes made
in PR #45201, the vSphere cloud provider returned the ExternalIP first,
which led to a node without any InternalIP.
The behaviour is modified to return all the address types for the
specified node IP.
Which issue this PR fixes: fixes #48760
Special notes for your reviewer:
kubelet.validateNodeIP()
to avoid the need of real host interface addresses in the test ?Release note: