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:
parent
945cb1a809
commit
b6795239ba
2 changed files with 909 additions and 770 deletions
|
@ -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
Loading…
Add table
Reference in a new issue