-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
39 lines (32 loc) · 831 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// package
package main
import (
"fmt"
"os"
"github.com/nirmata/kube-bench/pkg/kubebench"
"github.com/nirmata/kube-bench/pkg/params"
"github.com/nirmata/kube-bench/pkg/report"
)
func main() {
//parse arguments
params.ParseArguments()
//run kube-bench job
cis, err := kubebench.RunJob(¶ms.Params)
if err != nil {
fmt.Printf("failed to run job of kube-bench: %v \n", err)
os.Exit(-1)
}
// create policy report
r, err := report.New(cis, params.Params.Name, params.Params.KubebenchBenchmark)
if err != nil {
fmt.Printf("failed to create policy reports: %v \n", err)
os.Exit(-1)
}
// write policy report
r, err = report.Write(r, params.Params.Kubeconfig)
if err != nil {
fmt.Printf("failed to create policy reports: %v \n", err)
os.Exit(-1)
}
fmt.Printf("wrote policy report %s \n", r.Name)
}