Esempio n. 1
0
def disable(addons):
    """Disables one or more MicroK8s addons.

    For a list of available addons, run `microk8s status`.

    To see help for individual addons, run:

        microk8s disable ADDON -- --help
    """

    is_cluster_locked()
    exit_if_no_permission()
    ensure_started()

    _, disabled_addons = get_status(get_available_addons(get_current_arch()), True)
    disabled_addons = {a['name'] for a in disabled_addons}

    xable('disable', addons, disabled_addons)
Esempio n. 2
0
def enable(addons):
    """Enables a MicroK8s addon.

    For a list of available addons, run `microk8s status`.

    To see help for individual addons, run:

        microk8s enable ADDON -- --help
    """

    is_cluster_locked()
    exit_if_no_permission()
    ensure_started()

    enabled_addons, _ = get_status(get_available_addons(get_current_arch()), True)
    enabled_addons = {a['name'] for a in enabled_addons}

    xable('enable', addons, enabled_addons)
Esempio n. 3
0
def enable(addons):
    """Enables a MicroK8s addon.

    For a list of available addons, run `microk8s status`.

    To see help for individual addons, run:

        microk8s enable ADDON -- --help
    """

    if check_help_flag(addons):
        return

    is_cluster_locked()
    exit_if_no_permission()
    ensure_started()
    wait_for_ready(timeout=30)

    enabled_addons, _ = get_status(get_available_addons(get_current_arch()),
                                   True)
    enabled_addons = {a["name"] for a in enabled_addons}

    xable("enable", addons, enabled_addons)