Skip to content

Commit

Permalink
Introduce gopkg.in for go module
Browse files Browse the repository at this point in the history
This change introduces gopkg.in to allow everyone to use multus
code as library. Currently multus-cni uses version 'v3', hence
it hits go modules limitation, as k8snetworkplumbingwg#504 describes.

This change fix k8snetworkplumbingwg#504 with gopkg.in.
  • Loading branch information
s1061123 committed May 15, 2020
1 parent ec5fd6c commit 4eac660
Show file tree
Hide file tree
Showing 20 changed files with 49 additions and 43 deletions.
4 changes: 2 additions & 2 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ if [ "$GO111MODULE" == "off" ]; then
echo "Building plugin without go module"
echo "Warning: this will be deprecated in near future so please use go modules!"

ORG_PATH="github.com/intel"
REPO_PATH="${ORG_PATH}/multus-cni"
ORG_PATH="gopkg.in/intel"
REPO_PATH="${ORG_PATH}/multus-cni.v3"

if [ ! -h gopath/src/${REPO_PATH} ]; then
mkdir -p gopath/src/${ORG_PATH}
Expand Down
4 changes: 2 additions & 2 deletions checkpoint/checkpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (
"encoding/json"
"io/ioutil"

"github.com/intel/multus-cni/logging"
"github.com/intel/multus-cni/types"
"gopkg.in/intel/multus-cni.v3/logging"
"gopkg.in/intel/multus-cni.v3/types"
v1 "k8s.io/api/core/v1"
)

Expand Down
2 changes: 1 addition & 1 deletion checkpoint/checkpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"io/ioutil"
"testing"

"github.com/intel/multus-cni/types"
"gopkg.in/intel/multus-cni.v3/types"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
k8sTypes "k8s.io/apimachinery/pkg/types"
Expand Down
10 changes: 10 additions & 0 deletions doc/development.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
## Development Information

## How to utilize multus-cni code as library?

