(ctx context.Context, apiClient client.NetworkAPIClient, output io.Writer, options createOptions)
| 103 | } |
| 104 | |
| 105 | func runCreate(ctx context.Context, apiClient client.NetworkAPIClient, output io.Writer, options createOptions) error { |
| 106 | ipamCfg, err := createIPAMConfig(options.ipam) |
| 107 | if err != nil { |
| 108 | return err |
| 109 | } |
| 110 | |
| 111 | resp, err := apiClient.NetworkCreate(ctx, options.name, client.NetworkCreateOptions{ |
| 112 | Driver: options.driver, |
| 113 | Options: options.driverOpts.GetAll(), |
| 114 | IPAM: ipamCfg, |
| 115 | Internal: options.internal, |
| 116 | EnableIPv4: options.ipv4, |
| 117 | EnableIPv6: options.ipv6, |
| 118 | Attachable: options.attachable, |
| 119 | Ingress: options.ingress, |
| 120 | Scope: options.scope, |
| 121 | ConfigOnly: options.configOnly, |
| 122 | ConfigFrom: options.configFrom, |
| 123 | Labels: opts.ConvertKVStringsToMap(options.labels.GetSlice()), |
| 124 | }) |
| 125 | if err != nil { |
| 126 | return err |
| 127 | } |
| 128 | _, _ = fmt.Fprintln(output, resp.ID) |
| 129 | return nil |
| 130 | } |
| 131 | |
| 132 | // Consolidates the ipam configuration as a group from different related configurations |
| 133 | // user can configure network with multiple non-overlapping subnets and hence it is |
no test coverage detected
searching dependent graphs…