This is a creation in Article, where the information may have evolved or changed.
When the code is compiled k8s
, k8s
a folder is generated in the root directory _output
, and folders are also included under this folder local
:
~/kubernetes/_output/local$ lsbin go
go
The folder is a standard Go
language workspace
:
:~/kubernetes/_output/local/go$ ls -alttotal 20drwxrwxr-x 4 nan nan 4096 Dec 9 22:09 ..drwxrwxr-x 2 nan nan 4096 Dec 9 22:09 bindrwxrwxr-x 4 nan nan 4096 Dec 9 22:08 pkgdrwxrwxr-x 5 nan nan 4096 Dec 9 22:07 .drwxrwxr-x 3 nan nan 4096 Dec 9 22:04 src
Go to src
folder:
~/kubernetes/_output/local/go/src$ ls -alttotal 12drwxrwxr-x 5 nan nan 4096 Dec 9 22:07 ..drwxrwxr-x 2 nan nan 4096 Dec 9 22:06 k8s.iodrwxrwxr-x 3 nan nan 4096 Dec 9 22:04 .nan@ubuntu:~/kubernetes/_output/local/go/src$ cd k8s.io/nan@ubuntu:~/kubernetes/_output/local/go/src/k8s.io$ ls -alttotal 8drwxrwxr-x 2 nan nan 4096 Dec 9 22:06 .lrwxrwxrwx 1 nan nan 20 Dec 9 22:06 kubernetes -> /home/nan/kubernetesdrwxrwxr-x 3 nan nan 4096 Dec 9 22:04 ..
As you can see, there src/k8s.io/kubernetes
is a soft link to the outer working directory.
At this point, you can understand import
why the following statement in the code works:
import ( "k8s.io/kubernetes/contrib/mesos/pkg/controllermanager" "k8s.io/kubernetes/contrib/mesos/pkg/hyperkube")