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

Build failed after godep save #562

Open
fanux opened this issue Jul 10, 2018 · 1 comment
Open

Build failed after godep save #562

fanux opened this issue Jul 10, 2018 · 1 comment

Comments

@fanux
Copy link

fanux commented Jul 10, 2018

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
Copy link

godep go build ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants