mmumshad / kubernetes-the-hard-way

Bootstrap Kubernetes the hard way on Vagrant on Local Machine. No scripts.
Apache License 2.0
4.7k stars 4.54k forks source link

Error install kubetest in 16-e2e-tests.md #115

Closed vscoder closed 2 years ago

vscoder commented 4 years ago

Hello.

Thank you for your project, it is very interesting and useful. But when I followed the instructions, I came across a little problem.

When I ran installation of kubetest, how described in 16-e2e-tests.md, I got an error:

vagrant@master-1:~$ go get -v -u k8s.io/test-infra/kubetest
...
k8s.io/apimachinery/pkg/util/errors
# github.com/hashicorp/go-multierror
go/src/github.com/hashicorp/go-multierror/multierror.go:112:9: undefined: errors.As
go/src/github.com/hashicorp/go-multierror/multierror.go:117:9: undefined: errors.Is
# k8s.io/apimachinery/pkg/util/errors
go/src/k8s.io/apimachinery/pkg/util/errors/errors.go:99:10: undefined: errors.Is
k8s.io/client-go/transport
# k8s.io/client-go/transport
go/src/k8s.io/client-go/transport/round_trippers.go:70:11: cannot convert klog.V(9) (type klog.Verbose) to type bool
go/src/k8s.io/client-go/transport/round_trippers.go:72:11: cannot convert klog.V(8) (type klog.Verbose) to type bool
go/src/k8s.io/client-go/transport/round_trippers.go:74:11: cannot convert klog.V(7) (type klog.Verbose) to type bool
go/src/k8s.io/client-go/transport/round_trippers.go:76:11: cannot convert klog.V(6) (type klog.Verbose) to type bool
vagrant@master-1:~$

and kubetest was not installed, contrary to expectations.

vagrant@master-1:~$ kubetest --extract=v1.13.0
kubetest: command not found

Thank you for your attention.

dkhopade commented 4 years ago

I am getting the same errors. Any idea?

wilkej commented 4 years ago

I have the same issue. Don't know further :(

rainmanh commented 4 years ago

Same issue in here!

blasterspike commented 4 years ago

This is because errors.As and errors.Is were introduced in Go 1.13 https://github.com/golang/go/blob/master/api/go1.13.txt#L46-L47 I recommend to download and install Go 1.13.11

wget https://dl.google.com/go/go1.13.11.linux-amd64.tar.gz

sudo tar -C /usr/local -xzf go1.13.11.linux-amd64.tar.gz

and then follow the official instructions from kubetest to install it https://github.com/kubernetes/test-infra/tree/master/kubetest i.e. clone that repository and run GO111MODULE=on go install ./kubetest otherwise you will find other compatibility issues.

Unfortuantely, even after these, I wasn't able to run kubetest --extract=v1.13.0 as I'm now getting the following error

kubetest --extract=v1.13.0
2020/05/19 14:50:11 Warning: Couldn't find directory src/k8s.io/kubernetes under any of GOPATH /home/vagrant/go, defaulting to /home/vagrant/go/src/k8s.io/kubernetes
2020/05/19 14:50:11 Warning: Couldn't find directory src/sigs.k8s.io/cloud-provider-azure under any of GOPATH /home/vagrant/go, defaulting to /home/vagrant/go/src/k8s.io/cloud-provider-azure
2020/05/19 14:50:11 Warning: Couldn't find directory src/k8s.io/kubernetes under any of GOPATH /home/vagrant/go, defaulting to /home/vagrant/go/src/k8s.io/kubernetes
2020/05/19 14:50:11 util.go:68: curl https://get.k8s.io
2020/05/19 14:50:12 extract_k8s.go:288: U=https://storage.googleapis.com/kubernetes-release/release R=v1.13.0 get-kube.sh
2020/05/19 14:50:12 process.go:153: Running: /tmp/get-kube106596808
Downloading kubernetes release v1.13.0
  from https://storage.googleapis.com/kubernetes-release/release/v1.13.0/kubernetes.tar.gz
  to /home/vagrant/kubernetes.tar.gz
WARNING: Could not open the configuration file: [/home/vagrant/.config/gcloud/configurations/config_default].
ERROR: (gcloud.auth.print-access-token) You do not currently have an active account selected.
Please run:

  $ gcloud auth login
[...]

Definitely this 16-e2e-tests.md needs to be reviewed.

fireflycons commented 2 years ago

Hi @vscoder @blasterspike @dkhopade @rainmanh @wilkej

Please see close notes on #123

Thanks