@@ -198,16 +198,16 @@ func (c *Calcium) doCreateAndStartContainer(
198
198
// connect virtualizaion to network
199
199
// if network manager uses plugin, then connect must be called before container starts
200
200
// 如果有 networks 的配置,这里的 networkMode 就为 none 了
201
- if len (opts .Networks ) > 0 {
202
- ctx := utils .ContextWithDockerEngine (ctx , node .Engine )
203
- // need to ensure all networks are correctly connected
204
- for networkID , ipv4 := range opts .Networks {
205
- if err = c .network .ConnectToNetwork (ctx , containerCreated .ID , networkID , ipv4 ); err != nil {
206
- createContainerMessage .Error = err
207
- return createContainerMessage
208
- }
209
- }
210
- }
201
+ // if len(opts.Networks) > 0 {
202
+ // ctx := utils.ContextWithDockerEngine(ctx, node.Engine)
203
+ // // need to ensure all networks are correctly connected
204
+ // for networkID, ipv4 := range opts.Networks {
205
+ // if err = c.network.ConnectToNetwork(ctx, containerCreated.ID, networkID, ipv4); err != nil {
206
+ // createContainerMessage.Error = err
207
+ // return createContainerMessage
208
+ // }
209
+ // }
210
+ // }
211
211
212
212
// Copy data to container
213
213
if len (opts .Data ) > 0 {
@@ -347,6 +347,7 @@ func (c *Calcium) doMakeContainerOptions(index int, cpumap types.CPUMap, opts *t
347
347
// 没有 networks 的时候用 networkmode 的值
348
348
// 有 networks 的时候一律用 none 作为默认 mode
349
349
config .Network = opts .NetworkMode
350
+ config .Networks = opts .Networks
350
351
if len (opts .Networks ) > 0 {
351
352
for name := range opts .Networks {
352
353
config .Network = name
0 commit comments