From 677a9da80a445b87a9ad01271cf50717bf932af2 Mon Sep 17 00:00:00 2001 From: Moshe-Rappaport-CA Date: Sun, 28 Aug 2022 12:02:21 +0300 Subject: [PATCH] Fix issues according to review --- core/pkg/resourcehandler/filesloader.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/pkg/resourcehandler/filesloader.go b/core/pkg/resourcehandler/filesloader.go index 38c46b33..173e5497 100644 --- a/core/pkg/resourcehandler/filesloader.go +++ b/core/pkg/resourcehandler/filesloader.go @@ -47,12 +47,12 @@ func (fileHandler *FileResourceHandler) GetResources(sessionObj *cautils.OPASess cautils.StartSpinner() for path := range fileHandler.inputPatterns { - workloadIDToSource, workloads, err := GetResourcesFromPath(fileHandler.inputPatterns[path]) + workloadIDToSource, workloads, err := getResourcesFromPath(fileHandler.inputPatterns[path]) if err != nil { return nil, allResources, nil, err } if len(workloads) == 0 { - return nil, allResources, nil, fmt.Errorf("empty list of workloads - no workloads found") + logger.L().Debug("path ignored because contains only a non-kubernetes file", helpers.String("path", fileHandler.inputPatterns[path])) } for k, v := range workloadIDToSource { @@ -86,7 +86,7 @@ func (fileHandler *FileResourceHandler) GetResources(sessionObj *cautils.OPASess return k8sResources, allResources, ksResources, nil } -func GetResourcesFromPath(path string) (map[string]reporthandling.Source, []workloadinterface.IMetadata, error) { +func getResourcesFromPath(path string) (map[string]reporthandling.Source, []workloadinterface.IMetadata, error) { workloadIDToSource := make(map[string]reporthandling.Source, 0) workloads := []workloadinterface.IMetadata{}