diff --git a/.gitmodules b/.gitmodules index 21de8218..6cf8f176 100644 --- a/.gitmodules +++ b/.gitmodules @@ -133,3 +133,48 @@ [submodule "vendor/golang.org/x/net"] path = vendor/golang.org/x/net url = https://github.com/golang/net +[submodule "vendor/k8s.io/api"] + path = vendor/k8s.io/api + url = https://github.com/kubernetes/api +[submodule "vendor/k8s.io/apimachinery"] + path = vendor/k8s.io/apimachinery + url = https://github.com/kubernetes/apimachinery +[submodule "vendor/github.com/PuerkitoBio/purell"] + path = vendor/github.com/PuerkitoBio/purell + url = https://github.com/PuerkitoBio/purell +[submodule "vendor/github.com/PuerkitoBio/urlesc"] + path = vendor/github.com/PuerkitoBio/urlesc + url = https://github.com/PuerkitoBio/urlesc +[submodule "vendor/github.com/emicklei/go-restful"] + path = vendor/github.com/emicklei/go-restful + url = https://github.com/emicklei/go-restful +[submodule "vendor/github.com/go-openapi/jsonpointer"] + path = vendor/github.com/go-openapi/jsonpointer + url = https://github.com/go-openapi/jsonpointer +[submodule "vendor/github.com/go-openapi/jsonreference"] + path = vendor/github.com/go-openapi/jsonreference + url = https://github.com/go-openapi/jsonreference +[submodule "vendor/github.com/go-openapi/spec"] + path = vendor/github.com/go-openapi/spec + url = https://github.com/go-openapi/spec +[submodule "vendor/github.com/go-openapi/swag"] + path = vendor/github.com/go-openapi/swag + url = https://github.com/go-openapi/swag +[submodule "vendor/github.com/golang/glog"] + path = vendor/github.com/golang/glog + url = https://github.com/golang/glog +[submodule "vendor/github.com/google/gofuzz"] + path = vendor/github.com/google/gofuzz + url = https://github.com/google/gofuzz +[submodule "vendor/github.com/mailru/easyjson"] + path = vendor/github.com/mailru/easyjson + url = https://github.com/mailru/easyjson +[submodule "vendor/k8s.io/kube-openapi"] + path = vendor/k8s.io/kube-openapi + url = https://github.com/kubernetes/kube-openapi +[submodule "vendor/golang.org/x/text"] + path = vendor/golang.org/x/text + url = https://go.googlesource.com/text +[submodule "vendor/gopkg.in/yaml.v2"] + path = vendor/gopkg.in/yaml.v2 + url = https://gopkg.in/yaml.v2 diff --git a/npc/analyser.go b/npc/analyser.go index 312d529c..cc8625f1 100644 --- a/npc/analyser.go +++ b/npc/analyser.go @@ -3,9 +3,9 @@ package npc import ( "fmt" - "k8s.io/client-go/pkg/api" - extnapi "k8s.io/client-go/pkg/apis/extensions/v1beta1" - "k8s.io/client-go/pkg/util/intstr" + apiv1 "k8s.io/api/core/v1" + extnapi "k8s.io/api/extensions/v1beta1" + "k8s.io/apimachinery/pkg/util/intstr" "github.com/weaveworks/weave/npc/ipset" ) @@ -92,7 +92,7 @@ func (ns *ns) analysePolicy(policy *extnapi.NetworkPolicy) ( func withNormalisedProtoAndPort(npps []extnapi.NetworkPolicyPort, f func(proto, port string)) { for _, npp := range npps { // If no proto is specified, default to TCP - proto := string(api.ProtocolTCP) + proto := string(apiv1.ProtocolTCP) if npp.Protocol != nil { proto = string(*npp.Protocol) } diff --git a/npc/controller.go b/npc/controller.go index f6419f94..6a586f51 100644 --- a/npc/controller.go +++ b/npc/controller.go @@ -4,8 +4,8 @@ import ( "sync" "github.com/pkg/errors" - coreapi "k8s.io/client-go/pkg/api/v1" - extnapi "k8s.io/client-go/pkg/apis/extensions/v1beta1" + coreapi "k8s.io/api/core/v1" + extnapi "k8s.io/api/extensions/v1beta1" "github.com/weaveworks/weave/common" "github.com/weaveworks/weave/npc/ipset" diff --git a/npc/controller_test.go b/npc/controller_test.go index 32fcedcc..b8dacdd2 100644 --- a/npc/controller_test.go +++ b/npc/controller_test.go @@ -7,10 +7,10 @@ import ( "github.com/pkg/errors" "github.com/stretchr/testify/require" "github.com/weaveworks/weave/npc/ipset" - unversionedapi "k8s.io/client-go/pkg/api/unversioned" - coreapi "k8s.io/client-go/pkg/api/v1" - extnapi "k8s.io/client-go/pkg/apis/extensions/v1beta1" - "k8s.io/client-go/pkg/util/intstr" + coreapi "k8s.io/api/core/v1" + extnapi "k8s.io/api/extensions/v1beta1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/util/intstr" ) type mockSet struct { @@ -109,7 +109,7 @@ func TestRegressionPolicyNamespaceOrdering3059(t *testing.T) { // https://github.com/weaveworks/weave/issues/3059 sourceNamespace := &coreapi.Namespace{ - ObjectMeta: coreapi.ObjectMeta{ + ObjectMeta: metav1.ObjectMeta{ Name: "source", Labels: map[string]string{ "app": "source", @@ -118,7 +118,7 @@ func TestRegressionPolicyNamespaceOrdering3059(t *testing.T) { } destinationNamespace := &coreapi.Namespace{ - ObjectMeta: coreapi.ObjectMeta{ + ObjectMeta: metav1.ObjectMeta{ Name: "destination", }, } @@ -126,7 +126,7 @@ func TestRegressionPolicyNamespaceOrdering3059(t *testing.T) { port := intstr.FromInt(12345) networkPolicy := &extnapi.NetworkPolicy{ - ObjectMeta: coreapi.ObjectMeta{ + ObjectMeta: metav1.ObjectMeta{ Name: "network-policy", Namespace: "destination", }, @@ -135,7 +135,7 @@ func TestRegressionPolicyNamespaceOrdering3059(t *testing.T) { { From: []extnapi.NetworkPolicyPeer{ { - NamespaceSelector: &unversionedapi.LabelSelector{ + NamespaceSelector: &metav1.LabelSelector{ MatchLabels: map[string]string{ "app": "source", }, diff --git a/npc/namespace.go b/npc/namespace.go index 1925ec71..6caf712b 100644 --- a/npc/namespace.go +++ b/npc/namespace.go @@ -4,11 +4,11 @@ import ( "encoding/json" "fmt" - "k8s.io/client-go/pkg/api/unversioned" - coreapi "k8s.io/client-go/pkg/api/v1" - extnapi "k8s.io/client-go/pkg/apis/extensions/v1beta1" - "k8s.io/client-go/pkg/types" - "k8s.io/client-go/pkg/util/uuid" + coreapi "k8s.io/api/core/v1" + extnapi "k8s.io/api/extensions/v1beta1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/util/uuid" "github.com/weaveworks/weave/common" "github.com/weaveworks/weave/npc/ipset" @@ -34,7 +34,7 @@ type ns struct { } func newNS(name, nodeName string, ipt iptables.Interface, ips ipset.Interface, nsSelectors *selectorSet) (*ns, error) { - allPods, err := newSelectorSpec(&unversioned.LabelSelector{}, name, ipset.HashIP) + allPods, err := newSelectorSpec(&metav1.LabelSelector{}, name, ipset.HashIP) if err != nil { return nil, err } diff --git a/npc/rule.go b/npc/rule.go index fd695f98..c0a334c0 100644 --- a/npc/rule.go +++ b/npc/rule.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - "k8s.io/client-go/pkg/types" + "k8s.io/apimachinery/pkg/types" "github.com/weaveworks/weave/common" "github.com/weaveworks/weave/npc/iptables" diff --git a/npc/selector.go b/npc/selector.go index b1c065cb..9896096b 100644 --- a/npc/selector.go +++ b/npc/selector.go @@ -1,9 +1,9 @@ package npc import ( - "k8s.io/client-go/pkg/api/unversioned" - "k8s.io/client-go/pkg/labels" - "k8s.io/client-go/pkg/types" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/types" "github.com/weaveworks/weave/common" "github.com/weaveworks/weave/npc/ipset" @@ -18,8 +18,8 @@ type selectorSpec struct { nsName string // Namespace name } -func newSelectorSpec(json *unversioned.LabelSelector, nsName string, ipsetType ipset.Type) (*selectorSpec, error) { - selector, err := unversioned.LabelSelectorAsSelector(json) +func newSelectorSpec(json *metav1.LabelSelector, nsName string, ipsetType ipset.Type) (*selectorSpec, error) { + selector, err := metav1.LabelSelectorAsSelector(json) if err != nil { return nil, err } diff --git a/prog/kube-peers/main.go b/prog/kube-peers/main.go index b2e513fc..a0b9cd85 100644 --- a/prog/kube-peers/main.go +++ b/prog/kube-peers/main.go @@ -5,8 +5,8 @@ import ( "log" "net" + api "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" - api "k8s.io/client-go/pkg/api/v1" "k8s.io/client-go/rest" ) @@ -19,7 +19,7 @@ func getKubePeers() ([]string, error) { if err != nil { return nil, err } - nodeList, err := c.Nodes().List(api.ListOptions{}) + nodeList, err := c.Core().Nodes().List(api.ListOptions{}) if err != nil { return nil, err } diff --git a/prog/weave-npc/main.go b/prog/weave-npc/main.go index 2821bd7d..eff0ef07 100644 --- a/prog/weave-npc/main.go +++ b/prog/weave-npc/main.go @@ -7,12 +7,12 @@ import ( "github.com/coreos/go-iptables/iptables" "github.com/spf13/cobra" + coreapi "k8s.io/api/core/v1" + extnapi "k8s.io/api/extensions/v1beta1" + "k8s.io/apimachinery/pkg/fields" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/kubernetes" - coreapi "k8s.io/client-go/pkg/api/v1" - extnapi "k8s.io/client-go/pkg/apis/extensions/v1beta1" - "k8s.io/client-go/pkg/fields" - "k8s.io/client-go/pkg/runtime" - "k8s.io/client-go/pkg/util/wait" "k8s.io/client-go/rest" "k8s.io/client-go/tools/cache" @@ -34,7 +34,7 @@ var ( func handleError(err error) { common.CheckFatal(err) } func makeController(getter cache.Getter, resource string, - objType runtime.Object, handlers cache.ResourceEventHandlerFuncs) *cache.Controller { + objType runtime.Object, handlers cache.ResourceEventHandlerFuncs) cache.Controller { listWatch := cache.NewListWatchFromClient(getter, resource, "", fields.Everything()) _, controller := cache.NewInformer(listWatch, objType, 0, handlers) return controller diff --git a/vendor/github.com/PuerkitoBio/purell b/vendor/github.com/PuerkitoBio/purell new file mode 160000 index 00000000..fd18e053 --- /dev/null +++ b/vendor/github.com/PuerkitoBio/purell @@ -0,0 +1 @@ +Subproject commit fd18e053af8a4ff11039269006e8037ff374ce0e diff --git a/vendor/github.com/PuerkitoBio/urlesc b/vendor/github.com/PuerkitoBio/urlesc new file mode 160000 index 00000000..de5bf2ad --- /dev/null +++ b/vendor/github.com/PuerkitoBio/urlesc @@ -0,0 +1 @@ +Subproject commit de5bf2ad457846296e2031421a34e2568e304e35 diff --git a/vendor/github.com/emicklei/go-restful b/vendor/github.com/emicklei/go-restful new file mode 160000 index 00000000..dc0f94ee --- /dev/null +++ b/vendor/github.com/emicklei/go-restful @@ -0,0 +1 @@ +Subproject commit dc0f94ee75de39d6420e5446b0222490264bb90f diff --git a/vendor/github.com/go-openapi/jsonpointer b/vendor/github.com/go-openapi/jsonpointer new file mode 160000 index 00000000..779f4530 --- /dev/null +++ b/vendor/github.com/go-openapi/jsonpointer @@ -0,0 +1 @@ +Subproject commit 779f45308c19820f1a69e9a4cd965f496e0da10f diff --git a/vendor/github.com/go-openapi/jsonreference b/vendor/github.com/go-openapi/jsonreference new file mode 160000 index 00000000..36d33bfe --- /dev/null +++ b/vendor/github.com/go-openapi/jsonreference @@ -0,0 +1 @@ +Subproject commit 36d33bfe519efae5632669801b180bf1a245da3b diff --git a/vendor/github.com/go-openapi/spec b/vendor/github.com/go-openapi/spec new file mode 160000 index 00000000..48c2a718 --- /dev/null +++ b/vendor/github.com/go-openapi/spec @@ -0,0 +1 @@ +Subproject commit 48c2a7185575f9103a5a3863eff950bb776899d2 diff --git a/vendor/github.com/go-openapi/swag b/vendor/github.com/go-openapi/swag new file mode 160000 index 00000000..f3f94946 --- /dev/null +++ b/vendor/github.com/go-openapi/swag @@ -0,0 +1 @@ +Subproject commit f3f9494671f93fcff853e3c6e9e948b3eb71e590 diff --git a/vendor/github.com/golang/glog b/vendor/github.com/golang/glog new file mode 160000 index 00000000..23def4e6 --- /dev/null +++ b/vendor/github.com/golang/glog @@ -0,0 +1 @@ +Subproject commit 23def4e6c14b4da8ac2ed8007337bc5eb5007998 diff --git a/vendor/github.com/google/gofuzz b/vendor/github.com/google/gofuzz new file mode 160000 index 00000000..24818f79 --- /dev/null +++ b/vendor/github.com/google/gofuzz @@ -0,0 +1 @@ +Subproject commit 24818f796faf91cd76ec7bddd72458fbced7a6c1 diff --git a/vendor/github.com/mailru/easyjson b/vendor/github.com/mailru/easyjson new file mode 160000 index 00000000..2a92e673 --- /dev/null +++ b/vendor/github.com/mailru/easyjson @@ -0,0 +1 @@ +Subproject commit 2a92e673c9a6302dd05c3a691ae1f24aef46457d diff --git a/vendor/golang.org/x/text b/vendor/golang.org/x/text new file mode 160000 index 00000000..825fc78a --- /dev/null +++ b/vendor/golang.org/x/text @@ -0,0 +1 @@ +Subproject commit 825fc78a2fd6fa0a5447e300189e3219e05e1f25 diff --git a/vendor/gopkg.in/yaml.v2 b/vendor/gopkg.in/yaml.v2 new file mode 160000 index 00000000..eb3733d1 --- /dev/null +++ b/vendor/gopkg.in/yaml.v2 @@ -0,0 +1 @@ +Subproject commit eb3733d160e74a9c7e442f435eb3bea458e1d19f diff --git a/vendor/k8s.io/api b/vendor/k8s.io/api new file mode 160000 index 00000000..81aa3433 --- /dev/null +++ b/vendor/k8s.io/api @@ -0,0 +1 @@ +Subproject commit 81aa34336d28aadc3a8e8da7dfd9258c5157e5e4 diff --git a/vendor/k8s.io/apimachinery b/vendor/k8s.io/apimachinery new file mode 160000 index 00000000..3b05bbfa --- /dev/null +++ b/vendor/k8s.io/apimachinery @@ -0,0 +1 @@ +Subproject commit 3b05bbfa0a45413bfa184edbf9af617e277962fb diff --git a/vendor/k8s.io/client-go b/vendor/k8s.io/client-go index b22087a5..82aa0638 160000 --- a/vendor/k8s.io/client-go +++ b/vendor/k8s.io/client-go @@ -1 +1 @@ -Subproject commit b22087a53becae45931ed72d5e0f12e0031d771a +Subproject commit 82aa063804cf055e16e8911250f888bc216e8b61 diff --git a/vendor/k8s.io/kube-openapi b/vendor/k8s.io/kube-openapi new file mode 160000 index 00000000..abfc5fbe --- /dev/null +++ b/vendor/k8s.io/kube-openapi @@ -0,0 +1 @@ +Subproject commit abfc5fbe1cf87ee697db107fdfd24c32fe4397a8