Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

godep save ./... : cannot find package "k8s.io/kubernetes/pkg/apis/authentication.k8s.io" #117

Closed
ngtuna opened this issue Aug 20, 2016 · 9 comments

Comments

@ngtuna
Copy link
Contributor

ngtuna commented Aug 20, 2016

I added an import "k8s.io/kubernetes/pkg/kubectl/cmd" to kubenetes.go. For saving vendor, I need to run script/godep-restore.sh first. It works well. But the following godep save ./... get error:

$ godep save ./...
godep: Package (k8s.io/kubernetes/pkg/apis/authentication.k8s.io) not found

$ go get k8s.io/kubernetes/pkg/apis/authentication.k8s.io
package k8s.io/kubernetes/pkg/apis/authentication.k8s.io: cannot find package "k8s.io/kubernetes/pkg/apis/authentication.k8s.io" in any of:
    /usr/local/go/src/k8s.io/kubernetes/pkg/apis/authentication.k8s.io (from $GOROOT)
    /home/tuna/workspace/gocode-kompose-ngtuna/src/k8s.io/kubernetes/pkg/apis/authentication.k8s.io (from $GOPATH)

How do you think @kadel ?

@kadel
Copy link
Member

kadel commented Aug 22, 2016

Hmm, I can't reproduce your k8s.io/kubernetes/pkg/apis/authentication.k8s.io.

I get completely different error:

godep: Package (github.com/docker/docker/pkg/term/winconsole) not found

Reason for this error is that something down in k8s.io/kubernetes/pkg/kubectl/cmd requires github.com/docker/docker/pkg/term/winconsole, but winconsole pkg is only in old versions of docker that we can't use because we need bundlefile.

I will look if we can solve this dependency conflict by using newer k8s/origin

@kadel
Copy link
Member

kadel commented Aug 22, 2016

