agent/api/task/task.go
func (task *Task) generateENIExtraHosts() []string {
	eni := task.GetTaskENI()
	if eni == nil {
		return nil
	}

	hostname := eni.GetHostname()
	if hostname == "" {
		return nil
	}

	extraHosts := []string{}

	for _, ip := range eni.GetIPV4Addresses() {
		host := fmt.Sprintf("%s:%s", hostname, ip)
		extraHosts = append(extraHosts, host)
	}
	return extraHosts
}
func (task *Task) generateENIExtraHosts() []string {
	eni := task.GetTaskENI()
	if eni == nil {
		return nil
	}

	hostname := eni.GetHostname()
	if hostname == "" {
		return nil
	}

	extraHosts := []string{}

	for _, ip := range eni.GetIPV4Addresses() {
		host := fmt.Sprintf("%s:%s", hostname, ip)
		extraHosts = append(extraHosts, host)
	}
	return extraHosts
}
func ( task * Task ) generateENIExtraHosts ( ) [ ] string { eni := task . GetTaskENI ( ) if eni == nil { return nil } hostname := eni . GetHostname ( ) if hostname == " " { return nil } extraHosts := [ ] string { } for _ , ip := range eni . GetIPV4Addresses ( ) { host := fmt . Sprintf ( " " , hostname , ip ) extraHosts = append ( extraHosts , host ) } return extraHosts }
// generateENIExtraHosts returns a slice of strings of the form "hostname:ip"
// that is generated using the hostname and ip addresses allocated to the ENI
generateENIExtraHosts returns a slice of strings of the form hostname : ip that is generated using the hostname and ip addresses allocated to the ENI