kubefwd icon indicating copy to clipboard operation
kubefwd copied to clipboard

Hosts File Cleanup

Open aviv-ga opened this issue 2 years ago • 1 comments

Hosts file is not restored when a signal is sent to the process during the actual forwarding (still writing to hosts file). If the signal is sent after the process is done writing to the hosts file, restore is indeed happening. I think it should be able to clean up no matter when the process is interrupted. Atm, i'm cleaning hosts file myself. Other than that, great stuff!

aviv-ga avatar May 08 '22 10:05 aviv-ga

@aviv-ga, I agree that some work is to be done here. kubefwd tries to err on the side of not removing entries unless it is certain they should be removed. However, please note that you should not "have" to clean up the hosts' file if entires are left in it; they will not harm anything since they point to internal IPs. If you run kubefwd again, it will reassign hostnames if there are any duplicates. Personally, if my kubefwd process is interrupted for some reason, like my computer going to sleep, then I just restart the same command, let it finish, and control-c it; this ensures it removed what it added.

cjimti avatar May 19 '22 20:05 cjimti