mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-31 03:45:17 +00:00
fix error "failed to list resources"
This commit is contained in:
parent
5128a00e91
commit
b9d38d2fd3
1 changed files with 6 additions and 1 deletions
|
@ -97,9 +97,14 @@ func getResourcesPerNamespace(kind string, client *client.Client, namespace stri
|
|||
// ls := mergeLabelSectors(rule.MatchResources.Selector, rule.ExcludeResources.Selector)
|
||||
// list resources
|
||||
log.V(4).Info("list resources to be processed")
|
||||
|
||||
if kind == "Namespace" {
|
||||
namespace = ""
|
||||
}
|
||||
|
||||
list, err := client.ListResource(kind, namespace, ls)
|
||||
if err != nil {
|
||||
log.Error(err, "failed to list resources", "kind", kind)
|
||||
log.Error(err, "failed to list resources", "kind", kind, "namespace", namespace)
|
||||
return nil
|
||||
}
|
||||
// filter based on name
|
||||
|
|
Loading…
Add table
Reference in a new issue