validateObject validates an arbitrary metav1.Object's metadata.
(obj metav1.Object)
| 103 | |
| 104 | // validateObject validates an arbitrary metav1.Object's metadata. |
| 105 | func validateObject(obj metav1.Object) error { |
| 106 | f := func(string, bool) []string { return nil } |
| 107 | errs := k8svalidation.ValidateObjectMetaAccessor(obj, false, f, field.NewPath("metadata")) |
| 108 | if len(errs) > 0 { |
| 109 | return fmt.Errorf("error validating object: %s. %v", errs.ToAggregate(), obj) |
| 110 | } |
| 111 | return nil |
| 112 | } |
| 113 | |
| 114 | // appendResult attempts to find a result in results that matches r.Name, and |
| 115 | // if found appends errors and warnings to that result. Otherwise r is added |
no outgoing calls
no test coverage detected