Skip to content
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 -m flag for IPv6 addresses #190

Merged
merged 1 commit into from
Nov 13, 2023

Conversation

nobikik9
Copy link
Contributor

Summary:

--my-hostname (or -m) flag is used to pass hostnames test clients are supposed to talk to. Those are the addresses the tested chef client will be pulling changed cookbooks from. Unfortunately, it doesn't work if you try to pass IPv6 address - you'll get an error. In particular, taste-tester test <test_host> -m [IPv6] won't work.

The underlying problem is that open opening http(s) connection to the provided hostname we use uri.host - this version won't remove [] for IPv6 addresses. There is a replacement uri.hostname which will remove square brackets and make the it work.

Test Plan:

Tested on a host without a change - the error is

Failed to open TCP connection to [IPv6]:port (getaddrinfo: Name or service not known)

When changed client.rb from uri.host to uri.hostname everything work.

Summary:

--my-hostname (or -m) flag is used to pass hostnames test clients are
supposed to talk to. Those are the addresses the tested chef client will
be pulling changed cookbooks from. Unfortunately, it doesn't work if you
try to pass IPv6 address - you'll get an error. In particular,
taste-tester test <test_host> -m [IPv6] won't work.

The underlying problem is that open opening http(s) connection to the
provided hostname we use `uri.host` - this version won't remove [] for IPv6
addresses. There is a replacement `uri.hostname` which will remove
square brackets and make the it work.

Test Plan:

Tested on a host without a change - the error is

```
Failed to open TCP connection to [IPv6]:port (getaddrinfo: Name or service not known)
```

When changed client.rb from `uri.host` to `uri.hostname` everything
work.

Reviewers:

Subscribers:

Tasks:

Tags:
@Farqd Farqd merged commit 1ed5d4e into facebook:main Nov 13, 2023
5 checks passed
@nobikik9 nobikik9 deleted the fix-my-hostname-flag-for-ipv6 branch November 15, 2023 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants