aboutsummaryrefslogtreecommitdiffstats
path: root/test/security/k8s/src/check/cmd
diff options
context:
space:
mode:
authorPawel Wieczorek <p.wieczorek2@samsung.com>2019-08-06 16:04:53 +0200
committerPawel Wieczorek <p.wieczorek2@samsung.com>2019-08-07 13:54:39 +0200
commit2b5b2e0ff77608cfdfc8a949076860672b38b93f (patch)
treeca634f3efdf603b772332fc71f23e492c2a04796 /test/security/k8s/src/check/cmd
parent57fae769fca12e55b0890316112fa3da19803cdc (diff)
k8s: Add support for RKE-deployed clusters
RKE is used as a Kubernetes cluster deployment method from ONAP Dublin release. RKE cluster definition is used to get access to necessary information. Issue-ID: SECCOM-235 Change-Id: I588598011ea746b5f7ba327a48f1cea605e56d31 Signed-off-by: Pawel Wieczorek <p.wieczorek2@samsung.com>
Diffstat (limited to 'test/security/k8s/src/check/cmd')
-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)
}