mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-15 17:51:20 +00:00
parent
8e123bc2ce
commit
efae284745
1 changed files with 5 additions and 1 deletions
|
@ -124,7 +124,11 @@ func getSubresourceGVKToKindMap(policy kyvernov1.PolicyInterface, client dclient
|
|||
gv, k := kubeutils.GetKindFromGVK(gvk)
|
||||
_, subresource := kubeutils.SplitSubresource(k)
|
||||
if subresource != "" {
|
||||
apiResource, _, _, _ := client.Discovery().FindResource(gv, k)
|
||||
apiResource, _, _, err := client.Discovery().FindResource(gv, k)
|
||||
if err != nil {
|
||||
logger.Error(err, "failed to fetch resource group versions", "gv", gv, "kind", k)
|
||||
continue
|
||||
}
|
||||
subresourceGVKToKind[gvk] = apiResource.Kind
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue