mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 07:27:21 +00:00
Move fielderrors into validation
This commit is contained in:
@@ -21,7 +21,7 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api/errors"
|
||||
"k8s.io/kubernetes/pkg/api/validation"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
"k8s.io/kubernetes/pkg/util/fielderrors"
|
||||
utilvalidation "k8s.io/kubernetes/pkg/util/validation"
|
||||
)
|
||||
|
||||
// RESTUpdateStrategy defines the minimum validation, accepted input, and
|
||||
@@ -42,7 +42,7 @@ type RESTUpdateStrategy interface {
|
||||
// ValidateUpdate is invoked after default fields in the object have been
|
||||
// filled in before the object is persisted. This method should not mutate
|
||||
// the object.
|
||||
ValidateUpdate(ctx api.Context, obj, old runtime.Object) fielderrors.ValidationErrorList
|
||||
ValidateUpdate(ctx api.Context, obj, old runtime.Object) utilvalidation.ValidationErrorList
|
||||
// Canonicalize is invoked after validation has succeeded but before the
|
||||
// object has been persisted. This method may mutate the object.
|
||||
Canonicalize(obj runtime.Object)
|
||||
@@ -53,8 +53,8 @@ type RESTUpdateStrategy interface {
|
||||
}
|
||||
|
||||
// TODO: add other common fields that require global validation.
|
||||
func validateCommonFields(obj, old runtime.Object) fielderrors.ValidationErrorList {
|
||||
allErrs := fielderrors.ValidationErrorList{}
|
||||
func validateCommonFields(obj, old runtime.Object) utilvalidation.ValidationErrorList {
|
||||
allErrs := utilvalidation.ValidationErrorList{}
|
||||
objectMeta, err := api.ObjectMetaFor(obj)
|
||||
if err != nil {
|
||||
return append(allErrs, errors.NewInternalError(err))
|
||||
|
||||
Reference in New Issue
Block a user