def delete_daemon_set(apps_v1_api: AppsV1Api, name, namespace) -> None:
    """
    Delete a daemon-set.

    :param apps_v1_api: AppsV1Api
    :param name:
    :param namespace:
    :return:
    """
    print(f"Delete a daemon-set: {name}")
    delete_options = client.V1DeleteOptions()
    delete_options.grace_period_seconds = 0
    delete_options.propagation_policy = 'Foreground'
    apps_v1_api.delete_namespaced_daemon_set(name, namespace, delete_options)
    ensure_item_removal(apps_v1_api.read_namespaced_daemon_set_status, name, namespace)
    print(f"Daemon-set was removed with name '{name}'")
Exemplo n.º 2
0
def delete_daemon_set(apps_v1_api: AppsV1Api, name, namespace) -> None:
    """
    Delete a daemon-set.

    :param apps_v1_api: AppsV1Api
    :param name:
    :param namespace:
    :return:
    """
    delete_options = {
        "grace_period_seconds": 0,
        "propagation_policy": "Foreground",
    }
    print(f"Delete a daemon-set: {name}")
    apps_v1_api.delete_namespaced_daemon_set(name, namespace, **delete_options)
    ensure_item_removal(apps_v1_api.read_namespaced_daemon_set_status, name, namespace)
    print(f"Daemon-set was removed with name '{name}'")