-
Notifications
You must be signed in to change notification settings - Fork 494
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
imdsclient: return a single hostname from fetch_hostname
#3032
Conversation
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.
Assuming testing goes well, this looks good to me.
I don't actually think it would be worth it, but I noticed there is a library out there that could be used to set up some unit testing for this. Just pointing out in case it is helpful in any way with manually testing things.
Updated the testing in the description and pulled out of draft |
Added additional testing on a subnet with RBN enabled. |
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.
Typo in the commit, potentiall
.
The `fetch_hostname` method queries the `metadata/local-hostname` IMDS target, which has the potential to return multiple space-delimited hostnames. This changes the method to return only the first hostname in the list.
4108f1a
to
9c74ffb
Compare
^ Fixed the typo in the commit message. Thanks @arnaldo2792 |
Issue number:
Related to #3031
Description of changes:
The
fetch_hostname
method queries themetadata/local-hostname
IMDS target, which has the potential to return multiple space-delimited hostnames. This changes the method to return only the first hostname in the list.Testing done:
Build and booted an
aws-k8s-1.24
node into a VPC setup with a DHCP option set with multiple domain names.Confirmed IMDS returns multiple hostnames from the
meta-data/local-hostname
endpoint:Confirmed my node has the proper hostname set in
/proc/sys/kernel/hostname
and insettings.network.hostname
Confirm the node properly joins the cluster and has the expected name:
Also turned on RBN in my subnet and launched another instance to validate we see the same correct behavior:
Terms of contribution:
By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.