func getHostNames()

in pkg/containerd/store.go [346:362]


func getHostNames(hosts []string) []string {
	names := []string{}
	for _, host := range hosts {
		if !strings.HasPrefix(host, "http://") && !strings.HasPrefix(host, "https://") {
			host = "http://" + host
		}

		u, err := url.Parse(host)
		if err != nil {
			// Use the host as is.
			names = append(names, host)
		} else {
			names = append(names, u.Host)
		}
	}
	return names
}