Multus now uses [gopkg.in](http://gopkg.in/) to expose its code as library.
You can use following command to import our code into your go code.

```
go get gopkg.in/intel/multus-cni.v3
```


## How do I submit an issue?

Use GitHub as normally, you'll be presented with an option to submit a issue or enhancement request.
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/intel/multus-cni
module gopkg.in/intel/multus-cni.v3

go 1.12

Expand Down
6 changes: 3 additions & 3 deletions k8sclient/k8sclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ import (
"github.com/containernetworking/cni/libcni"
"github.com/containernetworking/cni/pkg/skel"
cnitypes "github.com/containernetworking/cni/pkg/types"
"github.com/intel/multus-cni/kubeletclient"
"github.com/intel/multus-cni/logging"
"github.com/intel/multus-cni/types"
"gopkg.in/intel/multus-cni.v3/kubeletclient"
"gopkg.in/intel/multus-cni.v3/logging"
"gopkg.in/intel/multus-cni.v3/types"
nettypes "github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1"
netclient "github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/client/clientset/versioned/typed/k8s.cni.cncf.io/v1"
netutils "github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/utils"
Expand Down
4 changes: 2 additions & 2 deletions k8sclient/k8sclient_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import (
"testing"

types020 "github.com/containernetworking/cni/pkg/types/020"
testutils "github.com/intel/multus-cni/testing"
testutils "gopkg.in/intel/multus-cni.v3/testing"

"github.com/containernetworking/cni/pkg/skel"
"github.com/intel/multus-cni/types"
"gopkg.in/intel/multus-cni.v3/types"

nettypes "github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1"
netfake "github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/client/clientset/versioned/fake"
Expand Down
6 changes: 3 additions & 3 deletions kubeletclient/kubeletclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"path/filepath"
"time"

"github.com/intel/multus-cni/checkpoint"
"github.com/intel/multus-cni/logging"
"github.com/intel/multus-cni/types"
"gopkg.in/intel/multus-cni.v3/checkpoint"
"gopkg.in/intel/multus-cni.v3/logging"
"gopkg.in/intel/multus-cni.v3/types"
"golang.org/x/net/context"
v1 "k8s.io/api/core/v1"
"k8s.io/kubernetes/pkg/kubelet/apis/podresources"
Expand Down
2 changes: 1 addition & 1 deletion kubeletclient/kubeletclient_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
k8sTypes "k8s.io/apimachinery/pkg/types"
"k8s.io/kubernetes/pkg/kubelet/util"

mtypes "github.com/intel/multus-cni/types"
mtypes "gopkg.in/intel/multus-cni.v3/types"
podresourcesapi "k8s.io/kubernetes/pkg/kubelet/apis/podresources/v1alpha1"
)

Expand Down
8 changes: 4 additions & 4 deletions multus/multus.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ import (
cnicurrent "github.com/containernetworking/cni/pkg/types/current"
cniversion "github.com/containernetworking/cni/pkg/version"
"github.com/containernetworking/plugins/pkg/ns"
k8s "github.com/intel/multus-cni/k8sclient"
"github.com/intel/multus-cni/logging"
"github.com/intel/multus-cni/netutils"
"github.com/intel/multus-cni/types"
k8s "gopkg.in/intel/multus-cni.v3/k8sclient"
"gopkg.in/intel/multus-cni.v3/logging"
"gopkg.in/intel/multus-cni.v3/netutils"
"gopkg.in/intel/multus-cni.v3/types"
nettypes "github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1"
nadutils "github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/utils"
"github.com/vishvananda/netlink"
Expand Down
8 changes: 4 additions & 4 deletions multus/multus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ import (
cniversion "github.com/containernetworking/cni/pkg/version"
"github.com/containernetworking/plugins/pkg/ns"
"github.com/containernetworking/plugins/pkg/testutils"
"github.com/intel/multus-cni/k8sclient"
"github.com/intel/multus-cni/logging"
testhelpers "github.com/intel/multus-cni/testing"
"github.com/intel/multus-cni/types"
"gopkg.in/intel/multus-cni.v3/k8sclient"
"gopkg.in/intel/multus-cni.v3/logging"
testhelpers "gopkg.in/intel/multus-cni.v3/testing"
"gopkg.in/intel/multus-cni.v3/types"
netfake "github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/client/clientset/versioned/fake"
"k8s.io/client-go/kubernetes/fake"
"k8s.io/client-go/tools/record"
Expand Down
2 changes: 1 addition & 1 deletion netutils/netutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
cnitypes "github.com/containernetworking/cni/pkg/types"
"github.com/containernetworking/cni/pkg/types/current"
"github.com/containernetworking/plugins/pkg/ns"
"github.com/intel/multus-cni/logging"
"gopkg.in/intel/multus-cni.v3/logging"
"github.com/vishvananda/netlink"
"net"
"strings"
Expand Down
2 changes: 1 addition & 1 deletion types/conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"github.com/containernetworking/cni/pkg/skel"
"github.com/containernetworking/cni/pkg/types/current"
"github.com/containernetworking/cni/pkg/version"
"github.com/intel/multus-cni/logging"
"gopkg.in/intel/multus-cni.v3/logging"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion types/conf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
types020 "github.com/containernetworking/cni/pkg/types/020"
"github.com/containernetworking/plugins/pkg/ns"
"github.com/containernetworking/plugins/pkg/testutils"
testhelpers "github.com/intel/multus-cni/testing"
testhelpers "gopkg.in/intel/multus-cni.v3/testing"
netutils "github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/utils"

. "github.com/onsi/ginkgo"
Expand Down
5 changes: 5 additions & 0 deletions vendor/golang.org/x/net/html/node.go

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

3 changes: 3 additions & 0 deletions vendor/golang.org/x/net/html/render.go

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

6 changes: 0 additions & 6 deletions vendor/golang.org/x/net/http2/http2.go

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

11 changes: 4 additions & 7 deletions vendor/golang.org/x/net/http2/server.go

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

3 changes: 0 additions & 3 deletions vendor/golang.org/x/net/http2/transport.go

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

2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ github.com/vishvananda/netlink/nl
github.com/vishvananda/netns
# golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550
golang.org/x/crypto/ssh/terminal
# golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa
# golang.org/x/net v0.0.0-20200226121028-0de0cce0169b
golang.org/x/net/context
golang.org/x/net/context/ctxhttp
golang.org/x/net/html
Expand Down

0 comments on commit 4eac660

Please sign in to comment.