INNER CODE UNIT · Python

load_commands

robusta-dev/krr · robusta_krr/main.py:51

def load_commands() -> None:
    for strategy_name, strategy_type in BaseStrategy.get_all().items():  # type: ignore
        # NOTE: This wrapper here is needed to avoid the strategy_name being overwritten in the loop
        def strategy_wrapper(_strategy_name: str = strategy_name):
            def run_strategy(
                ctx: typer.Context,
                kubeconfig: Optional[str] = typer.Option(
                    None,
                    "--kubeconfig",
                    "-k",
                    help="Path to kubeconfig file. If not provided, will attempt to find it.",
                    rich_help_panel="Kubernetes Settings",
                ),
                impersonate_user: Optional[str] = typer.Option(
                    None,
                    "--as",
                    help="Impersonate a user, just like `kubectl --as`. For example, system:serviceaccount:default:krr-account.",
                    rich_help_panel="Kubernetes Settings",

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…