From 6d516fde7440c644cbbab5a7d5bced3893ef6d64 Mon Sep 17 00:00:00 2001 From: aimuz Date: Fri, 7 Jul 2023 18:26:59 +0800 Subject: [PATCH] fix: Add "metav1.CauseType" to "field.ErrorType" map Signed-off-by: aimuz Kubernetes-commit: bc059817dc5b1ccb672ca930687a262219e7e858 --- pkg/apis/meta/v1/types.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/pkg/apis/meta/v1/types.go b/pkg/apis/meta/v1/types.go index dea82839c..8a8ff7018 100644 --- a/pkg/apis/meta/v1/types.go +++ b/pkg/apis/meta/v1/types.go @@ -995,6 +995,24 @@ const ( // CauseTypeFieldValueNotSupported is used to report valid (as per formatting rules) // values that can not be handled (e.g. an enumerated string). CauseTypeFieldValueNotSupported CauseType = "FieldValueNotSupported" + // CauseTypeForbidden is used to report valid (as per formatting rules) + // values which would be accepted under some conditions, but which are not + // permitted by the current conditions (such as security policy). See + // Forbidden(). + CauseTypeForbidden CauseType = "FieldValueForbidden" + // CauseTypeTooLong is used to report that the given value is too long. + // This is similar to ErrorTypeInvalid, but the error will not include the + // too-long value. See TooLong(). + CauseTypeTooLong CauseType = "FieldValueTooLong" + // CauseTypeTooMany is used to report "too many". This is used to + // report that a given list has too many items. This is similar to FieldValueTooLong, + // but the error indicates quantity instead of length. + CauseTypeTooMany CauseType = "FieldValueTooMany" + // CauseTypeInternal is used to report other errors that are not related + // to user input. See InternalError(). + CauseTypeInternal CauseType = "InternalError" + // CauseTypeTypeInvalid is for the value did not match the schema type for that field + CauseTypeTypeInvalid CauseType = "FieldValueTypeInvalid" // CauseTypeUnexpectedServerResponse is used to report when the server responded to the client // without the expected return type. The presence of this cause indicates the error may be // due to an intervening proxy or the server software malfunctioning.