osm
osm copied to clipboard
"osm metrics enable/disable" are effectively no-ops without args
Bug description:
If both metrics commands are run without any other options, then both commands do not do ANYTHING, are effectively no-ops and just return without doing anything.
Both commands require the --namespace flag to be required - use something like cobra.MarkFlagsRequired to require this flag.
Also the flag should be more appropriately named “--namespaces” to emphasize that multiple namespaces can have metrics enabled or disabled.
Affected area (please mark with X where applicable):
- Install [ ]
- SMI Traffic Access Policy [ ]
- SMI Traffic Specs Policy [ ]
- SMI Traffic Split Policy [ ]
- Permissive Traffic Policy [ ]
- Ingress [ ]
- Egress [ ]
- Envoy Control Plane [ ]
- CLI Tool [X]
- Metrics [ ]
- Certificate Management [ ]
- Sidecar Injection [ ]
- Logging [ ]
- Debugging [ ]
- Tests [ ]
- Demo [ ]
- CI System [ ]
Expected behavior:
Steps to reproduce the bug (as precisely as possible):
bin/osm metrics enable # without any other options bin/osm metrics disable # without any other options

How was OSM installed?:
Anything else we need to know?:
Bug report archive:
Environment:
- OSM version (use
osm version): - Kubernetes version (use
kubectl version): - Size of cluster (number of worker nodes in the cluster):
- Others:
Hi @johnsonshi now osm namespace remove will remove the metrics annotation https://github.com/openservicemesh/osm/pull/4539
also, the command osm metrics enable helps mention that multiple namespaces can have metrics enabled or disabled.

Hi @johnsonshi I can work on this, which task should I start with first?
Added default label size/needed. Please consider re-labeling this issue appropriately.