(ctx context.Context, apiClient client.NetworkAPIClient, options connectOptions)
| 64 | } |
| 65 | |
| 66 | func runConnect(ctx context.Context, apiClient client.NetworkAPIClient, options connectOptions) error { |
| 67 | driverOpts, err := convertDriverOpt(options.driverOpts) |
| 68 | if err != nil { |
| 69 | return err |
| 70 | } |
| 71 | _, err = apiClient.NetworkConnect(ctx, options.network, client.NetworkConnectOptions{ |
| 72 | Container: options.container, |
| 73 | EndpointConfig: &network.EndpointSettings{ |
| 74 | IPAMConfig: &network.EndpointIPAMConfig{ |
| 75 | IPv4Address: toNetipAddr(options.ipaddress), |
| 76 | IPv6Address: toNetipAddr(options.ipv6address), |
| 77 | LinkLocalIPs: toNetipAddrSlice(options.linklocalips), |
| 78 | }, |
| 79 | Links: options.links.GetSlice(), |
| 80 | Aliases: options.aliases, |
| 81 | DriverOpts: driverOpts, |
| 82 | GwPriority: options.gwPriority, |
| 83 | }, |
| 84 | }) |
| 85 | return err |
| 86 | } |
| 87 | |
| 88 | func convertDriverOpt(options []string) (map[string]string, error) { |
| 89 | driverOpt := make(map[string]string) |
no test coverage detected
searching dependent graphs…