You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: utils.go
    path of file: ./repos/sealer/pkg/runtime/k0s
    
    the code of the file until where you have to start completion: // Copyright Â© 2022 Alibaba Group Holding Ltd.
//
// License
    
func (k *Runtime) getNodeName(host net.IP) (string, error) {
	client, err := k8s.NewK8sClient()
	if err != nil {
		return "", err
	}
	nodeList, err := client.ListNodes()
	if err != nil {
		return "", err
	}
	var hosts []string
	for _, node := range nodeList.Items {
		hosts = append(hosts, node.GetName())
	}

	hostName, err := k.infra.CmdToString(host, nil, "hostname", "")
	if err != nil {
		return "", err
	}

	var name string
	for _, h := range hosts {
		if strings.TrimSpace(h) == "" {
			continue
		}
		hh := strings.ToLower(h)
		fromH := strings.ToLower(hostName)
		if hh == fromH {
			name = h
			break
		}
	}
	return name, nil
}