Merge branch 'main' into dependabot/go_modules/github.com/aws/aws-sdk-go-v2-1.18.0

pull/1433/head
chenk 1 year ago committed by GitHub
commit f0febd5213
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -24,7 +24,7 @@ import (
"strings"
"github.com/golang/glog"
yaml "gopkg.in/yaml.v2"
"gopkg.in/yaml.v2"
"k8s.io/client-go/util/jsonpath"
)
@ -243,11 +243,11 @@ func (t testItem) evaluate(s string) *testOutput {
isExist = "does not exist"
}
switch t.auditUsed {
case "auditCommand":
case AuditCommand:
glog.V(3).Infof("Flag '%s' %s", t.Flag, isExist)
case "auditConfig":
case AuditConfig:
glog.V(3).Infof("Path '%s' %s", t.Path, isExist)
case "auditEnv":
case AuditEnv:
glog.V(3).Infof("Env '%s' %s", t.Env, isExist)
default:
glog.V(3).Infof("Error with identify audit used %s", t.auditUsed)

@ -127,7 +127,7 @@ func getConfigFilePath(benchmarkVersion string, filename string) (path string, e
glog.V(2).Info(fmt.Sprintf("Looking for config specific CIS version %q", benchmarkVersion))
path = filepath.Join(cfgDir, benchmarkVersion)
file := filepath.Join(path, string(filename))
file := filepath.Join(path, filename)
glog.V(2).Info(fmt.Sprintf("Looking for file: %s", file))
if _, err := os.Stat(file); err != nil {
@ -241,7 +241,7 @@ func findConfigFile(candidates []string) string {
if err == nil {
return c
}
if !os.IsNotExist(err) {
if !os.IsNotExist(err) && !strings.HasSuffix(err.Error(), "not a directory") {
exitWithError(fmt.Errorf("error looking for file %s: %v", c, err))
}
}

@ -15,6 +15,7 @@
package cmd
import (
"errors"
"io/ioutil"
"os"
"path/filepath"
@ -233,6 +234,7 @@ func TestFindConfigFile(t *testing.T) {
{input: []string{"myfile"}, statResults: []error{nil}, exp: "myfile"},
{input: []string{"thisfile", "thatfile"}, statResults: []error{os.ErrNotExist, nil}, exp: "thatfile"},
{input: []string{"thisfile", "thatfile"}, statResults: []error{os.ErrNotExist, os.ErrNotExist}, exp: ""},
{input: []string{"thisfile", "/etc/dummy/thatfile"}, statResults: []error{os.ErrNotExist, errors.New("stat /etc/dummy/thatfile: not a directory")}, exp: ""},
}
statFunc = fakestat

@ -12,7 +12,7 @@ spec:
hostPID: true
containers:
- name: kube-bench
image: docker.io/aquasec/kube-bench:v0.6.13
image: docker.io/aquasec/kube-bench:v0.6.14
command: ["kube-bench"]
volumeMounts:
- name: var-lib-etcd

Loading…
Cancel
Save