1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-15 17:51:20 +00:00

check errors (#6424)

Signed-off-by: ShutingZhao <shuting@nirmata.com>
This commit is contained in:
shuting 2023-02-28 22:58:28 +08:00 committed by GitHub
parent 8e123bc2ce
commit efae284745
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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
}
}