Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion integration/k8s_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ func TestK8s(t *testing.T) {
"summary",
"--checks-bundle-repository",
"mirror.gcr.io/aquasec/trivy-checks:1.11.2@sha256:f3ea8227f838a985f0c884909e9d226362f5fc5ab6021310a179fbb24c5b57fd",
"-q",
"--include-namespaces", "default",
"--debug",
"--timeout",
"5m0s",
"--format",
Expand Down
261 changes: 1 addition & 260 deletions integration/testdata/fixtures/k8s/summary-ids.json.golden
Original file line number Diff line number Diff line change
@@ -1,290 +1,31 @@
{
"vulnerabilities": [
"CVE-2019-1551",
"CVE-2019-1551",
"CVE-2019-1563",
"CVE-2019-1563",
"CVE-2019-18276",
"CVE-2019-18276",
"CVE-2019-5094",
"CVE-2019-5094",
"CVE-2019-5094",
"CVE-2019-5094",
"CVE-2019-5094",
"CVE-2019-5094",
"CVE-2019-5094",
"CVE-2019-5094"
],
"misconfigurations": [
"AVD-KSV-01010",
"KCV0001",
"KCV0006",
"KCV0010",
"KCV0018",
"KCV0019",
"KCV0020",
"KCV0021",
"KCV0022",
"KCV0030",
"KCV0033",
"KCV0038",
"KCV0059",
"KCV0069",
"KCV0075",
"KCV0077",
"KSV001",
"KSV001",
"KSV001",
"KSV001",
"KSV001",
"KSV001",
"KSV001",
"KSV001",
"KSV001",
"KSV0012",
"KSV003",
"KSV003",
"KSV003",
"KSV003",
"KSV003",
"KSV003",
"KSV003",
"KSV003",
"KSV003",
"KSV004",
"KSV004",
"KSV004",
"KSV004",
"KSV004",
"KSV004",
"KSV004",
"KSV004",
"KSV004",
"KSV009",
"KSV009",
"KSV009",
"KSV009",
"KSV009",
"KSV009",
"KSV011",
"KSV011",
"KSV011",
"KSV011",
"KSV011",
"KSV011",
"KSV011",
"KSV011",
"KSV011",
"KSV012",
"KSV012",
"KSV012",
"KSV012",
"KSV012",
"KSV012",
"KSV012",
"KSV012",
"KSV012",
"KSV012",
"KSV0125",
"KSV0125",
"KSV0125",
"KSV0125",
"KSV0125",
"KSV0125",
"KSV0125",
"KSV0125",
"KSV014",
"KSV014",
"KSV014",
"KSV014",
"KSV014",
"KSV014",
"KSV014",
"KSV014",
"KSV014",
"KSV015",
"KSV015",
"KSV015",
"KSV015",
"KSV016",
"KSV016",
"KSV016",
"KSV016",
"KSV016",
"KSV016",
"KSV016",
"KSV017",
"KSV018",
"KSV018",
"KSV018",
"KSV018",
"KSV018",
"KSV018",
"KSV018",
"KSV018",
"KSV020",
"KSV020",
"KSV020",
"KSV020",
"KSV020",
"KSV020",
"KSV020",
"KSV020",
"KSV020",
"KSV020",
"KSV021",
"KSV021",
"KSV021",
"KSV021",
"KSV021",
"KSV021",
"KSV021",
"KSV021",
"KSV021",
"KSV021",
"KSV022",
"KSV022",
"KSV023",
"KSV023",
"KSV023",
"KSV023",
"KSV023",
"KSV023",
"KSV030",
"KSV030",
"KSV030",
"KSV030",
"KSV030",
"KSV030",
"KSV036",
"KSV041",
"KSV041",
"KSV041",
"KSV041",
"KSV041",
"KSV041",
"KSV041",
"KSV041",
"KSV041",
"KSV041",
"KSV041",
"KSV041",
"KSV041",
"KSV044",
"KSV045",
"KSV046",
"KSV046",
"KSV046",
"KSV046",
"KSV046",
"KSV046",
"KSV046",
"KSV048",
"KSV048",
"KSV048",
"KSV048",
"KSV048",
"KSV048",
"KSV048",
"KSV048",
"KSV048",
"KSV048",
"KSV048",
"KSV048",
"KSV048",
"KSV048",
"KSV048",
"KSV048",
"KSV048",
"KSV048",
"KSV048",
"KSV048",
"KSV048",
"KSV048",
"KSV048",
"KSV048",
"KSV048",
"KSV048",
"KSV048",
"KSV048",
"KSV048",
"KSV048",
"KSV048",
"KSV048",
"KSV048",
"KSV048",
"KSV048",
"KSV048",
"KSV049",
"KSV049",
"KSV049",
"KSV049",
"KSV049",
"KSV049",
"KSV049",
"KSV049",
"KSV050",
"KSV050",
"KSV053",
"KSV053",
"KSV053",
"KSV056",
"KSV056",
"KSV056",
"KSV056",
"KSV056",
"KSV056",
"KSV056",
"KSV056",
"KSV056",
"KSV056",
"KSV056",
"KSV056",
"KSV056",
"KSV056",
"KSV056",
"KSV056",
"KSV056",
"KSV056",
"KSV056",
"KSV104",
"KSV104",
"KSV104",
"KSV104",
"KSV104",
"KSV104",
"KSV106",
"KSV106",
"KSV106",
"KSV106",
"KSV106",
"KSV106",
"KSV106",
"KSV106",
"KSV106",
"KSV110",
"KSV111",
"KSV112",
"KSV112",
"KSV113",
"KSV113",
"KSV117",
"KSV117",
"KSV117",
"KSV118",
"KSV118",
"KSV118",
"KSV118",
"KSV118",
"KSV118",
"KSV118",
"KSV118",
"KSV118",
"KSV119",
"KSV122",
"no-user-pods-in-system-namespace",
"no-user-pods-in-system-namespace",
"no-user-pods-in-system-namespace",
"no-user-pods-in-system-namespace"
"KSV118"
]
}
12 changes: 11 additions & 1 deletion magefiles/magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,20 @@ func (t Test) K8s() error {
return fmt.Errorf("can't create environment for limited user: %w", err)
}

// wait for all pods are running correctly
err = sh.RunWithV(ENV, "kubectl", "wait", "--for=condition=Ready", "pod", "--all", "--all-namespaces", "--timeout=300s")
if err != nil {
return fmt.Errorf("can't wait for the pods: %w", err)
}

// print all resources for info
err = sh.RunWithV(ENV, "kubectl", "get", "all", "-A")
if err != nil {
return err
return fmt.Errorf("can't get workloads: %w", err)
}
err = sh.RunWithV(ENV, "kubectl", "get", "cm", "-A")
if err != nil {
return fmt.Errorf("can't get configmaps: %w", err)
}

return sh.RunWithV(ENV, "go", "test", "-v", "-tags=k8s_integration", "./integration/...")
Expand Down