From: Michael Crosby Date: Wed, 14 Aug 2019 14:32:08 +0000 (+0000) Subject: Update cni and go-cni to the v0.7.1 release (Closes #1236) X-Git-Tag: archive/raspbian/19.03.4+dfsg2-2+rpi1^2~14 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=e0f18c8a09f2428cd88d0c39edc23f31abc6bada;p=docker.io.git Update cni and go-cni to the v0.7.1 release (Closes #1236) Gbp-Pq: Name containerd-cri_cni.patch --- diff --git a/containerd/vendor/github.com/containerd/cri/pkg/server/sandbox_run.go b/containerd/vendor/github.com/containerd/cri/pkg/server/sandbox_run.go index 328edd71..46f6cbe5 100644 --- a/containerd/vendor/github.com/containerd/cri/pkg/server/sandbox_run.go +++ b/containerd/vendor/github.com/containerd/cri/pkg/server/sandbox_run.go @@ -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) diff --git a/containerd/vendor/github.com/containerd/cri/pkg/server/sandbox_stop.go b/containerd/vendor/github.com/containerd/cri/pkg/server/sandbox_stop.go index d04118dd..cf597f78 100644 --- a/containerd/vendor/github.com/containerd/cri/pkg/server/sandbox_stop.go +++ b/containerd/vendor/github.com/containerd/cri/pkg/server/sandbox_stop.go @@ -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())))