aboutsummaryrefslogtreecommitdiffstats
path: root/test/security/k8s/src/check/cmd/check/check.go
diff options
context:
space:
mode:
Diffstat (limited to 'test/security/k8s/src/check/cmd/check/check.go')
-rw-r--r--test/security/k8s/src/check/cmd/check/check.go25
1 files changed, 24 insertions, 1 deletions
diff --git a/test/security/k8s/src/check/cmd/check/check.go b/test/security/k8s/src/check/cmd/check/check.go
index c4dd39870..3c005f77c 100644
--- a/test/security/k8s/src/check/cmd/check/check.go
+++ b/test/security/k8s/src/check/cmd/check/check.go
@@ -5,12 +5,35 @@ import (
"log"
"check/rancher"
+ "check/raw"
"check/validators/master"
)
+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)")
+)
+
func main() {
flag.Parse()
- k8sParams, err := rancher.GetK8sParams()
+ if *ranchercli && *rke {
+ log.Fatal("Not supported.")
+ }
+
+ var (
+ k8sParams []string
+ err error
+ )
+
+ switch {
+ case *ranchercli:
+ k8sParams, err = rancher.GetK8sParams()
+ case *rke:
+ k8sParams, err = raw.GetK8sParams()
+ default:
+ log.Fatal("Missing cluster access method.")
+ }
+
if err != nil {
log.Fatal(err)
}