can set up the network serially by CNI plugins
Signed-off-by: Fei Su <sofat1989@126.com>
This commit is contained in:
@@ -425,6 +425,8 @@ func (c *criService) setupPodNetwork(ctx context.Context, sandbox *sandboxstore.
|
||||
config = sandbox.Config
|
||||
path = sandbox.NetNSPath
|
||||
netPlugin = c.getNetworkPlugin(sandbox.RuntimeHandler)
|
||||
err error
|
||||
result *cni.Result
|
||||
)
|
||||
if netPlugin == nil {
|
||||
return errors.New("cni config not initialized")
|
||||
@@ -435,7 +437,11 @@ func (c *criService) setupPodNetwork(ctx context.Context, sandbox *sandboxstore.
|
||||
return fmt.Errorf("get cni namespace options: %w", err)
|
||||
}
|
||||
log.G(ctx).WithField("podsandboxid", id).Debugf("begin cni setup")
|
||||
result, err := netPlugin.Setup(ctx, id, path, opts...)
|
||||
if c.config.CniConfig.NetworkPluginSetupSerially {
|
||||
result, err = netPlugin.SetupSerially(ctx, id, path, opts...)
|
||||
} else {
|
||||
result, err = netPlugin.Setup(ctx, id, path, opts...)
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user