func (r *ConfigMapReconciler) parseHosts(configMapData map[string]string) ([]*instances.InstanceInfo, error) {
	hosts := make([]*instances.InstanceInfo, 0)
	// Get information about the hosts from each entry. The expected key/value format for each entry is:
	// <address>: username=<username>
	for address, data := range configMapData {
		if err := validateAddress(address); err != nil {
			return nil, errors.Wrapf(err, "invalid address %s", address)
		}
		splitData := strings.SplitN(data, "=", 2)
		if len(splitData) == 0 || splitData[0] != "username" {
			return hosts, errors.Errorf("data for entry %s has an incorrect format", address)
		}

		hosts = append(hosts, instances.NewInstanceInfo(address, splitData[1], ""))
	}
	return hosts, nil
}
// parseHosts gets the lists of hosts specified in the configmap's data
parseHosts gets the lists of hosts specified in the configmap's data
// parseHosts gets the lists of hosts specified in the configmap ' s data
func (r *ConfigMapReconciler) parseHosts(configMapData map[string]string) ([]*instances.InstanceInfo, error) {
	hosts := make([]*instances.InstanceInfo, 0)
	for address, data := range configMapData {
		if err := validateAddress(address); err != nil {
			return nil, errors.Wrapf(err, "invalid address %s", address)
		}
		splitData := strings.SplitN(data, "=", 2)
		if len(splitData) == 0 || splitData[0] != "username" {
			return hosts, errors.Errorf("data for entry %s has an incorrect format", address)
		}
		hosts = append(hosts, instances.NewInstanceInfo(address, splitData[1], ""))
	}
	return hosts, nil
}
func ( r * ConfigMapReconciler ) parseHosts ( configMapData map [ string ] string ) ( [ ] * instances . InstanceInfo , error ) { hosts := make ( [ ] * instances . InstanceInfo , 0 ) for address , data := range configMapData { if err := validateAddress ( address ) ; err != nil { return nil , errors . Wrapf ( err , " " , address ) } splitData := strings . SplitN ( data , " " , 2 ) if len ( splitData ) == 0 || splitData [ 0 ] != " " { return hosts , errors . Errorf ( " " , address ) } hosts = append ( hosts , instances . NewInstanceInfo ( address , splitData [ 1 ] , " " ) ) } return hosts , nil }
parseHosts gets the lists of hosts specified in the configmap's data
parseHosts gets the lists of hosts specified in the configmap ' s data
// Get information about the hosts from each entry. The expected key/value format for each entry is: // <address>: username=<username>