ValidatePatchSet validates a PatchSet.
(ps v1beta1.PatchSet)
| 77 | |
| 78 | // ValidatePatchSet validates a PatchSet. |
| 79 | func 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. |
| 92 | func ValidateEnvironment(e *v1beta1.Environment) *field.Error { |
no test coverage detected