You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
➜ ~ rm .kube/custom-contexts/inttestv128.yaml
➜ ~ ll .kube/custom-contexts/inttestv128.yaml
ls: .kube/custom-contexts/inttestv128.yaml: No such file or directory
➜ ~ s ske kubeconfig create inttestv128 --filepath ~/.kube/custom-contexts/inttestv128.yaml
Are you sure you want to create a kubeconfig for SKE cluster "inttestv128"? This will OVERWRITE your current kubeconfig file, if it exists. [y/N] y
Created kubeconfig file for cluster inttestv128 in "/Users/stier/.kube/custom-contexts/inttestv128.yaml", with expiration date 2024-07-26T08:08:00Z (UTC)
➜ ~
The cli gives a warning to overwrite the config file if it exists and have a default: No.
This is very nice, but absolut unnecessary if the file des not exist.
Expected behaviour:
Just write the file and avoid unnecessary user interaction.
The text was updated successfully, but these errors were encountered:
slm0n87
changed the title
Dont ask for OVERWRITE if the file does not exist
Dont ask for OVERWRITE if the filepath does not exist
Jul 26, 2024
Hey @slm0n87 thank you once again for your feedback!
In commands that make changes (create, update, delete, etc), we have the common practice of asking the user for confirmation. This is also common behaviour in other CLI's and in programs in general.
However, if you don't want to be prompted for confirmation you can always provide the --assume-yes flag, which will bypass the prompts and remove the user interaction from the command.
Thx @DiogoFerrao, the --assume-yes helped me in that case.
I agree that its common behaviour and best practices for CLI's before overwriting existing files.
But I am not aware of any CLI where I explicitly specify a file as argument and I get prompted to confirm that I really want to save it there.
That's a good point @slm0n87, I think this is also one of the few commands that interact with files in the user's system and not STACKIT resources that come with costs.
We could consider having a check and only prompt the user for confirmation when actually overwriting a file. We will add this topic to the our backlog and keep you updated on its progress!
Doing:
The cli gives a warning to overwrite the config file if it exists and have a default: No.
This is very nice, but absolut unnecessary if the file des not exist.
Expected behaviour:
Just write the file and avoid unnecessary user interaction.
The text was updated successfully, but these errors were encountered: