aboutsummaryrefslogtreecommitdiffstats
path: root/test/security/k8s/src/check/cmd/check/check.go
diff options
context:
space:
mode:
authorPawel Wieczorek <p.wieczorek2@samsung.com>2019-09-26 16:43:01 +0200
committerPawel Wieczorek <p.wieczorek2@samsung.com>2019-09-27 17:38:49 +0200
commit76dd9bfcc14f2a77dd9a8155e66434a304cd0c38 (patch)
tree19f1f23dee938ccf423c7bbd399a586d0cfe9079 /test/security/k8s/src/check/cmd/check/check.go
parent664ce36e4606ba855bb997059f43d89bb51385e5 (diff)
k8s: Extract common interface to simplify development
Common command and service name extraction is intended to limit execution to small set of allowed processes. This patch also drops unnecessary use of "Kubernetes" name because this whole subproject concerns its clusters. Issue-ID: SECCOM-235 Change-Id: I8babfeb4f24cf3baa4d236ca622c21170ab6205e Signed-off-by: Pawel Wieczorek <p.wieczorek2@samsung.com>
Diffstat (limited to 'test/security/k8s/src/check/cmd/check/check.go')
-rw-r--r--test/security/k8s/src/check/cmd/check/check.go14
1 files changed, 6 insertions, 8 deletions
diff --git a/test/security/k8s/src/check/cmd/check/check.go b/test/security/k8s/src/check/cmd/check/check.go
index 80a17f0c5..40e3a092c 100644
--- a/test/security/k8s/src/check/cmd/check/check.go
+++ b/test/security/k8s/src/check/cmd/check/check.go
@@ -4,6 +4,7 @@ import (
"flag"
"log"
+ "check"
"check/rancher"
"check/raw"
"check/validators/master"
@@ -25,23 +26,20 @@ func main() {
*rke = true
}
- var (
- k8sParams []string
- err error
- )
+ var info check.Informer
switch {
case *ranchercli:
- k8sParams, err = rancher.GetK8sParams()
+ info = &rancher.Rancher{}
case *rke:
- k8sParams, err = raw.GetK8sParams()
+ info = &raw.Raw{}
default:
log.Fatal("Missing cluster access method.")
}
+ apiParams, err := info.GetAPIParams()
if err != nil {
log.Fatal(err)
}
-
- master.Check(k8sParams)
+ master.CheckAPI(apiParams)
}