1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-31 03:45:17 +00:00

refactor: remove json patches from mutation tests (#7447)

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
This commit is contained in:
Charles-Edouard Brétéché 2023-06-07 07:35:58 +02:00 committed by GitHub
parent 945cb1a809
commit b6795239ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 909 additions and 770 deletions

View file

@ -78,7 +78,20 @@ func (c *fakeDiscoveryClient) GetGVRFromGVK(gvk schema.GroupVersionKind) (schema
}
func (c *fakeDiscoveryClient) FindResources(group, version, kind, subresource string) (map[TopLevelApiDescription]metav1.APIResource, error) {
return nil, fmt.Errorf("not implemented")
r := strings.ToLower(kind) + "s"
for _, resource := range c.registeredResources {
if resource.Resource == r {
return map[TopLevelApiDescription]metav1.APIResource{
{
GroupVersion: schema.GroupVersion{Group: resource.Group, Version: resource.Version},
Kind: kind,
Resource: r,
SubResource: subresource,
}: {},
}, nil
}
}
return nil, fmt.Errorf("not found")
}
func (c *fakeDiscoveryClient) OpenAPISchema() (*openapiv2.Document, error) {

File diff suppressed because it is too large Load diff