tools / godep

dependency tool for go
http://godoc.org/github.com/tools/godep
BSD 3-Clause "New" or "Revised" License
5.55k stars 455 forks source link

Build failed after godep save #562

Open fanux opened 6 years ago

fanux commented 6 years ago

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

usernameisnull commented 5 years ago

godep go build ?