diff --git a/pkg/k8s/scanner/scanner.go b/pkg/k8s/scanner/scanner.go index 955916f09c50..f260e8b088e5 100644 --- a/pkg/k8s/scanner/scanner.go +++ b/pkg/k8s/scanner/scanner.go @@ -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) @@ -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 }