Annotation Type ValidationRule

    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      String value
      The validation rule.
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      String fieldPath
      The field path of the validation rule.
      String message
      The static message of the validation rule.
      String messageExpression
      The messageExpression of the validation rule.
      boolean optionalOldSelf
      The optionalOldSelf field is a boolean field that alters the behavior of Transition Rules described below.
      String reason
      The machine-readable validation failure reason.
      • messageExpression

        String messageExpression
        The messageExpression of the validation rule.

        Similar to the message() field, which defines the string reported for a validation rule failure, messageExpression allows 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:
        ""
      • optionalOldSelf

        boolean optionalOldSelf
        The optionalOldSelf field is a boolean field that alters the behavior of Transition Rules described below. Normally, a transition rule will not evaluate if oldSelf cannot be determined: during object creation or when a new value is introduced in an update. If optionalOldSelf is set to true, then transition rules will always be evaluated and the type of oldSelf will 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