MCPcopy
hub / github.com/operator-framework/operator-sdk / validateObject

Function validateObject

internal/registry/validate.go:105–112  ·  view source on GitHub ↗

validateObject validates an arbitrary metav1.Object's metadata.

(obj metav1.Object)

Source from the content-addressed store, hash-verified

103
104// validateObject validates an arbitrary metav1.Object's metadata.
105func 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

Callers 1

ValidateBundleContentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected