1
0
mirror of https://github.com/ceph/ceph-csi.git synced 2024-12-28 16:00:22 +00:00
ceph-csi/vendor/github.com/go-task/slim-sprig/network.go
Niels de Vos 6709cdd1d0 rebase: update github.com/onsi/ginkgo to v2.9.5
There was a `replace` statement in `go.mod` that prevented Ginkgo from
updating. Kubernetes 1.27 requires a new Ginkgo version.

Signed-off-by: Niels de Vos <ndevos@ibm.com>
2023-06-06 12:21:43 +00:00

13 lines
214 B
Go

package sprig
import (
"math/rand"
"net"
)
func getHostByName(name string) string {
addrs, _ := net.LookupHost(name)
//TODO: add error handing when release v3 comes out
return addrs[rand.Intn(len(addrs))]
}