From 664ce36e4606ba855bb997059f43d89bb51385e5 Mon Sep 17 00:00:00 2001
From: Pawel Wieczorek
Date: Thu, 26 Sep 2019 14:50:16 +0200
Subject: k8s: Change default cluster access method choice logic
Previous way of choosing it led to impractical calls, e.g.
$ ./check -rke # (works fine)
$ ./check -ranchercli # "Not supported."
$ ./check -ranchercli -rke=false # (works fine)
Disabling default cluster access method is no longer necessary.
Issue-ID: SECCOM-235
Change-Id: I2b4d5bff10c5470e567351abeac0431bed3b7938
Signed-off-by: Pawel Wieczorek
---
test/security/k8s/src/check/cmd/check/check.go | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/test/security/k8s/src/check/cmd/check/check.go b/test/security/k8s/src/check/cmd/check/check.go
index 5a29fa9d5..80a17f0c5 100644
--- a/test/security/k8s/src/check/cmd/check/check.go
+++ b/test/security/k8s/src/check/cmd/check/check.go
@@ -11,7 +11,7 @@ import (
var (
ranchercli = flag.Bool("ranchercli", false, "use rancher utility for accessing cluster nodes")
- rke = flag.Bool("rke", true, "use RKE cluster definition and ssh for accessing cluster nodes (default)")
+ rke = flag.Bool("rke", false, "use RKE cluster definition and ssh for accessing cluster nodes (default)")
)
func main() {
@@ -20,6 +20,11 @@ func main() {
log.Fatal("Not supported.")
}
+ // Use default cluster access method if none was declared explicitly.
+ if !(*ranchercli || *rke) {
+ *rke = true
+ }
+
var (
k8sParams []string
err error
--
cgit 1.2.3-korg