rancher / rio

Application Deployment Engine for Kubernetes
https://rio.io
Apache License 2.0
2.27k stars 228 forks source link

Rio CLI could use resource type defaults in various subcommands #1007

Open marcinkoziej opened 4 years ago

marcinkoziej commented 4 years ago

Describe the issue In various rio cli subcommand user must specify the type of resource, even though it is known because of what the command do. For instance, rio config rm configmap/foobar requires user to type "configmap/" even though the subcommand could prefix "configmap/" by default. Rio's goal is to make life easier, so it would be worthwhile to help the user here a little.

This problem is present in commands

Basically right now I can remove a secret using rio config rm secret/foo which seems wrong although it is not harmful.

To Reproduce Steps to reproduce the behavior:

  1. Create a config: echo hello | rio config create test -

  2. Try to remove it easily

    $ rio config rm test
    `FATA[0000] failed to find service test    

Expected behavior Rio CLI assumes use means configmap/test when they provide test

Kubernetes version & type (GKE, on-prem): kubectl version

Client Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.0+k3s.1", GitCommit:"0f644650f5d8e9f091629f860b342f221c46f6d7", GitTreeState:"clean", BuildDate:"2020-01-06T23:22:38Z", GoVersion:"go1.13.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.0+k3s.1", GitCommit:"0f644650f5d8e9f091629f860b342f221c46f6d7", GitTreeState:"clean", BuildDate:"2020-01-06T23:22:38Z", GoVersion:"go1.13.5", Compiler:"gc", Platform:"linux/amd64"}

Type: Rio version: rio info

Rio Version: v0.7.0-rc2 (7ce2d33c)
StrongMonkey commented 4 years ago

@marcinkoziej I merged your PR. If your PR addresses this issue, can you close it? Thank you.