Update k8s client-go to v6.0.0 (#1340)
* Update k8s client-go to v6.0.0 This fix updates k8s client-go to v6.0.0 as CoreDNS is supported in 1.9 and v6.0.0 is the recommended version. There are quite some massive changes that need to be made: 1. k8s.io/client-go/pkg/api/v1 has been changed to k8s.io/api/v1 (repo changed from `client-go` to `api`) 2. kubernetes.Clientset adds one extra layer, so that `kubernetes.Clientset.Services()` and like has been changed to `kubernetes.Clientset.CoreV1().Services()` Also, we have to stick with specific commits of `k8s.io/apimachinery` and the newly introduced `k8s.io/api` because go dep still could not figure out the right version to fetch. Signed-off-by: Yong Tang <yong.tang.github@outlook.com> * Update vendor with `dep ensure --update` and `dep prune` Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit is contained in:
parent
bce7f5fbec
commit
7fe5b0bb1f
1278 changed files with 123970 additions and 277876 deletions
|
@ -6,8 +6,8 @@ import (
|
|||
"sync"
|
||||
"time"
|
||||
|
||||
api "k8s.io/api/core/v1"
|
||||
"k8s.io/client-go/kubernetes"
|
||||
api "k8s.io/client-go/pkg/api/v1"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
|
||||
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
@ -164,7 +164,7 @@ func serviceListFunc(c *kubernetes.Clientset, ns string, s *labels.Selector) fun
|
|||
if s != nil {
|
||||
opts.LabelSelector = (*s).String()
|
||||
}
|
||||
listV1, err := c.Services(ns).List(opts)
|
||||
listV1, err := c.CoreV1().Services(ns).List(opts)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -177,7 +177,7 @@ func podListFunc(c *kubernetes.Clientset, ns string, s *labels.Selector) func(me
|
|||
if s != nil {
|
||||
opts.LabelSelector = (*s).String()
|
||||
}
|
||||
listV1, err := c.Pods(ns).List(opts)
|
||||
listV1, err := c.CoreV1().Pods(ns).List(opts)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -190,7 +190,7 @@ func serviceWatchFunc(c *kubernetes.Clientset, ns string, s *labels.Selector) fu
|
|||
if s != nil {
|
||||
options.LabelSelector = (*s).String()
|
||||
}
|
||||
w, err := c.Services(ns).Watch(options)
|
||||
w, err := c.CoreV1().Services(ns).Watch(options)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -203,7 +203,7 @@ func podWatchFunc(c *kubernetes.Clientset, ns string, s *labels.Selector) func(o
|
|||
if s != nil {
|
||||
options.LabelSelector = (*s).String()
|
||||
}
|
||||
w, err := c.Pods(ns).Watch(options)
|
||||
w, err := c.CoreV1().Pods(ns).Watch(options)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -216,7 +216,7 @@ func endpointsListFunc(c *kubernetes.Clientset, ns string, s *labels.Selector) f
|
|||
if s != nil {
|
||||
opts.LabelSelector = (*s).String()
|
||||
}
|
||||
listV1, err := c.Endpoints(ns).List(opts)
|
||||
listV1, err := c.CoreV1().Endpoints(ns).List(opts)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -229,7 +229,7 @@ func endpointsWatchFunc(c *kubernetes.Clientset, ns string, s *labels.Selector)
|
|||
if s != nil {
|
||||
options.LabelSelector = (*s).String()
|
||||
}
|
||||
w, err := c.Endpoints(ns).Watch(options)
|
||||
w, err := c.CoreV1().Endpoints(ns).Watch(options)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -393,7 +393,7 @@ func (dns *dnsControl) EndpointsList() (eps []*api.Endpoints) {
|
|||
// returned. This query causes a roundtrip to the k8s API server, so use
|
||||
// sparingly. Currently this is only used for Federation.
|
||||
func (dns *dnsControl) GetNodeByName(name string) (*api.Node, error) {
|
||||
v1node, err := dns.client.Nodes().Get(name, meta.GetOptions{})
|
||||
v1node, err := dns.client.CoreV1().Nodes().Get(name, meta.GetOptions{})
|
||||
if err != nil {
|
||||
return &api.Node{}, err
|
||||
}
|
||||
|
@ -404,7 +404,7 @@ func (dns *dnsControl) GetNodeByName(name string) (*api.Node, error) {
|
|||
// error is returned. This query causes a roundtrip to the k8s API server, so
|
||||
// use sparingly.
|
||||
func (dns *dnsControl) GetNamespaceByName(name string) (*api.Namespace, error) {
|
||||
v1ns, err := dns.client.Namespaces().Get(name, meta.GetOptions{})
|
||||
v1ns, err := dns.client.CoreV1().Namespaces().Get(name, meta.GetOptions{})
|
||||
if err != nil {
|
||||
return &api.Namespace{}, err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue