Skip to content

drain module should not warn, or have a nowarn, when user requested the action #1037

@smemsh

Description

@smemsh
SUMMARY

Drain module should have an option to disable warnings about things that were explicitly requested by the user.

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

k8s_drain

ADDITIONAL INFORMATION

These warnings are tautological, because the user has already had to provide a non-default option to request the action, so it warns about something that is expected. I would argue they should default to off anyways or be removed, but it's debatable. At least an option would be good. For example this makes little sense:

kubernetes.core.k8s_drain:
  ...
  delete_options:
    ignore_daemonsets: true
    delete_emptydir_data: true

gets the result:

[WARNING]: Deleting Pods with local storage: kube-system/cilium-cst6l.
[WARNING]: Ignoring DaemonSet-managed Pods: kube-system/cilium-envoy-wcpd6.

I have specifically requested these things, yet it warns me. Ok maybe for verbose safety purpose, but not for ordinary operation, at least have a warn boolean. Although kubectl warns about this, I find that silly too, at least allow to suppress these in the ansible module so the tooling output is not polluted.

Note: action warnings can be suppressed in ansible.cfg or in environment, but only on a global basis, so this is best implemented as module arguments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions