kubie icon indicating copy to clipboard operation
kubie copied to clipboard

feat: clone ctx

Open rvignesh89 opened this issue 2 years ago • 0 comments

An attempt to implement #88

I'm Introducing an option to the ctx command called clone which if used will clone the last context instead of trying to resolve one. If there is no previous context to switch to this command will throw an error which is not great, but making it silently fail is also possible I guess. It might be relevant for first time use.

It also skips updating the session history to preserve it as otherwise you'll end up with duplicated records and - will not work anymore. You can still pass in the namespace overrides with the -n flag if you want. So I imagine this might be used like if you want a default. Although I don't think this is very useful.

kubie ctx --clone -n default

I didn't look deeper into how the recursive sub-shell works because I don't use this often but if this approach makes sense I can refine that area. @sbstp what do you think of this?

rvignesh89 avatar May 16 '22 19:05 rvignesh89