(obj interface{}, gvk schema.GroupVersionKind)
| 80 | } |
| 81 | |
| 82 | func (v *schemaValidation) validateResource(obj interface{}, gvk schema.GroupVersionKind) []error { |
| 83 | // This lazy-loads the OpenAPI V2 specifications, caching the specs. |
| 84 | resources, err := v.resourcesGetter.OpenAPISchema() |
| 85 | if err != nil { |
| 86 | return []error{err} |
| 87 | } |
| 88 | resource := resources.LookupResource(gvk) |
| 89 | if resource == nil { |
| 90 | // resource is not present, let's just skip validation. |
| 91 | return nil |
| 92 | } |
| 93 | |
| 94 | return validation.ValidateModel(obj, resource, gvk.Kind) |
| 95 | } |
| 96 | |
| 97 | func parse(data []byte) (interface{}, error) { |
| 98 | var obj interface{} |
no test coverage detected