Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: clone ctx #105

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Conversation

rvignesh89
Copy link

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?

Signed-off-by: Vignesh Rajasekaran <vignesh@rvignesh.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant