Set default namespace to current

close #78 (closed)

This MR changes the default behavior of the watch and status subcommands: Before, it watch on all namespaces by default. Now the behavior is as follows:

  • -A/--all-namespaces: watch for all namespaces
  • no option: watch current namespace by default (read from kubeconfig file)
  • -n <ns>: watch the <ns>
  • <Kind>/<namespace>/<name>: watch <namespace>
  • error if in -n option mismatches with ns in <Kind>/<namespace>/<name>
  • error when -A is used along with <Kind>/<namespace>/<name>

For inventory subcommand, no change is done, the default is still "all namespaces", because the resource identifier is mandatory.

Edited by Yiping Chen

Merge request reports

Loading