1
0
mirror of https://github.com/aquasecurity/kube-bench.git synced 2024-11-26 01:49:28 +00:00

Replace fmt.Sprintf by filepath.Join

This commit is contained in:
Philippe ALEXANDRE 2018-03-23 09:27:48 +01:00
parent c808d9527d
commit c86d0ff81b

View File

@ -17,6 +17,7 @@ package cmd
import (
"fmt"
"io/ioutil"
"path/filepath"
"github.com/aquasecurity/kube-bench/check"
"github.com/golang/glog"
@ -47,9 +48,12 @@ func runChecks(t check.NodeType) {
}
ver := getKubeVersion()
path := fmt.Sprintf("%s/%s", cfgDir, ver)
// path := fmt.Sprintf("%s/%s", cfgDir, ver)
path := filepath.Join(cfgDir, ver)
// def := fmt.Sprintf("%s/%s", path, file)
def := filepath.Join(path, file)
def := fmt.Sprintf("%s/%s", path, file)
in, err := ioutil.ReadFile(def)
if err != nil {
exitWithError(fmt.Errorf("error opening %s controls file: %v", t, err))