Skip to content
This repository was archived by the owner on Feb 26, 2019. It is now read-only.
This repository was archived by the owner on Feb 26, 2019. It is now read-only.

Build failed after godep save #562

@fanux

Description

@fanux

go build success,
then I godep save and go build failed:

# git.xfyun.cn/container/genesis/modules/authentication
modules/authentication/createKubeConfigGo.go:135:40: cannot use kubeconfig.CreateWithToken(spec.APIServer, clustername, spec.ClientName, "git.xfyun.cn/container/genesis/vendor/k8s.io/client-go/util/cert".EncodeCertPEM(spec.CACert), spec.TokenAuth.Token) (type *"k8s.io/client-go/tools/clientcmd/api".Config) as type *"git.xfyun.cn/container/genesis/vendor/k8s.io/client-go/tools/clientcmd/api".Config in return argument
modules/authentication/createKubeConfigGo.go:150:86: cannot use clientCertConfig (type "git.xfyun.cn/container/genesis/vendor/k8s.io/client-go/util/cert".Config) as type "k8s.io/client-go/util/cert".Config in argument to pkiutil.NewCertAndKey
modules/authentication/createKubeConfigGo.go:156:39: cannot use kubeconfig.CreateWithCerts(spec.APIServer, clustername, spec.ClientName, "git.xfyun.cn/container/genesis/vendor/k8s.io/client-go/util/cert".EncodeCertPEM(spec.CACert), "git.xfyun.cn/container/genesis/vendor/k8s.io/client-go/util/cert".EncodePrivateKeyPEM(clientKey), "git.xfyun.cn/container/genesis/vendor/k8s.io/client-go/util/cert".EncodeCertPEM(clientCert)) (type *"k8s.io/client-go/tools/clientcmd/api".Config) as type *"git.xfyun.cn/container/genesis/vendor/k8s.io/client-go/tools/clientcmd/api".Config in return argument
modules/authentication/createKubeConfigGo.go:175:35: cannot use config (type *"git.xfyun.cn/container/genesis/vendor/k8s.io/client-go/tools/clientcmd/api".Config) as type *"k8s.io/client-go/tools/clientcmd/api".Config in argument to kubeconfig.WriteToDisk

Steps to reproduce behavior

git clone https://github.com/kubernetes/kubernetes
cp -r kubernetes $GOPATH/src/k8s.io/
cp -r kubernetes/vendor/k8s.io/* $GOPATH/src/k8s.io
rm  $GOPATH/src/k8s.io/kubernetes/.git
cd $GOPATH/src/k8s.io
git init && git add . && git commit -m add

Our project using kubernetes source code, then go build will success.
then:

godep save
go build

build failed.
beacuse of godep not save kubernetes:

╰─➤  ls vendor/k8s.io                                                                                               2 ↵
api          apimachinery client-go    utils

we import this: kubeadmutil "k8s.io/kubernetes/cmd/kubeadm/app/util"

godep version output

godep v80 (darwin/amd64/go1.9.2)

go version output

go version go1.9.2 darwin/amd64

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions