Skip to content

Commit b00892d

Browse files
authored
Merge pull request #32 from PDOK/wr/error-format
small improvement
2 parents f195e0c + d0e694b commit b00892d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pkg/validation/ingress_route_urls.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ func ValidateIngressRouteURLsContainsBaseURL(urls model.IngressRouteURLs, baseUR
2222
}
2323
}
2424

25-
return field.Invalid(path, urls, fmt.Sprintf("must contain baseURL: %s", baseURL))
25+
return field.Invalid(path, fmt.Sprint(urls), fmt.Sprintf("must contain baseURL: %s", baseURL))
2626
}
2727

2828
func ValidateIngressRouteURLsNotRemoved(oldURLs, newURLs model.IngressRouteURLs, allErrs *field.ErrorList, path *field.Path) {
@@ -42,7 +42,7 @@ func ValidateIngressRouteURLsNotRemoved(oldURLs, newURLs model.IngressRouteURLs,
4242
}
4343

4444
if !found {
45-
*allErrs = append(*allErrs, field.Invalid(path, newURLs, fmt.Sprintf("urls cannot be removed: %s", url)))
45+
*allErrs = append(*allErrs, field.Invalid(path, fmt.Sprint(newURLs), fmt.Sprintf("urls cannot be removed, missing: %s", url)))
4646
}
4747
}
4848
}

pkg/validation/labels.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func ValidateLabelsOnUpdate(oldLabels, newLabels map[string]string, allErrs *fie
2323
if !ok {
2424
*allErrs = append(*allErrs, field.Required(fieldPath.Child(oldKey), "labels cannot be removed"))
2525
} else if oldValue != newValue {
26-
*allErrs = append(*allErrs, field.Invalid(fieldPath.Child(oldKey), newValue, "immutable: should be "+oldValue))
26+
*allErrs = append(*allErrs, field.Invalid(fieldPath.Child(oldKey), newValue, "immutable: should be: "+oldValue))
2727
}
2828
}
2929

0 commit comments

Comments
 (0)