MCPcopy Index your code
hub / github.com/crossplane-contrib/function-patch-and-transform / ValidatePatchSet

Function ValidatePatchSet

validate.go:79–89  ·  view source on GitHub ↗

ValidatePatchSet validates a PatchSet.

(ps v1beta1.PatchSet)

Source from the content-addressed store, hash-verified

77
78// ValidatePatchSet validates a PatchSet.
79func ValidatePatchSet(ps v1beta1.PatchSet) *field.Error {
80 if ps.Name == "" {
81 return field.Required(field.NewPath("name"), "name is required")
82 }
83 for i, p := range ps.Patches {
84 if err := ValidatePatch(&p); err != nil {
85 return WrapFieldError(err, field.NewPath("patches").Index(i))
86 }
87 }
88 return nil
89}
90
91// ValidateEnvironment validates (patches to and from) the Environment.
92func ValidateEnvironment(e *v1beta1.Environment) *field.Error {

Callers 1

ValidateResourcesFunction · 0.85

Calls 2

ValidatePatchFunction · 0.85
WrapFieldErrorFunction · 0.85

Tested by

no test coverage detected