-
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
Filter out IPV6 addresses from NodeAddresses() returned by vSphere #45181
Filter out IPV6 addresses from NodeAddresses() returned by vSphere #45181
Conversation
Hi @BaluDontu. 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 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. |
/assign @abrarshivani |
@k8s-bot ok to test |
@@ -63,3 +65,8 @@ func GetgovmomiClient(cfg *VSphereConfig) (*govmomi.Client, error) { | |||
client, err := newClient(context.TODO(), cfg) | |||
return client, err | |||
} | |||
|
|||
func IsIpv4Address(str string) bool { | |||
ip := net.ParseIP(str) |
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 you use To4() method from net package.
ip := net.ParseIP(str).To4()
For ipv6 address ip
will be set to nil.
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.
Addressed this in latest commit.
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.
ccab22d
to
0b469f4
Compare
@k8s-bot verify test this |
/approve |
@k8s-bot verify test this |
6a76b78
to
d05b279
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: BaluDontu, abrarshivani
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
Automatic merge from submit-queue |
…45569-kubernetes-release-1.6 Automatic merge from submit-queue Automated cherry pick of #45181 #45569 upstream release 1.6 Cherry pick of #45181 #45569 on release-1.6. #45181: Filter out IPV6 addresses from NodeAddresses() returned by vSphere #45569: Fixing VolumesAreAttached and DisksAreAttached functions in vSphere @BaluDontu @luomiao @tusharnt
The vSphere CP returns both IPV6 and IPV4 addresses for a Node as part of NodeAddresses() implementation. However, Kubelet fails due to duplicate api.NodeAddress value when the node has an IPV6 address associated with it. This issue is tracked in #42690. The following are observed:
However, when we filter out the IPV6 addresses and only return IPV4 addresses to the Kubelet, it works perfectly fine.
Even though the Kubelet receives the non-duplicate node-addresses, it still errors out with duplicate node addresses. It might be an issue when kubelet propagates these addresses to API server (or) API server is enable to handle IPV6 addresses.
@divyenpatel @abrarshivani @pdhamdhere @tusharnt
Release note: