Skip to content

Commit

Permalink
fix: set result name and namespace to trivy vulnreport and configaudi… (
Browse files Browse the repository at this point in the history
#869)

* fix: set result name and namespace to trivy vulnreport and configauditreport

Signed-off-by: Johannes Kleinlercher <johannes.kleinlercher@suxess-it.com>

* fix: increase linter timeout

Signed-off-by: Johannes Kleinlercher <johannes@kleinlercher.at>

---------

Signed-off-by: Johannes Kleinlercher <johannes.kleinlercher@suxess-it.com>
Signed-off-by: Johannes Kleinlercher <johannes@kleinlercher.at>
Co-authored-by: Alex Jones <alexsimonjones@gmail.com>
  • Loading branch information
jkleinlercher and AlexsJones committed Feb 18, 2024
1 parent f2138c7 commit a3cd7e6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/golangci_lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-check
golangci_lint_flags: "--timeout=120s"
golangci_lint_flags: "--timeout=240s"
level: warning
11 changes: 6 additions & 5 deletions pkg/integration/trivy/analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ package trivy

import (
"fmt"
ctrl "sigs.k8s.io/controller-runtime/pkg/client"
"strings"

ctrl "sigs.k8s.io/controller-runtime/pkg/client"

"github.com/aquasecurity/trivy-operator/pkg/apis/aquasecurity/v1alpha1"
"github.com/k8sgpt-ai/k8sgpt/pkg/common"
"github.com/k8sgpt-ai/k8sgpt/pkg/util"
Expand Down Expand Up @@ -59,8 +60,8 @@ func (TrivyAnalyzer) analyzeVulnerabilityReports(a common.Analyzer) ([]common.Re
}
}
if len(failures) > 0 {
preAnalysis[fmt.Sprintf("%s/%s", report.Labels["trivy-operator.resource.namespace"],
report.Labels["trivy-operator.resource.name"])] = common.PreAnalysis{
preAnalysis[fmt.Sprintf("%s/%s", report.Namespace,
report.Name)] = common.PreAnalysis{
TrivyVulnerabilityReport: report,
FailureDetails: failures,
}
Expand Down Expand Up @@ -122,8 +123,8 @@ func (t TrivyAnalyzer) analyzeConfigAuditReports(a common.Analyzer) ([]common.Re
}

if len(failures) > 0 {
preAnalysis[fmt.Sprintf("%s/%s", report.Labels["trivy-operator.resource.namespace"],
report.Labels["trivy-operator.resource.name"])] = common.PreAnalysis{
preAnalysis[fmt.Sprintf("%s/%s", report.Namespace,
report.Name)] = common.PreAnalysis{
TrivyConfigAuditReport: report,
FailureDetails: failures,
}
Expand Down

0 comments on commit a3cd7e6

Please sign in to comment.