Skip to content

Commit

Permalink
Merge pull request #116 from tyler-lloyd/cleanup-ipv6
Browse files Browse the repository at this point in the history
Cleanup ipv6
  • Loading branch information
seeker89 authored Apr 15, 2022
2 parents 5cc9bd5 + d976605 commit 1a9ae3a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ You can also see [an example of using `kubeconfig` in the `./extras`](./extras/e

### Using with IPv4/IPv6 dual-stack

If your pods having IPv4 and IPv6 addresses assigned and you want to test communication over IPv6, you can specify the `USE_IPV6` environment variable which will use the IPv6 address on the pod and host.
If your cluster IPv4/IPv6 dual-stack and you want to force IPv6, you can set the `IP_VERSIONS` environment variable to "6" (default is "4") which will use the IPv6 address on the pod and host.

![ipv6](./extras/screenshot-ipv6.png)

Expand Down
3 changes: 2 additions & 1 deletion pkg/goldpinger/k8s.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ func getHostIP(p v1.Pod) string {

var hostIP string
for _, addr := range node.Status.Addresses {
if ipMatchesConfig(addr.Address) {
if (addr.Type == v1.NodeInternalIP || addr.Type == v1.NodeExternalIP) &&
ipMatchesConfig(addr.Address) {
hostIP = addr.Address
}
}
Expand Down

0 comments on commit 1a9ae3a

Please sign in to comment.