k9s icon indicating copy to clipboard operation
k9s copied to clipboard

add dialog to remove active PortForwards from a Pod

Open kandros opened this issue 4 years ago • 5 comments

Co-authored-by: ludovico russo [email protected]

usecase: Often I'm in the situation where I prefer to remove a port forward directly on the page where it is created instead of going to the portforawards view

kandros avatar Jul 31 '21 15:07 kandros

@kandros Thank you for this PR! At first glance the code looks good but I am a tad thorn with the behavior ie the original impetus is to create a port-forward and not delete it which will be the optional behavior from this PR if a pf is already present. I understand deleting a pf does require an extra key press but also does give you the ability to delete other pfs in that swoop. Leaving to the good folks here to upvote as I am on the fence on this deal...

derailed avatar Aug 04 '21 12:08 derailed

@derailed I'm also interested in this feature but I get your point. What do you think to have a different key mapping for deleting port forwards? something like ctrl-shift-P to delete a pf?

ludusrusso-rc avatar Aug 04 '21 12:08 ludusrusso-rc

@ludusrusso-rc Thank you for your reply! I thought about it a bit and let me float an idea what if we renamed the action `Toggle PortForward' thus if a pf does not exist offer a dialog to create it or if there is a pf offer a dialog to delete it thus no need to nav to the pf view to delete it or intro a new shortcut. What do you guys think?

derailed avatar Aug 05 '21 23:08 derailed

@derailed I quite like your idea. One thing to consider is if it would be still possible to handle multiple port forwards - and adding additional port forwards to existing ones or deleting only some existing port forwards. Maybe the behavior could be to always delete the existing ones, use them as a base for the new create action and if you close without saving you toggled the port forwards off.

BernhardGruen avatar Jan 12 '22 18:01 BernhardGruen

@derailed This PR has been open since 2021 with no community upvotes. Given the limited interest and overlap with existing port-forward workflows, probably best to mark stale.

uozalp avatar Sep 16 '25 07:09 uozalp