diff --git a/cluster/addons.go b/cluster/addons.go index f3ea2118..ab48f9e6 100644 --- a/cluster/addons.go +++ b/cluster/addons.go @@ -3,7 +3,7 @@ package cluster import ( "fmt" - "github.com/Sirupsen/logrus" + "github.com/sirupsen/logrus" ) const ( diff --git a/cluster/certificates.go b/cluster/certificates.go index 43232eca..d66be4b7 100644 --- a/cluster/certificates.go +++ b/cluster/certificates.go @@ -5,9 +5,9 @@ import ( "fmt" "time" - "github.com/Sirupsen/logrus" "github.com/rancher/rke/k8s" "github.com/rancher/rke/pki" + "github.com/sirupsen/logrus" "k8s.io/client-go/kubernetes" "k8s.io/client-go/util/cert" ) diff --git a/cluster/cluster.go b/cluster/cluster.go index d4858bcf..46ae340c 100644 --- a/cluster/cluster.go +++ b/cluster/cluster.go @@ -4,11 +4,11 @@ import ( "fmt" "net" - "github.com/Sirupsen/logrus" - "github.com/alena1108/cluster-controller/client/v1" "github.com/rancher/rke/hosts" "github.com/rancher/rke/pki" "github.com/rancher/rke/services" + "github.com/rancher/types/io.cattle.cluster/v1" + "github.com/sirupsen/logrus" yaml "gopkg.in/yaml.v2" "k8s.io/client-go/kubernetes" ) diff --git a/cluster/hosts.go b/cluster/hosts.go index 1ec786c8..0245084d 100644 --- a/cluster/hosts.go +++ b/cluster/hosts.go @@ -3,10 +3,10 @@ package cluster import ( "fmt" - "github.com/Sirupsen/logrus" "github.com/rancher/rke/hosts" "github.com/rancher/rke/pki" "github.com/rancher/rke/services" + "github.com/sirupsen/logrus" ) func (c *Cluster) TunnelHosts() error { diff --git a/cluster/kubectl.go b/cluster/kubectl.go index 2379e328..1118dc8a 100644 --- a/cluster/kubectl.go +++ b/cluster/kubectl.go @@ -4,11 +4,11 @@ import ( "context" "fmt" - "github.com/Sirupsen/logrus" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/container" "github.com/rancher/rke/docker" "github.com/rancher/rke/pki" + "github.com/sirupsen/logrus" ) const ( diff --git a/cluster/network.go b/cluster/network.go index b5bb4e0e..b19fc3f2 100644 --- a/cluster/network.go +++ b/cluster/network.go @@ -3,7 +3,7 @@ package cluster import ( "fmt" - "github.com/Sirupsen/logrus" + "github.com/sirupsen/logrus" ) const ( diff --git a/cluster/state.go b/cluster/state.go index 67c25acc..7355e0d5 100644 --- a/cluster/state.go +++ b/cluster/state.go @@ -4,13 +4,13 @@ import ( "fmt" "time" - "github.com/Sirupsen/logrus" "github.com/rancher/rke/hosts" "github.com/rancher/rke/k8s" "github.com/rancher/rke/pki" + "github.com/sirupsen/logrus" yaml "gopkg.in/yaml.v2" + "k8s.io/api/core/v1" "k8s.io/client-go/kubernetes" - "k8s.io/client-go/pkg/api/v1" ) func (c *Cluster) SaveClusterState(clusterFile string) error { diff --git a/cmd/cluster.go b/cmd/cluster.go index 28c2b806..7ed6c8b3 100644 --- a/cmd/cluster.go +++ b/cmd/cluster.go @@ -6,9 +6,9 @@ import ( "os" "path/filepath" - "github.com/Sirupsen/logrus" "github.com/rancher/rke/cluster" "github.com/rancher/rke/pki" + "github.com/sirupsen/logrus" "github.com/urfave/cli" "k8s.io/client-go/util/cert" ) diff --git a/docker/docker.go b/docker/docker.go index bcd6c9e5..9a389534 100644 --- a/docker/docker.go +++ b/docker/docker.go @@ -7,10 +7,10 @@ import ( "io/ioutil" "os" - "github.com/Sirupsen/logrus" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/container" "github.com/docker/docker/client" + "github.com/sirupsen/logrus" ) func DoRunContainer(dClient *client.Client, imageCfg *container.Config, hostCfg *container.HostConfig, containerName string, hostname string, plane string) error { diff --git a/hosts/dialer.go b/hosts/dialer.go index 6fc6f7d9..140c398c 100644 --- a/hosts/dialer.go +++ b/hosts/dialer.go @@ -7,8 +7,8 @@ import ( "net/http" "os" - "github.com/Sirupsen/logrus" "github.com/docker/docker/client" + "github.com/sirupsen/logrus" "golang.org/x/crypto/ssh" ) diff --git a/hosts/hosts.go b/hosts/hosts.go index 511b818b..0f47c4e4 100644 --- a/hosts/hosts.go +++ b/hosts/hosts.go @@ -1,10 +1,10 @@ package hosts import ( - "github.com/Sirupsen/logrus" - "github.com/alena1108/cluster-controller/client/v1" "github.com/docker/docker/client" "github.com/rancher/rke/k8s" + "github.com/rancher/types/io.cattle.cluster/v1" + "github.com/sirupsen/logrus" "k8s.io/client-go/kubernetes" ) diff --git a/k8s/k8s.go b/k8s/k8s.go index 513caefe..dd5f9001 100644 --- a/k8s/k8s.go +++ b/k8s/k8s.go @@ -1,10 +1,10 @@ package k8s import ( + "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" - "k8s.io/client-go/pkg/api/v1" "k8s.io/client-go/tools/clientcmd" ) @@ -31,11 +31,12 @@ func UpdateConfigMap(k8sClient *kubernetes.Clientset, configYaml []byte, configM configMapName: string(configYaml), }, } - if _, err := k8sClient.ConfigMaps(metav1.NamespaceSystem).Create(cfgMap); err != nil { + + if _, err := k8sClient.CoreV1().ConfigMaps(metav1.NamespaceSystem).Create(cfgMap); err != nil { if !apierrors.IsAlreadyExists(err) { return err } - if _, err := k8sClient.ConfigMaps(metav1.NamespaceSystem).Update(cfgMap); err != nil { + if _, err := k8sClient.CoreV1().ConfigMaps(metav1.NamespaceSystem).Update(cfgMap); err != nil { return err } } @@ -43,7 +44,7 @@ func UpdateConfigMap(k8sClient *kubernetes.Clientset, configYaml []byte, configM } func GetConfigMap(k8sClient *kubernetes.Clientset, configMapName string) (*v1.ConfigMap, error) { - return k8sClient.ConfigMaps(metav1.NamespaceSystem).Get(configMapName, metav1.GetOptions{}) + return k8sClient.CoreV1().ConfigMaps(metav1.NamespaceSystem).Get(configMapName, metav1.GetOptions{}) } func UpdateSecret(k8sClient *kubernetes.Clientset, fieldName string, secretData []byte, secretName string) error { @@ -56,12 +57,12 @@ func UpdateSecret(k8sClient *kubernetes.Clientset, fieldName string, secretData fieldName: secretData, }, } - if _, err := k8sClient.Secrets(metav1.NamespaceSystem).Create(secret); err != nil { + if _, err := k8sClient.CoreV1().Secrets(metav1.NamespaceSystem).Create(secret); err != nil { if !apierrors.IsAlreadyExists(err) { return err } // update secret if its already exist - oldSecret, err := k8sClient.Secrets(metav1.NamespaceSystem).Get(secretName, metav1.GetOptions{}) + oldSecret, err := k8sClient.CoreV1().Secrets(metav1.NamespaceSystem).Get(secretName, metav1.GetOptions{}) if err != nil { return err } @@ -74,7 +75,7 @@ func UpdateSecret(k8sClient *kubernetes.Clientset, fieldName string, secretData }, Data: newData, } - if _, err := k8sClient.Secrets(metav1.NamespaceSystem).Update(secret); err != nil { + if _, err := k8sClient.CoreV1().Secrets(metav1.NamespaceSystem).Update(secret); err != nil { return err } } @@ -82,9 +83,9 @@ func UpdateSecret(k8sClient *kubernetes.Clientset, fieldName string, secretData } func GetSecret(k8sClient *kubernetes.Clientset, secretName string) (*v1.Secret, error) { - return k8sClient.Secrets(metav1.NamespaceSystem).Get(secretName, metav1.GetOptions{}) + return k8sClient.CoreV1().Secrets(metav1.NamespaceSystem).Get(secretName, metav1.GetOptions{}) } func DeleteNode(k8sClient *kubernetes.Clientset, nodeName string) error { - return k8sClient.Nodes().Delete(nodeName, &metav1.DeleteOptions{}) + return k8sClient.CoreV1().Nodes().Delete(nodeName, &metav1.DeleteOptions{}) } diff --git a/k8s/k8s_test.go b/k8s/k8s_test.go index f4d59f91..10acfeff 100644 --- a/k8s/k8s_test.go +++ b/k8s/k8s_test.go @@ -4,9 +4,9 @@ import ( "testing" check "gopkg.in/check.v1" + "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" - "k8s.io/client-go/pkg/api/v1" ) const ( diff --git a/main.go b/main.go index ad016278..e9212e16 100644 --- a/main.go +++ b/main.go @@ -3,8 +3,8 @@ package main import ( "os" - "github.com/Sirupsen/logrus" "github.com/rancher/rke/cmd" + "github.com/sirupsen/logrus" "github.com/urfave/cli" ) diff --git a/pki/deploy.go b/pki/deploy.go index b76b93b8..2fa99564 100644 --- a/pki/deploy.go +++ b/pki/deploy.go @@ -6,11 +6,11 @@ import ( "io/ioutil" "time" - "github.com/Sirupsen/logrus" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/container" "github.com/rancher/rke/docker" "github.com/rancher/rke/hosts" + "github.com/sirupsen/logrus" ) func DeployCertificatesOnMasters(cpHosts []hosts.Host, crtMap map[string]CertificatePKI) error { diff --git a/pki/pki.go b/pki/pki.go index bb334316..28adf76a 100644 --- a/pki/pki.go +++ b/pki/pki.go @@ -6,8 +6,8 @@ import ( "fmt" "net" - "github.com/Sirupsen/logrus" "github.com/rancher/rke/hosts" + "github.com/sirupsen/logrus" "k8s.io/client-go/util/cert" ) diff --git a/pki/pki_test.go b/pki/pki_test.go index 3db28cf9..391501f1 100644 --- a/pki/pki_test.go +++ b/pki/pki_test.go @@ -6,8 +6,8 @@ import ( "net" "testing" - "github.com/alena1108/cluster-controller/client/v1" "github.com/rancher/rke/hosts" + "github.com/rancher/types/client/cluster/v1" ) const ( diff --git a/services/controlplane.go b/services/controlplane.go index 03716a2b..edbe0482 100644 --- a/services/controlplane.go +++ b/services/controlplane.go @@ -1,9 +1,9 @@ package services import ( - "github.com/Sirupsen/logrus" - "github.com/alena1108/cluster-controller/client/v1" "github.com/rancher/rke/hosts" + "github.com/rancher/types/io.cattle.cluster/v1" + "github.com/sirupsen/logrus" ) func RunControlPlane(controlHosts []hosts.Host, etcdHosts []hosts.Host, controlServices v1.RKEConfigServices) error { diff --git a/services/etcd.go b/services/etcd.go index 02bdca08..ab5e9465 100644 --- a/services/etcd.go +++ b/services/etcd.go @@ -1,12 +1,12 @@ package services import ( - "github.com/Sirupsen/logrus" - "github.com/alena1108/cluster-controller/client/v1" "github.com/docker/docker/api/types/container" "github.com/docker/go-connections/nat" "github.com/rancher/rke/docker" "github.com/rancher/rke/hosts" + "github.com/rancher/types/io.cattle.cluster/v1" + "github.com/sirupsen/logrus" ) func RunEtcdPlane(etcdHosts []hosts.Host, etcdService v1.ETCDService) error { diff --git a/services/kubeapi.go b/services/kubeapi.go index 385bf885..2dadc513 100644 --- a/services/kubeapi.go +++ b/services/kubeapi.go @@ -1,12 +1,12 @@ package services import ( - "github.com/alena1108/cluster-controller/client/v1" "github.com/docker/docker/api/types/container" "github.com/docker/go-connections/nat" "github.com/rancher/rke/docker" "github.com/rancher/rke/hosts" "github.com/rancher/rke/pki" + "github.com/rancher/types/io.cattle.cluster/v1" ) func runKubeAPI(host hosts.Host, etcdHosts []hosts.Host, kubeAPIService v1.KubeAPIService) error { diff --git a/services/kubecontroller.go b/services/kubecontroller.go index 2b27e6fd..a5691394 100644 --- a/services/kubecontroller.go +++ b/services/kubecontroller.go @@ -1,11 +1,11 @@ package services import ( - "github.com/alena1108/cluster-controller/client/v1" "github.com/docker/docker/api/types/container" "github.com/rancher/rke/docker" "github.com/rancher/rke/hosts" "github.com/rancher/rke/pki" + "github.com/rancher/types/io.cattle.cluster/v1" ) func runKubeController(host hosts.Host, kubeControllerService v1.KubeControllerService) error { diff --git a/services/kubelet.go b/services/kubelet.go index 9fbeabf3..d3c7adab 100644 --- a/services/kubelet.go +++ b/services/kubelet.go @@ -1,12 +1,12 @@ package services import ( - "github.com/alena1108/cluster-controller/client/v1" "github.com/docker/docker/api/types/container" "github.com/docker/go-connections/nat" "github.com/rancher/rke/docker" "github.com/rancher/rke/hosts" "github.com/rancher/rke/pki" + "github.com/rancher/types/io.cattle.cluster/v1" ) func runKubelet(host hosts.Host, kubeletService v1.KubeletService, isMaster bool) error { diff --git a/services/kubeproxy.go b/services/kubeproxy.go index 5f13397e..ecf2e124 100644 --- a/services/kubeproxy.go +++ b/services/kubeproxy.go @@ -1,11 +1,11 @@ package services import ( - "github.com/alena1108/cluster-controller/client/v1" "github.com/docker/docker/api/types/container" "github.com/rancher/rke/docker" "github.com/rancher/rke/hosts" "github.com/rancher/rke/pki" + "github.com/rancher/types/io.cattle.cluster/v1" ) func runKubeproxy(host hosts.Host, kubeproxyService v1.KubeproxyService) error { diff --git a/services/scheduler.go b/services/scheduler.go index 25d0f2df..f2d57be2 100644 --- a/services/scheduler.go +++ b/services/scheduler.go @@ -1,11 +1,11 @@ package services import ( - "github.com/alena1108/cluster-controller/client/v1" "github.com/docker/docker/api/types/container" "github.com/rancher/rke/docker" "github.com/rancher/rke/hosts" "github.com/rancher/rke/pki" + "github.com/rancher/types/io.cattle.cluster/v1" ) func runScheduler(host hosts.Host, schedulerService v1.SchedulerService) error { diff --git a/services/workerplane.go b/services/workerplane.go index d6e7c0a4..df40530f 100644 --- a/services/workerplane.go +++ b/services/workerplane.go @@ -1,9 +1,9 @@ package services import ( - "github.com/Sirupsen/logrus" - "github.com/alena1108/cluster-controller/client/v1" "github.com/rancher/rke/hosts" + "github.com/rancher/types/io.cattle.cluster/v1" + "github.com/sirupsen/logrus" ) func RunWorkerPlane(controlHosts []hosts.Host, workerHosts []hosts.Host, workerServices v1.RKEConfigServices) error { diff --git a/vendor.conf b/vendor.conf index 8293eee4..bb0a0772 100644 --- a/vendor.conf +++ b/vendor.conf @@ -1,7 +1,7 @@ # package github.com/rancher/rke -github.com/Sirupsen/logrus v0.10.0 +github.com/sirupsen/logrus v1.0.3 github.com/urfave/cli v1.18.0 golang.org/x/crypto 2509b142fb2b797aa7587dad548f113b2c0f20ce gopkg.in/yaml.v2 eb3733d160e74a9c7e442f435eb3bea458e1d19f @@ -10,10 +10,13 @@ github.com/docker/distribution 3800056b8832cf6075e78b282ac010131d8687b github.com/docker/go-connections 3ede32e2033de7505e6500d6c868c2b9ed9f169d github.com/docker/go-units 0dadbb0345b35ec7ef35e228dabb8de89a65bf52 golang.org/x/net 186fd3fc8194a5e9980a82230d69c1ff7134229f +github.com/rancher/types 582dfda7d374d8a36dd0c7a2385d18c4c2ce5f3c github.com/opencontainers/go-digest 279bed98673dd5bef374d3b6e4b09e2af76183bf github.com/gogo/protobuf 117892bf1866fbaa2318c03e50e40564c8845457 github.com/opencontainers/image-spec 7c889fafd04a893f5c5f50b7ab9963d5d64e5242 github.com/pkg/errors f15c970de5b76fac0b59abb32d62c17cc7bed265 -k8s.io/client-go v4.0.0 transitive=true +github.com/rancher/norman 068b9eb94326e2c566c5eed7636163b1b407c4c0 gopkg.in/check.v1 11d3bc7aa68e238947792f30573146a3231fc0f1 -github.com/alena1108/cluster-controller 85168a7fe249bf97f703afe53f03d3654cc70350 +k8s.io/api/core/v1 4df58c811fe2e65feb879227b2b245e4dc26e7ad +k8s.io/client-go v5.0.0 transitive=true +github.com/gorilla/websocket v1.2.0