It doesn't look good :-( Because of that dependency conflict I can't get k8s.io/kubernetes/pkg/kubectl/cmd working :-(

@janetkuo
Copy link
Member

janetkuo commented Aug 22, 2016

I got totally different errors (failed to godep restore), I'm using godep v74. Any idea on how to fix this?

$ script/godep-restore.sh
Preloading some dependencies
fatal: remote github.com/openshift-remote already exists.
remote: Counting objects: 166, done.
remote: Compressing objects: 100% (55/55), done.
remote: Total 166 (delta 128), reused 144 (delta 108), pack-reused 0
Receiving objects: 100% (166/166), 41.73 KiB | 0 bytes/s, done.
Resolving deltas: 100% (128/128), completed with 83 local objects.
From https://github.com/kubernetes/kubernetes
   96916e4..6e5826a  release-1.3 -> upstream/release-1.3
 + bd2057a...854b7b9 refs/pull/28432/head -> origin/pr/28432  (forced update)
 + f9be0db...7029eaa refs/pull/29049/head -> origin/pr/29049  (forced update)
 + 3c5f68c...5af42f6 refs/pull/30153/head -> origin/pr/30153  (forced update)
 + 9c1ffd2...67b7c72 refs/pull/30838/head -> origin/pr/30838  (forced update)
   9ff3d8b..39fbd30  refs/pull/30959/head -> origin/pr/30959
 * [new ref]         refs/pull/31144/head -> origin/pr/31144
 * [new ref]         refs/pull/31145/head -> origin/pr/31145
 * [new ref]         refs/pull/31146/head -> origin/pr/31146
Starting to download all godeps. This takes a while
# cd /usr/local/google/home/username/go/src/github.com/docker/docker; git checkout e4a0dbc47232e3a9da4cfe6ce44f250e6e85ed43
fatal: reference is not a tree: e4a0dbc47232e3a9da4cfe6ce44f250e6e85ed43
... (lots of other similar errors)

@ngtuna
Copy link
Contributor Author

ngtuna commented Aug 23, 2016

Yah, I tested it again from a fresh clone kompose and got the same issue with @janetkuo :

$ script/godep-restore.sh
...
Starting to download all godeps. This takes a while
# cd /home/tuna/workspace/gocode-kompose-godep-problem/src/k8s.io/kubernetes; git checkout 57fb9acc109285378ecd0af925c8160eb8ca19e6
fatal: reference is not a tree: 57fb9acc109285378ecd0af925c8160eb8ca19e6
godep: error downloading dep (k8s.io/kubernetes/federation/apis/federation): exit status 128
godep: Error downloading some deps. Aborting restore and check.
Download finished into /home/tuna/workspace/gocode-kompose-godep-problem/

@kadel
Copy link
Member

kadel commented Aug 23, 2016

That is strange, I've just tried that on clean GOPATH and it godep-restore.sh worked fine.

▶ mkdir -p kompose_GOPATH/src/github.com/skippbox

▶ export GOPATH=~/tmp/kompose_GOPATH 

▶ cd $GOPATH/src/github.com/skippbox 

▶ git clone https://bitbucket.org/ymotongpoo/goenv/pull-requests/
Cloning into 'pull-requests'...
remote: Counting objects: 471, done.
remote: Compressing objects: 100% (469/469), done.
remote: Total 471 (delta 239), reused 0 (delta 0)
Receiving objects: 100% (471/471), 1.15 MiB | 1.28 MiB/s, done.
Resolving deltas: 100% (239/239), done.
Checking connectivity... done.

▶ git clone https://github.com/skippbox/kompose                  
Cloning into 'kompose'...
remote: Counting objects: 4708, done.
remote: Total 4708 (delta 0), reused 0 (delta 0), pack-reused 4708
Receiving objects: 100% (4708/4708), 4.31 MiB | 967.00 KiB/s, done.
Resolving deltas: 100% (1658/1658), done.
Checking connectivity... done.

▶ cd kompose 

▶ ./script/godep-restore.sh 
Preloading some dependencies
remote: Counting objects: 5089, done.
remote: Total 5089 (delta 2728), reused 2728 (delta 2728), pack-reused 2361
Receiving objects: 100% (5089/5089), 2.51 MiB | 3.27 MiB/s, done.
Resolving deltas: 100% (3888/3888), completed with 1153 local objects.
From https://github.com/openshift/kubernetes
 * [new branch]      master     -> github.com/openshift-remote/master
 * [new branch]      release-1.0 -> github.com/openshift-remote/release-1.0
 * [new branch]      release-1.1 -> github.com/openshift-remote/release-1.1
 * [new branch]      release-1.2 -> github.com/openshift-remote/release-1.2
 * [new branch]      release-1.2-stable-20160309 -> github.com/openshift-remote/release-1.2-stable-20160309
 * [new branch]      release-1.2-stable-20160312 -> github.com/openshift-remote/release-1.2-stable-20160312
 * [new branch]      release-1.2-stable-20160316 -> github.com/openshift-remote/release-1.2-stable-20160316
 * [new branch]      stable     -> github.com/openshift-remote/stable
 * [new branch]      stable-20160127 -> github.com/openshift-remote/stable-20160127
 * [new branch]      stable-20160211 -> github.com/openshift-remote/stable-20160211
 * [new branch]      stable-20160309 -> github.com/openshift-remote/stable-20160309
 * [new branch]      stable-20160411 -> github.com/openshift-remote/stable-20160411
 * [new branch]      stable-20160510 -> github.com/openshift-remote/stable-20160510
 * [new branch]      stable-20160615 -> github.com/openshift-remote/stable-20160615
 * [new branch]      stable-20160624 -> github.com/openshift-remote/stable-20160624
 * [new branch]      stable-20160804 -> github.com/openshift-remote/stable-20160804
 * [new branch]      stable-9da202e -> github.com/openshift-remote/stable-9da202e
 * [new tag]         v1.1.0-origin -> v1.1.0-origin
 * [new tag]         v1.2.0-origin -> v1.2.0-origin
Starting to download all godeps. This takes a while
Download finished into /home/tomas/tmp/kompose_GOPATH

▶ make binary
CGO_ENABLED=0 ./script/make.sh binary
---> Making bundle: binary (in .)
Build successful. Program saved as ./kompose

@ngtuna
Copy link
Contributor Author

ngtuna commented Aug 23, 2016

Yes that's strange. I did try on a clean GOPATH too. When I opened this issue, script/godep-restore.sh worked fine.

Why did you do this one?

git clone https://bitbucket.org/ymotongpoo/goenv/pull-requests/

@kadel
Copy link
Member

kadel commented Aug 24, 2016

Yes that's strange. I did try on a clean GOPATH too. When I opened this issue, script/godep-restore.sh worked fine.

Why did you do this one?

git clone https://bitbucket.org/ymotongpoo/goenv/pull-requests/

OH, that was copy/paste error. Its not supposed to be there :-D

@kadel
Copy link
Member

kadel commented Aug 24, 2016

Hmm, I can't reproduce your k8s.io/kubernetes/pkg/apis/authentication.k8s.io.

I get completely different error:

godep: Package (github.com/docker/docker/pkg/term/winconsole) not found

Reason for this error is that something down in k8s.io/kubernetes/pkg/kubectl/cmd requires github.com/docker/docker/pkg/term/winconsole, but winconsole pkg is only in old versions of docker that we can't use because we need bundlefile.

I will look if we can solve this dependency conflict by using newer k8s/origin

So I did some research around that. I still can't reproduce your error with authentication.k8s.io pkg :-(

If I use k8s.io/kubernetes/pkg/kubectl/cmd then godep save ./... fails on

godep: Package (github.com/docker/docker/pkg/term/winconsole) not found

This error is because we have two things in Kompose dependency chain that requires different version of github.com/docker/docker.

Kompose requires github.com/docker/docker > v1.12.0-rc1 for bundlefile support.
OpenShift and Kubernets 1.3.x require docker v1.4.1. And it is not possible to build them with v1.12 or v1.11.

This problem was in Kompose for some time (since we started using latest Docker), we didn't noticed that because we haven't used parts of Kubernetes that are calling Docker apis (or they call parts of Docker api that didn't changed between v1.4 and v1.12). k8s.io/kubernetes/pkg/kubectl/cmd uses github.com/docker/docker/pkg/term and that changed a lot between those versions.

Latest alpha release of Kubernetes (v1.4.0-alpha.2) is build with Docker version v1.11.2 so this might solve our problem (expecting that there is not much api changes between 1.11 and 1.12). But we have to wait till OpenShift Origin is rebased with Kubernetes v1.4.0-alpha.2 or more :-(

Until than we can't use k8s.io/kubernetes/pkg/kubectl/cmd and maybe some other packages from Kubernetes, but its hard to tell which :-(

@ngtuna
Copy link
Contributor Author

ngtuna commented Oct 5, 2016

This should be closed. As soon as we have k8s go client we should be good. Will reopen it whenever getting problem with godeps...

@ngtuna ngtuna closed this as completed Oct 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants