Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractTerminalReason ¶ added in v1.8.0
ExtractTerminalReason extracts the reason from a terminal error created with NewTerminalError. Returns the reason and true if found, or empty string and false if the error was not created with NewTerminalError.
This allows setStatusProgressing to use specific reasons like "InvalidConfiguration" instead of the generic "Blocked" for all terminal errors.
func NewTerminalError ¶ added in v1.8.0
NewTerminalError creates a terminal error with a specific reason. The error is wrapped with reconcile.TerminalError so controller-runtime recognizes it as terminal, while preserving the reason for status reporting.
Example usage:
return error.NewTerminalError(ocv1.ReasonInvalidConfiguration, fmt.Errorf("missing required field"))
The reason can be extracted later using ExtractTerminalReason() when setting status conditions to provide more specific feedback than just "Blocked".
func UnwrapTerminal ¶ added in v1.8.0
UnwrapTerminal unwraps a TerminalError to get the underlying error without the "terminal error:" prefix that reconcile.TerminalError adds to the message. This is useful when displaying error messages in status conditions where the terminal/blocked nature is already conveyed by the condition Reason field.
If err is not a TerminalError, it returns err unchanged. If err is nil, it returns nil.
func WrapTerminal ¶
Types ¶
This section is empty.