mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-31 03:45:17 +00:00
fix cli panic for --cluster flag (#3436)
This commit is contained in:
parent
0360ad25c1
commit
9ed1872864
1 changed files with 18 additions and 17 deletions
|
@ -735,8 +735,8 @@ func GetResourceAccordingToResourcePath(fs billy.Filesystem, resourcePaths []str
|
|||
return nil, sanitizederror.NewWithError("failed to extract the resources", err)
|
||||
}
|
||||
}
|
||||
} else if (len(resourcePaths) > 0 && resourcePaths[0] != "-") || len(resourcePaths) < 0 || cluster {
|
||||
|
||||
} else {
|
||||
if len(resourcePaths) > 0 {
|
||||
fileDesc, err := os.Stat(resourcePaths[0])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@ -756,12 +756,13 @@ func GetResourceAccordingToResourcePath(fs billy.Filesystem, resourcePaths []str
|
|||
}
|
||||
resourcePaths = listOfFiles
|
||||
}
|
||||
}
|
||||
|
||||
resources, err = GetResources(policies, resourcePaths, dClient, cluster, namespace, policyReport)
|
||||
if err != nil {
|
||||
return resources, err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return resources, err
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue