agent/api/task/task.go
func convertENIToCNIConfig(eni *apieni.ENI, cfg *ecscni.Config) {
	cfg.ENIID = eni.ID
	cfg.ID = eni.MacAddress
	cfg.ENIMACAddress = eni.MacAddress
	cfg.SubnetGatewayIPV4Address = eni.GetSubnetGatewayIPV4Address()
	for _, ipv4 := range eni.IPV4Addresses {
		if ipv4.Primary {
			cfg.ENIIPV4Address = ipv4.Address
			break
		}
	}
	// If there is ipv6 assigned to eni then set it
	if len(eni.IPV6Addresses) > 0 {
		cfg.ENIIPV6Address = eni.IPV6Addresses[0].Address
	}
}
func convertENIToCNIConfig(eni *apieni.ENI, cfg *ecscni.Config) {
	cfg.ENIID = eni.ID
	cfg.ID = eni.MacAddress
	cfg.ENIMACAddress = eni.MacAddress
	cfg.SubnetGatewayIPV4Address = eni.GetSubnetGatewayIPV4Address()
	for _, ipv4 := range eni.IPV4Addresses {
		if ipv4.Primary {
			cfg.ENIIPV4Address = ipv4.Address
			break
		}
	}
	// If there is ipv6 assigned to eni then set it
	if len(eni.IPV6Addresses) > 0 {
		cfg.ENIIPV6Address = eni.IPV6Addresses[0].Address
	}
}
// convertENIToCNIConfig converts input eni config into cni config