This repository was archived by the owner on Jul 30, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +23
-3
lines changed
Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -23,21 +23,32 @@ func newNode(n *v1.Node) *Node {
2323 return & Node {n }
2424}
2525
26- func (n * Node ) ExternalIP ( ) string {
26+ func (n * Node ) GetIPByType ( addrType v1. NodeAddressType ) string {
2727 var host string
2828 for _ , addr := range n .Status .Addresses {
29- if addr .Type == v1 . NodeExternalIP {
29+ if addr .Type == addrType {
3030 host = addr .Address
3131 break
3232 }
3333 }
3434 return host
3535}
3636
37+ func (n * Node ) ExternalIP () string {
38+ return n .GetIPByType (v1 .NodeExternalIP )
39+ }
40+
41+ func (n * Node ) InternalIP () string {
42+ return n .GetIPByType (v1 .NodeInternalIP )
43+ }
44+
3745func (n * Node ) SSH (cmd string ) (stdout , stderr []byte , err error ) {
3846 host := n .ExternalIP ()
3947 if host == "" {
40- return nil , nil , fmt .Errorf ("cannot find external IP for node %q" , n .Name )
48+ host = n .InternalIP ()
49+ if host == "" {
50+ return nil , nil , fmt .Errorf ("cannot find external or internal IP for node %q" , n .Name )
51+ }
4152 }
4253 return sshClient .SSH (host , cmd )
4354}
Original file line number Diff line number Diff line change @@ -10,6 +10,15 @@ This will generate the default assets in the `cluster` directory and launch mult
1010./bootkube-up
1111```
1212
13+ ## Running E2E tests
14+
15+ ```
16+ $ ssh-add ~/.vagrant.d/insecure_private_key
17+ $ export KUBECONFIG=$PWD/cluster/auth/kubeconfig
18+ $ cd ../.. # project root
19+ $ go test -v ./e2e/ --kubeconfig=$KUBECONFIG
20+ ```
21+
1322## Cleaning up
1423
1524To stop the running cluster and remove generated assets, run:
You can’t perform that action at this time.
0 commit comments