code: func getAltNames(cfg *kubeadmapi.InitConfiguration, certName string) (*certutil.AltNames, error) {
  	// advertise address
  	advertiseAddress := net.ParseIP(cfg.LocalAPIEndpoint.AdvertiseAddress)
  	if advertiseAddress == nil {
  		return nil, errors.Errorf("error parsing LocalAPIEndpoint AdvertiseAddress %v: is not a valid textual representation of an IP address",
  			cfg.LocalAPIEndpoint.AdvertiseAddress)
  	}
  
  	// create AltNames with defaults DNSNames/IPs
  	altNames := &certutil.AltNames{
  		DNSNames: []string{cfg.NodeRegistration.Name, "localhost"},
  		IPs:      []net.IP{advertiseAddress, net.IPv4(127, 0, 0, 1), net.IPv6loopback},
  	}
  
  	if cfg.Etcd.Local != nil {
  		if certName == kubeadmconstants.EtcdServerCertName {
  			appendSANsToAltNames(altNames, cfg.Etcd.Local.ServerCertSANs, kubeadmconstants.EtcdServerCertName)
  		} else if certName == kubeadmconstants.EtcdPeerCertName {
  			appendSANsToAltNames(altNames, cfg.Etcd.Local.PeerCertSANs, kubeadmconstants.EtcdPeerCertName)
  		}
  	}
  	return altNames, nil
  }
docs: // getAltNames builds an AltNames object with the cfg and certName.