Skip to content

Commit

Permalink
network: Change NewNS() call
Browse files Browse the repository at this point in the history
NewNS() api has been moved to testutils package in the cni
plugin repo.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
  • Loading branch information
amshinde committed Oct 8, 2019
1 parent c0995c6 commit 929c4e7
Show file tree
Hide file tree
Showing 20 changed files with 1,957 additions and 6 deletions.
22 changes: 20 additions & 2 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion pkg/katautils/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"strings"

"github.com/containernetworking/plugins/pkg/ns"
"github.com/containernetworking/plugins/pkg/testutils"
vc "github.com/kata-containers/runtime/virtcontainers"
"golang.org/x/sys/unix"
)
Expand Down Expand Up @@ -59,7 +60,7 @@ func SetupNetworkNamespace(config *vc.NetworkConfig) error {
}

if config.NetNSPath == "" {
n, err := ns.NewNS()
n, err := testutils.NewNS()
if err != nil {
return err
}
Expand Down
3 changes: 2 additions & 1 deletion pkg/katautils/network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"testing"

"github.com/containernetworking/plugins/pkg/ns"
"github.com/containernetworking/plugins/pkg/testutils"
ktu "github.com/kata-containers/runtime/pkg/katatestutils"
vc "github.com/kata-containers/runtime/virtcontainers"
"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -127,7 +128,7 @@ func TestSetupNetworkNamespace(t *testing.T) {
assert.Error(err)

// Existent netns path
n, err := ns.NewNS()
n, err := testutils.NewNS()
assert.NoError(err)
config = &vc.NetworkConfig{
NetNSPath: n.Path(),
Expand Down
202 changes: 202 additions & 0 deletions vendor/github.com/containernetworking/cni/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 929c4e7

Please sign in to comment.