refactor: Change the users of IsQualifiedName to ValidateQualifiedName

This commit is contained in:
mango
2022-02-16 14:02:11 +08:00
parent a37b6fc8b4
commit f97cdeb419
3 changed files with 9 additions and 27 deletions

View File

@@ -146,9 +146,7 @@ func legacyValidateEvent(event *core.Event) field.ErrorList {
if len(event.ReportingController) == 0 {
allErrs = append(allErrs, field.Required(field.NewPath("reportingController"), ""))
}
for _, msg := range validation.IsQualifiedName(event.ReportingController) {
allErrs = append(allErrs, field.Invalid(field.NewPath("reportingController"), event.ReportingController, msg))
}
allErrs = append(allErrs, ValidateQualifiedName(event.ReportingController, field.NewPath("reportingController"))...)
if len(event.ReportingInstance) == 0 {
allErrs = append(allErrs, field.Required(field.NewPath("reportingInstance"), ""))
}