kopf.cli module

class kopf.cli.CLIControls(ready_flag=None, stop_flag=None, vault=None, registry=None, settings=None, loop=None)[source]

Bases: object

KopfRunner controls, which are impossible to pass via CLI.

Parameters:
  • ready_flag (Future | Event | Future | Event | None) –

  • stop_flag (Future | Event | Future | Event | None) –

  • vault (Vault | None) –

  • registry (OperatorRegistry | None) –

  • settings (OperatorSettings | None) –

  • loop (AbstractEventLoop | None) –

ready_flag: Union[Future, Event, Future, Event, None] = None[source]
stop_flag: Union[Future, Event, Future, Event, None] = None[source]
vault: Optional[Vault] = None[source]
registry: Optional[OperatorRegistry] = None[source]
settings: Optional[OperatorSettings] = None[source]
loop: Optional[AbstractEventLoop] = None[source]
class kopf.cli.LogFormatParamType[source]

Bases: Choice

convert(value, param, ctx)[source]

Convert the value to the correct type. This is not called if the value is None (the missing value).

This must accept string values from the command line, as well as values that are already the correct type. It may also convert other compatible types.

The param and ctx arguments may be None in certain situations, such as when converting prompt input.

If the value cannot be converted, call fail() with a descriptive message.

Parameters:
  • value (Any) – The value to convert.

  • param (Any) – The parameter that is using this type to convert its value. May be None.

  • ctx (Any) – The current context that arrived at this value. May be None.

Return type:

LogFormat

kopf.cli.logging_options(fn)[source]

A decorator to configure logging in all commands the same way.

Return type:

Callable[..., Any]

Parameters:

fn (Callable[[...], Any]) –