Update go-cni to v1.1.2
Fixes panic when exec is nil Signed-off-by: Derek McGowan <derek@mcg.dev>
This commit is contained in:
parent
e2c5f8f932
commit
c0f8188469
2
go.mod
2
go.mod
@ -13,7 +13,7 @@ require (
|
|||||||
github.com/containerd/console v1.0.3
|
github.com/containerd/console v1.0.3
|
||||||
github.com/containerd/continuity v0.2.2
|
github.com/containerd/continuity v0.2.2
|
||||||
github.com/containerd/fifo v1.0.0
|
github.com/containerd/fifo v1.0.0
|
||||||
github.com/containerd/go-cni v1.1.1
|
github.com/containerd/go-cni v1.1.2
|
||||||
github.com/containerd/go-runc v1.0.0
|
github.com/containerd/go-runc v1.0.0
|
||||||
github.com/containerd/imgcrypt v1.1.3
|
github.com/containerd/imgcrypt v1.1.3
|
||||||
github.com/containerd/nri v0.1.0
|
github.com/containerd/nri v0.1.0
|
||||||
|
4
go.sum
4
go.sum
@ -142,8 +142,8 @@ github.com/containerd/continuity v0.2.2/go.mod h1:pWygW9u7LtS1o4N/Tn0FoCFDIXZ7rx
|
|||||||
github.com/containerd/fifo v1.0.0 h1:6PirWBr9/L7GDamKr+XM0IeUFXu5mf3M/BPpH9gaLBU=
|
github.com/containerd/fifo v1.0.0 h1:6PirWBr9/L7GDamKr+XM0IeUFXu5mf3M/BPpH9gaLBU=
|
||||||
github.com/containerd/fifo v1.0.0/go.mod h1:ocF/ME1SX5b1AOlWi9r677YJmCPSwwWnQ9O123vzpE4=
|
github.com/containerd/fifo v1.0.0/go.mod h1:ocF/ME1SX5b1AOlWi9r677YJmCPSwwWnQ9O123vzpE4=
|
||||||
github.com/containerd/go-cni v1.1.0/go.mod h1:Rflh2EJ/++BA2/vY5ao3K6WJRR/bZKsX123aPk+kUtA=
|
github.com/containerd/go-cni v1.1.0/go.mod h1:Rflh2EJ/++BA2/vY5ao3K6WJRR/bZKsX123aPk+kUtA=
|
||||||
github.com/containerd/go-cni v1.1.1 h1:UV64yhzDgs27mBIVUrlzG8Z2bc1K0/zokOW5vDNkI4c=
|
github.com/containerd/go-cni v1.1.2 h1:futGN9fI70oOPA1DKSN4oFmeZ8tNldb382g5TlwYfFc=
|
||||||
github.com/containerd/go-cni v1.1.1/go.mod h1:Rflh2EJ/++BA2/vY5ao3K6WJRR/bZKsX123aPk+kUtA=
|
github.com/containerd/go-cni v1.1.2/go.mod h1:Rflh2EJ/++BA2/vY5ao3K6WJRR/bZKsX123aPk+kUtA=
|
||||||
github.com/containerd/go-runc v1.0.0 h1:oU+lLv1ULm5taqgV/CJivypVODI4SUz1znWjv3nNYS0=
|
github.com/containerd/go-runc v1.0.0 h1:oU+lLv1ULm5taqgV/CJivypVODI4SUz1znWjv3nNYS0=
|
||||||
github.com/containerd/go-runc v1.0.0/go.mod h1:cNU0ZbCgCQVZK4lgG3P+9tn9/PaJNmoDXPpoJhDR+Ok=
|
github.com/containerd/go-runc v1.0.0/go.mod h1:cNU0ZbCgCQVZK4lgG3P+9tn9/PaJNmoDXPpoJhDR+Ok=
|
||||||
github.com/containerd/imgcrypt v1.1.3 h1:69UKRsA3Q/lAwo2eDzWshdjimqhmprrWXfNtBeO0fBc=
|
github.com/containerd/imgcrypt v1.1.3 h1:69UKRsA3Q/lAwo2eDzWshdjimqhmprrWXfNtBeO0fBc=
|
||||||
|
@ -140,7 +140,7 @@ github.com/containerd/continuity v0.2.2/go.mod h1:pWygW9u7LtS1o4N/Tn0FoCFDIXZ7rx
|
|||||||
github.com/containerd/fifo v1.0.0 h1:6PirWBr9/L7GDamKr+XM0IeUFXu5mf3M/BPpH9gaLBU=
|
github.com/containerd/fifo v1.0.0 h1:6PirWBr9/L7GDamKr+XM0IeUFXu5mf3M/BPpH9gaLBU=
|
||||||
github.com/containerd/fifo v1.0.0/go.mod h1:ocF/ME1SX5b1AOlWi9r677YJmCPSwwWnQ9O123vzpE4=
|
github.com/containerd/fifo v1.0.0/go.mod h1:ocF/ME1SX5b1AOlWi9r677YJmCPSwwWnQ9O123vzpE4=
|
||||||
github.com/containerd/go-cni v1.1.0/go.mod h1:Rflh2EJ/++BA2/vY5ao3K6WJRR/bZKsX123aPk+kUtA=
|
github.com/containerd/go-cni v1.1.0/go.mod h1:Rflh2EJ/++BA2/vY5ao3K6WJRR/bZKsX123aPk+kUtA=
|
||||||
github.com/containerd/go-cni v1.1.1/go.mod h1:Rflh2EJ/++BA2/vY5ao3K6WJRR/bZKsX123aPk+kUtA=
|
github.com/containerd/go-cni v1.1.2/go.mod h1:Rflh2EJ/++BA2/vY5ao3K6WJRR/bZKsX123aPk+kUtA=
|
||||||
github.com/containerd/go-runc v0.0.0-20200220073739-7016d3ce2328/go.mod h1:PpyHrqVs8FTi9vpyHwPwiNEGaACDxT/N/pLcvMSRA9g=
|
github.com/containerd/go-runc v0.0.0-20200220073739-7016d3ce2328/go.mod h1:PpyHrqVs8FTi9vpyHwPwiNEGaACDxT/N/pLcvMSRA9g=
|
||||||
github.com/containerd/go-runc v0.0.0-20201020171139-16b287bc67d0/go.mod h1:cNU0ZbCgCQVZK4lgG3P+9tn9/PaJNmoDXPpoJhDR+Ok=
|
github.com/containerd/go-runc v0.0.0-20201020171139-16b287bc67d0/go.mod h1:cNU0ZbCgCQVZK4lgG3P+9tn9/PaJNmoDXPpoJhDR+Ok=
|
||||||
github.com/containerd/go-runc v1.0.0 h1:oU+lLv1ULm5taqgV/CJivypVODI4SUz1znWjv3nNYS0=
|
github.com/containerd/go-runc v1.0.0 h1:oU+lLv1ULm5taqgV/CJivypVODI4SUz1znWjv3nNYS0=
|
||||||
|
@ -43,6 +43,11 @@ func (f *FakeCNIPlugin) Remove(ctx context.Context, id, path string, opts ...cni
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check the network of PodSandbox.
|
||||||
|
func (f *FakeCNIPlugin) Check(ctx context.Context, id, path string, opts ...cni.NamespaceOpts) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// Status get the status of the plugin.
|
// Status get the status of the plugin.
|
||||||
func (f *FakeCNIPlugin) Status() error {
|
func (f *FakeCNIPlugin) Status() error {
|
||||||
return f.StatusErr
|
return f.StatusErr
|
||||||
|
1
vendor/github.com/containerd/go-cni/README.md
generated
vendored
1
vendor/github.com/containerd/go-cni/README.md
generated
vendored
@ -11,6 +11,7 @@ A generic CNI library to provide APIs for CNI plugin interactions. The library p
|
|||||||
- Setup networks for container namespace
|
- Setup networks for container namespace
|
||||||
- Remove networks from container namespace
|
- Remove networks from container namespace
|
||||||
- Query status of CNI network plugin initialization
|
- Query status of CNI network plugin initialization
|
||||||
|
- Check verifies the network is still in desired state
|
||||||
|
|
||||||
go-cni aims to support plugins that implement [Container Network Interface](https://github.com/containernetworking/cni)
|
go-cni aims to support plugins that implement [Container Network Interface](https://github.com/containernetworking/cni)
|
||||||
|
|
||||||
|
34
vendor/github.com/containerd/go-cni/cni.go
generated
vendored
34
vendor/github.com/containerd/go-cni/cni.go
generated
vendored
@ -19,12 +19,15 @@ package cni
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
cnilibrary "github.com/containernetworking/cni/libcni"
|
cnilibrary "github.com/containernetworking/cni/libcni"
|
||||||
|
"github.com/containernetworking/cni/pkg/invoke"
|
||||||
"github.com/containernetworking/cni/pkg/types"
|
"github.com/containernetworking/cni/pkg/types"
|
||||||
types100 "github.com/containernetworking/cni/pkg/types/100"
|
types100 "github.com/containernetworking/cni/pkg/types/100"
|
||||||
|
"github.com/containernetworking/cni/pkg/version"
|
||||||
)
|
)
|
||||||
|
|
||||||
type CNI interface {
|
type CNI interface {
|
||||||
@ -32,6 +35,8 @@ type CNI interface {
|
|||||||
Setup(ctx context.Context, id string, path string, opts ...NamespaceOpts) (*Result, error)
|
Setup(ctx context.Context, id string, path string, opts ...NamespaceOpts) (*Result, error)
|
||||||
// Remove tears down the network of the namespace.
|
// Remove tears down the network of the namespace.
|
||||||
Remove(ctx context.Context, id string, path string, opts ...NamespaceOpts) error
|
Remove(ctx context.Context, id string, path string, opts ...NamespaceOpts) error
|
||||||
|
// Check checks if the network is still in desired state
|
||||||
|
Check(ctx context.Context, id string, path string, opts ...NamespaceOpts) error
|
||||||
// Load loads the cni network config
|
// Load loads the cni network config
|
||||||
Load(opts ...Opt) error
|
Load(opts ...Opt) error
|
||||||
// Status checks the status of the cni initialization
|
// Status checks the status of the cni initialization
|
||||||
@ -84,9 +89,15 @@ func defaultCNIConfig() *libcni {
|
|||||||
pluginMaxConfNum: DefaultMaxConfNum,
|
pluginMaxConfNum: DefaultMaxConfNum,
|
||||||
prefix: DefaultPrefix,
|
prefix: DefaultPrefix,
|
||||||
},
|
},
|
||||||
cniConfig: &cnilibrary.CNIConfig{
|
cniConfig: cnilibrary.NewCNIConfig(
|
||||||
Path: []string{DefaultCNIDir},
|
[]string{
|
||||||
|
DefaultCNIDir,
|
||||||
},
|
},
|
||||||
|
&invoke.DefaultExec{
|
||||||
|
RawExec: &invoke.RawExec{Stderr: os.Stderr},
|
||||||
|
PluginDecoder: version.PluginDecoder{},
|
||||||
|
},
|
||||||
|
),
|
||||||
networkCount: 1,
|
networkCount: 1,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -217,6 +228,25 @@ func (c *libcni) Remove(ctx context.Context, id string, path string, opts ...Nam
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check checks if the network is still in desired state
|
||||||
|
func (c *libcni) Check(ctx context.Context, id string, path string, opts ...NamespaceOpts) error {
|
||||||
|
if err := c.Status(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
ns, err := newNamespace(id, path, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
for _, network := range c.Networks() {
|
||||||
|
err := network.Check(ctx, ns)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// GetConfig returns a copy of the CNI plugin configurations as parsed by CNI
|
// GetConfig returns a copy of the CNI plugin configurations as parsed by CNI
|
||||||
func (c *libcni) GetConfig() *ConfigResult {
|
func (c *libcni) GetConfig() *ConfigResult {
|
||||||
c.RLock()
|
c.RLock()
|
||||||
|
4
vendor/github.com/containerd/go-cni/namespace.go
generated
vendored
4
vendor/github.com/containerd/go-cni/namespace.go
generated
vendored
@ -41,6 +41,10 @@ func (n *Network) Remove(ctx context.Context, ns *Namespace) error {
|
|||||||
return n.cni.DelNetworkList(ctx, n.config, ns.config(n.ifName))
|
return n.cni.DelNetworkList(ctx, n.config, ns.config(n.ifName))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (n *Network) Check(ctx context.Context, ns *Namespace) error {
|
||||||
|
return n.cni.CheckNetworkList(ctx, n.config, ns.config(n.ifName))
|
||||||
|
}
|
||||||
|
|
||||||
type Namespace struct {
|
type Namespace struct {
|
||||||
id string
|
id string
|
||||||
path string
|
path string
|
||||||
|
2
vendor/modules.txt
vendored
2
vendor/modules.txt
vendored
@ -93,7 +93,7 @@ github.com/containerd/continuity/testutil/loopback
|
|||||||
# github.com/containerd/fifo v1.0.0
|
# github.com/containerd/fifo v1.0.0
|
||||||
## explicit
|
## explicit
|
||||||
github.com/containerd/fifo
|
github.com/containerd/fifo
|
||||||
# github.com/containerd/go-cni v1.1.1
|
# github.com/containerd/go-cni v1.1.2
|
||||||
## explicit
|
## explicit
|
||||||
github.com/containerd/go-cni
|
github.com/containerd/go-cni
|
||||||
# github.com/containerd/go-runc v1.0.0
|
# github.com/containerd/go-runc v1.0.0
|
||||||
|
Loading…
Reference in New Issue
Block a user