Update cni and go-cni to the v0.7.1 release (Closes #1236)
authorMichael Crosby <crosbymichael@gmail.com>
Wed, 14 Aug 2019 14:32:08 +0000 (14:32 +0000)
committerDmitry Smirnov <onlyjob@debian.org>
Tue, 12 Nov 2019 01:18:22 +0000 (01:18 +0000)
Gbp-Pq: Name containerd-cri_cni.patch

containerd/vendor/github.com/containerd/cri/pkg/server/sandbox_run.go
containerd/vendor/github.com/containerd/cri/pkg/server/sandbox_stop.go

index 328edd71602d3b922d3063c634aebf61d1f28645..46f6cbe58c6652837d767f6ed3f6f85348c9b084 100644 (file)
@@ -132,14 +132,14 @@ func (c *criService) RunPodSandbox(ctx context.Context, r *runtime.RunPodSandbox
                // In this case however caching the IP will add a subtle performance enhancement by avoiding
                // calls to network namespace of the pod to query the IP of the veth interface on every
                // SandboxStatus request.
-               sandbox.IP, sandbox.CNIResult, err = c.setupPod(id, sandbox.NetNSPath, config)
+               sandbox.IP, sandbox.CNIResult, err = c.setupPod(ctx, id, sandbox.NetNSPath, config)
                if err != nil {
                        return nil, errors.Wrapf(err, "failed to setup network for sandbox %q", id)
                }
                defer func() {
                        if retErr != nil {
                                // Teardown network if an error is returned.
-                               if err := c.teardownPod(id, sandbox.NetNSPath, config); err != nil {
+                               if err := c.teardownPod(ctx, id, sandbox.NetNSPath, config); err != nil {
                                        logrus.WithError(err).Errorf("Failed to destroy network for sandbox %q", id)
                                }
                        }
@@ -534,13 +534,13 @@ func (c *criService) unmountSandboxFiles(id string, config *runtime.PodSandboxCo
 }
 
 // setupPod setups up the network for a pod
-func (c *criService) setupPod(id string, path string, config *runtime.PodSandboxConfig) (string, *cni.CNIResult, error) {
+func (c *criService) setupPod(ctx context.Context, id string, path string, config *runtime.PodSandboxConfig) (string, *cni.CNIResult, error) {
        if c.netPlugin == nil {
                return "", nil, errors.New("cni config not initialized")
        }
 
        labels := getPodCNILabels(id, config)
-       result, err := c.netPlugin.Setup(id,
+       result, err := c.netPlugin.Setup(ctx, id,
                path,
                cni.WithLabels(labels),
                cni.WithCapabilityPortMap(toCNIPortMappings(config.GetPortMappings())))
@@ -553,7 +553,7 @@ func (c *criService) setupPod(id string, path string, config *runtime.PodSandbox
                return selectPodIP(configs.IPConfigs), result, nil
        }
        // If it comes here then the result was invalid so destroy the pod network and return error
-       if err := c.teardownPod(id, path, config); err != nil {
+       if err := c.teardownPod(ctx, id, path, config); err != nil {
                logrus.WithError(err).Errorf("Failed to destroy network for sandbox %q", id)
        }
        return "", result, errors.Errorf("failed to find network info for sandbox %q", id)
index d04118dd3ea8168777a2083111a7318098226c27..cf597f78472cd80d21a0ea045d0104bf0a9ae9b2 100644 (file)
@@ -80,7 +80,7 @@ func (c *criService) StopPodSandbox(ctx context.Context, r *runtime.StopPodSandb
                } else if closed {
                        netNSPath = ""
                }
-               if err := c.teardownPod(id, netNSPath, sandbox.Config); err != nil {
+               if err := c.teardownPod(ctx, id, netNSPath, sandbox.Config); err != nil {
                        return nil, errors.Wrapf(err, "failed to destroy network for sandbox %q", id)
                }
                if err = sandbox.NetNS.Remove(); err != nil {
@@ -160,13 +160,13 @@ func (c *criService) waitSandboxStop(ctx context.Context, sandbox sandboxstore.S
 }
 
 // teardownPod removes the network from the pod
-func (c *criService) teardownPod(id string, path string, config *runtime.PodSandboxConfig) error {
+func (c *criService) teardownPod(ctx context.Context, id string, path string, config *runtime.PodSandboxConfig) error {
        if c.netPlugin == nil {
                return errors.New("cni config not initialized")
        }
 
        labels := getPodCNILabels(id, config)
-       return c.netPlugin.Remove(id,
+       return c.netPlugin.Remove(ctx, id,
                path,
                cni.WithLabels(labels),
                cni.WithCapabilityPortMap(toCNIPortMappings(config.GetPortMappings())))