Skip to content

Commit

Permalink
feat: scan vulns on k8s core component apps
Browse files Browse the repository at this point in the history
Signed-off-by: chenk <[email protected]>
  • Loading branch information
chen-keinan committed Oct 23, 2023
1 parent ce4fada commit bfa4876
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/k8s/scanner/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ func (s *Scanner) Scan(ctx context.Context, artifactsData []*artifacts.Artifact)
}, nil
}
var resourceArtifacts []*artifacts.Artifact
var k8sArtifacts []*artifacts.Artifact
var k8sCoreArtifacts []*artifacts.Artifact
for _, artifact := range artifactsData {
if strings.HasSuffix(artifact.Kind, "Components") || strings.HasSuffix(artifact.Kind, "Cluster") {
k8sArtifacts = append(k8sArtifacts, artifact)
k8sCoreArtifacts = append(k8sCoreArtifacts, artifact)
continue
}
resourceArtifacts = append(resourceArtifacts, artifact)
Expand Down Expand Up @@ -145,7 +145,7 @@ func (s *Scanner) Scan(ctx context.Context, artifactsData []*artifacts.Artifact)
return report.Report{}, err
}
if s.opts.Scanners.AnyEnabled(types.VulnerabilityScanner) {
k8sResource, err := s.scanK8sVulns(ctx, k8sArtifacts)
k8sResource, err := s.scanK8sVulns(ctx, k8sCoreArtifacts)
if err != nil {
return report.Report{}, err
}
Expand Down

0 comments on commit bfa4876

Please sign in to comment.