code: func SetAPIEndpointDynamicDefaults(cfg *kubeadmapi.APIEndpoint) error {
  	// validate cfg.API.AdvertiseAddress.
  	addressIP := net.ParseIP(cfg.AdvertiseAddress)
  	if addressIP == nil && cfg.AdvertiseAddress != "" {
  		return errors.Errorf("couldn't use \"%s\" as \"apiserver-advertise-address\", must be ipv4 or ipv6 address", cfg.AdvertiseAddress)
  	}
  	// This is the same logic as the API Server uses, except that if no interface is found the address is set to 0.0.0.0, which is invalid and cannot be used
  	// for bootstrapping a cluster.
  	ip, err := ChooseAPIServerBindAddress(addressIP)
  	if err != nil {
  		return err
  	}
  	cfg.AdvertiseAddress = ip.String()
  
  	return nil
  }
docs: // SetAPIEndpointDynamicDefaults checks and sets configuration values for the APIEndpoint object