crate.operator.utils.crate.on module

crate.operator.utils.crate.on.error(*, error_handler)

The @crate.on.error() decorator for kopf handlers or StateBasedSubHandler. It catches permanent errors in handlers and runs a given coroutine. It re-raises the exception for further processing by kopf.

Parameters

error_handler (Callable) – a coroutine which is run on fatal errors

Return type

Callable

async crate.operator.utils.crate.on.send_create_failed_notification(*args, **kwargs)
async crate.operator.utils.crate.on.send_feedback_notification(*, namespace, name, message, operation, status, logger, action=WebhookAction.UNKNOWN, **kwargs)
Parameters
Return type

None

async crate.operator.utils.crate.on.send_update_failed_notification(*args, **kwargs)
crate.operator.utils.crate.on.timeout(*, timeout)

The @crate.timeout() decorator for kopf handlers or StateBasedSubHandler. It checks if the runtime passed as kwarg to all handlers exceeded the given timeout and raises a kopf.HandlerTimeoutError accordingly.

Parameters

timeout (float) – the overall runtime of the decorated handler

Return type

Callable