kumahq / kuma

🐻 The multi-zone service mesh for containers, Kubernetes and VMs. Built with Envoy. CNCF Sandbox Project.
https://kuma.io/install
Apache License 2.0
3.65k stars 334 forks source link

Align kumactl delete and get commands #2976

Open jpeach opened 3 years ago

jpeach commented 3 years ago

Summary

kumactl get has explicit subcommands for every Kuma type. This means that autocomplete can complete the type name, but the help output gets a bit verbose and unwieldy.

kumactl delete doesn't have explicit subcommands, so autocomplete doesn't know how to complete the type name, and the types are not listed in the help.

On way or the other, these commands should behave the same way.

[kuma@ip-172-16-2-6 ~]$ kumactl delete
Error: accepts 2 arg(s), received 0
Usage:
  kumactl delete TYPE NAME [flags]

Flags:
  -h, --help   help for delete

Global Flags:
      --config-file string   path to the configuration file to use
      --log-level string     log level: one of off|info|debug (default "off")
  -m, --mesh string          mesh to use (default "default")
      --no-config            if set no config file and config directory will be created

[kuma@ip-172-16-2-6 ~]$ kumactl get
Show Kuma resources.

Usage:
  kumactl get [command]

Available Commands:
  circuit-breaker     Show a single CircuitBreaker resource
  circuit-breakers    Show CircuitBreaker
  dataplane           Show a single Dataplane resource
  dataplanes          Show Dataplane
  external-service    Show a single ExternalService resource
  external-services   Show ExternalService
  fault-injection     Show a single FaultInjection resource
  fault-injections    Show FaultInjection
  gateway             Show a single Gateway resource
  gateway-route       Show a single GatewayRoute resource
  gateway-routes      Show GatewayRoute
  gateways            Show Gateway
  global-secret       Show a single GlobalSecret resource
  global-secrets      Show GlobalSecret
  healthcheck         Show a single HealthCheck resource
  healthchecks        Show HealthCheck
  mesh                Show a single Mesh resource
  meshes              Show Mesh
  proxytemplate       Show a single ProxyTemplate resource
  proxytemplates      Show ProxyTemplate
  rate-limit          Show a single RateLimit resource
  rate-limits         Show RateLimit
  retries             Show Retry
  retry               Show a single Retry resource
  secret              Show a single Secret resource
  secrets             Show Secret
  timeout             Show a single Timeout resource
  timeouts            Show Timeout
  traffic-log         Show a single TrafficLog resource
  traffic-logs        Show TrafficLog
  traffic-permission  Show a single TrafficPermission resource
  traffic-permissions Show TrafficPermission
  traffic-route       Show a single TrafficRoute resource
  traffic-routes      Show TrafficRoute
  traffic-trace       Show a single TrafficTrace resource
  traffic-traces      Show TrafficTrace
  virtual-outbound    Show a single VirtualOutbound resource
  virtual-outbounds   Show VirtualOutbound
  zone                Show a single Zone resource
  zone-ingress        Show a single ZoneIngress resource
  zone-ingresses      Show ZoneIngress
  zones               Show Zone

Flags:
  -h, --help            help for get
  -o, --output string   output format: one of table|yaml|json (default "table")

Global Flags:
      --config-file string   path to the configuration file to use
      --log-level string     log level: one of off|info|debug (default "off")
  -m, --mesh string          mesh to use (default "default")
      --no-config            if set no config file and config directory will be created

Use "kumactl get [command] --help" for more information about a command.
github-actions[bot] commented 2 years ago

This issue was inactive for 30 days it will be reviewed in the next triage meeting and might be closed. If you think this issue is still relevant please comment on it promptly or attend the next triage meeting.

github-actions[bot] commented 2 years ago

This issue was inactive for 30 days it will be reviewed in the next triage meeting and might be closed. If you think this issue is still relevant please comment on it promptly or attend the next triage meeting.

github-actions[bot] commented 2 years ago

This issue was inactive for 30 days it will be reviewed in the next triage meeting and might be closed. If you think this issue is still relevant please comment on it promptly or attend the next triage meeting.

afzal442 commented 2 years ago

@lahabana Any help here? Thanks.

afzal442 commented 2 years ago

I think we need to remove Arg option from cobra. https://github.com/kumahq/kuma/blob/79c3b5760a5c2a257f3065fd545ad19d5b792514/app/kumactl/cmd/delete/delete.go#L31

and do some changes here resourceTypeArg := args[0] name := args[1]

github-actions[bot] commented 2 years ago

This issue was inactive for 30 days it will be reviewed in the next triage meeting and might be closed. If you think this issue is still relevant please comment on it promptly or attend the next triage meeting.

github-actions[bot] commented 2 years ago

This issue was inactive for 30 days it will be reviewed in the next triage meeting and might be closed. If you think this issue is still relevant please comment on it promptly or attend the next triage meeting.

github-actions[bot] commented 2 years ago

This issue was inactive for 90 days. It will be reviewed in the next triage meeting and might be closed. If you think this issue is still relevant, please comment on it or attend the next triage meeting.

github-actions[bot] commented 1 year ago

This issue was inactive for 90 days. It will be reviewed in the next triage meeting and might be closed. If you think this issue is still relevant, please comment on it or attend the next triage meeting.

github-actions[bot] commented 1 year ago

This issue was inactive for 90 days. It will be reviewed in the next triage meeting and might be closed. If you think this issue is still relevant, please comment on it or attend the next triage meeting.

github-actions[bot] commented 1 year ago

This issue was inactive for 90 days. It will be reviewed in the next triage meeting and might be closed. If you think this issue is still relevant, please comment on it or attend the next triage meeting.

bcollard commented 1 year ago

also need kumactl delete <TYPE> --all

github-actions[bot] commented 10 months ago

This issue was inactive for 90 days. It will be reviewed in the next triage meeting and might be closed. If you think this issue is still relevant, please comment on it or attend the next triage meeting.

github-actions[bot] commented 7 months ago

This issue was inactive for 90 days. It will be reviewed in the next triage meeting and might be closed. If you think this issue is still relevant, please comment on it or attend the next triage meeting.