update go-cni/for cni update fixing plugins that don't respond with version
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
This commit is contained in:
6
vendor/github.com/containerd/go-cni/Makefile
generated
vendored
6
vendor/github.com/containerd/go-cni/Makefile
generated
vendored
@@ -31,12 +31,10 @@ help: ## this help
|
||||
test: ## run tests, except integration tests and tests that require root
|
||||
$(Q)go test -v -race $(EXTRA_TESTFLAGS) -count=1 ./...
|
||||
|
||||
integration: ## run integration test
|
||||
integration: bin/integration.test ## run integration test
|
||||
$(Q)bin/integration.test -test.v -test.count=1 -test.root $(EXTRA_TESTFLAGS) -test.parallel $(TESTFLAGS_PARALLEL)
|
||||
|
||||
FORCE:
|
||||
|
||||
bin/integration.test: FORCE ## build integration test binary into bin
|
||||
bin/integration.test: ## build integration test binary into bin
|
||||
$(Q)cd ./integration && go test -race -c . -o ../bin/integration.test
|
||||
|
||||
clean: ## clean up binaries
|
||||
|
||||
30
vendor/github.com/containerd/go-cni/cni.go
generated
vendored
30
vendor/github.com/containerd/go-cni/cni.go
generated
vendored
@@ -33,6 +33,8 @@ import (
|
||||
type CNI interface {
|
||||
// Setup setup the network for the namespace
|
||||
Setup(ctx context.Context, id string, path string, opts ...NamespaceOpts) (*Result, error)
|
||||
// SetupSerially sets up each of the network interfaces for the namespace in serial
|
||||
SetupSerially(ctx context.Context, id string, path string, opts ...NamespaceOpts) (*Result, error)
|
||||
// Remove tears down the network of the namespace.
|
||||
Remove(ctx context.Context, id string, path string, opts ...NamespaceOpts) error
|
||||
// Check checks if the network is still in desired state
|
||||
@@ -165,6 +167,34 @@ func (c *libcni) Setup(ctx context.Context, id string, path string, opts ...Name
|
||||
return c.createResult(result)
|
||||
}
|
||||
|
||||
// SetupSerially setups the network in the namespace and returns a Result
|
||||
func (c *libcni) SetupSerially(ctx context.Context, id string, path string, opts ...NamespaceOpts) (*Result, error) {
|
||||
if err := c.Status(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ns, err := newNamespace(id, path, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
result, err := c.attachNetworksSerially(ctx, ns)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return c.createResult(result)
|
||||
}
|
||||
|
||||
func (c *libcni) attachNetworksSerially(ctx context.Context, ns *Namespace) ([]*types100.Result, error) {
|
||||
var results []*types100.Result
|
||||
for _, network := range c.Networks() {
|
||||
r, err := network.Attach(ctx, ns)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
results = append(results, r)
|
||||
}
|
||||
return results, nil
|
||||
}
|
||||
|
||||
type asynchAttachResult struct {
|
||||
index int
|
||||
res *types100.Result
|
||||
|
||||
Reference in New Issue
Block a user