Package io.fabric8.generator.annotation
Annotation Type ValidationRule
-
@Repeatable(ValidationRules.class) @Target({ANNOTATION_TYPE,FIELD,METHOD,TYPE}) @Retention(RUNTIME) public @interface ValidationRule
A Kubernetes validation rule.- See Also:
- Kubernetes Docs - CRD Validation
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description StringfieldPathThe field path of the validation rule.StringmessageThe static message of the validation rule.StringmessageExpressionThe messageExpression of the validation rule.booleanoptionalOldSelfTheoptionalOldSelffield is a boolean field that alters the behavior of Transition Rules described below.StringreasonThe machine-readable validation failure reason.
-
-
-
Element Detail
-
value
String value
The validation rule.- Returns:
- the validation rule Kubernetes Docs - CRD Validation - rule
-
-
-
message
String message
The static message of the validation rule.If you want to set a static message, you can supply
messagerather thanmessageExpression(). The value ofmessageis used as an opaque error string if validation fails- Returns:
- the message
- See Also:
- Kubernetes Docs - CRD Validation - message
- Default:
- ""
-
-
-
messageExpression
String messageExpression
The messageExpression of the validation rule.Similar to the
message()field, which defines the string reported for a validation rule failure,messageExpressionallows you to use a CEL expression to construct the message string.- Returns:
- the messageExpression
- See Also:
- Kubernetes Docs - CRD Validation - messageExpression
- Default:
- ""
-
-
-
reason
String reason
The machine-readable validation failure reason.The currently supported reasons are: "FieldValueInvalid", "FieldValueForbidden", "FieldValueRequired", "FieldValueDuplicate". If not set or for unknown reasons, it defaults to "FieldValueInvalid".
- Returns:
- the reason
- See Also:
- Kubernetes Docs - CRD Validation - reason
- Default:
- ""
-
-
-
fieldPath
String fieldPath
The field path of the validation rule.Specifies the field to be returned when the validation fails.
- Returns:
- the fieldPath
- See Also:
- Kubernetes Docs - CRD Validation - fieldPath
- Default:
- ""
-
-
-
optionalOldSelf
boolean optionalOldSelf
TheoptionalOldSelffield is a boolean field that alters the behavior of Transition Rules described below. Normally, a transition rule will not evaluate ifoldSelfcannot be determined: during object creation or when a new value is introduced in an update. IfoptionalOldSelfis set to true, then transition rules will always be evaluated and the type ofoldSelfwill be changed to a CEL Optional type. The feature CRDValidationRatcheting must be enabled in order to make use of this field.- Returns:
- optionalOldSelf
- See Also:
- Kubernetes Docs - CRD Validation - optionalOldSelf
- Default:
- false
-
-