kubernetes / kops

Kubernetes Operations (kOps) - Production Grade k8s Installation, Upgrades and Management
https://kops.sigs.k8s.io/
Apache License 2.0
15.66k stars 4.61k forks source link

"kops version --server" should assume current context by default #16586

Open shapirus opened 1 month ago

shapirus commented 1 month ago

/kind feature

1. Describe IN DETAIL the feature/behavior/change you would like to see. Current behavior:

$ kops version --server 
Client version: 1.28.4 (git-v1.28.4)
Last applied server version: No cluster selected

Proposed behavior:

$ kops version --server
Client version: 1.28.4 (git-v1.28.4)
Last applied server version: 1.28.4

Unless an explicit --name <name> argument is provided, it won't work.

2. Feel free to provide a design supporting your feature request. Assume current context by default.

(and maybe kops version should also show server version by default? that's questionable though, as it will introduce the delay caused by querying the server.)

hakman commented 1 month ago

Try kops version --server. 😁

shapirus commented 1 month ago

Try kops version --server. 😁

Lol yes, shame on me. Well, almost:

Last applied server version: No cluster selected

it doesn't use current context as default value and requires --name <name> to be specified explicitly.

hakman commented 1 month ago

it doesn't use current context as default value and requires --name <name> to be specified explicitly.

Not sure why this happens, probably not hard to fix.

shapirus commented 1 month ago

it doesn't use current context as default value and requires --name <name> to be specified explicitly.

Not sure why this happens, probably not hard to fix.

I went ahead and edited the title and first post to reflect this, now that I discovered the --server option, to avoid wasting bytes and opening a new issue :).