Skip to content

feat: clone ctx - #105

Draft
rvignesh89 wants to merge 2 commits into
kubie-org:masterfrom
rvignesh89:rvignesh/ctx-clone
Draft

feat: clone ctx#105
rvignesh89 wants to merge 2 commits into
kubie-org:masterfrom
rvignesh89:rvignesh/ctx-clone

Conversation

@rvignesh89

Copy link
Copy Markdown

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