knight42 / krelay

A better alternative to `kubectl port-forward` that can forward TCP or UDP traffic to IP/Host which is accessible inside the cluster.
MIT License
248 stars 15 forks source link

Windows build #16

Closed transmogrifix closed 1 year ago

transmogrifix commented 1 year ago

Hi,

Is it possible to add support for Windows build?

Thank you!

helmuthb commented 1 year ago

I would also be interested in this! I made a quick proof-of-concept in a fork and it seems to boil down to just these changes:

See the diff here https://github.com/knight42/krelay/compare/main...helmuthb:krelay:main for a proof of concept (I changed "knight42" to "helmuthb" just because I wanted to see the published files) and https://github.com/helmuthb/krelay/releases for the files built.

Not sure whether installing from krew would work (maybe some details have to be adjusted) but after renaming the file contained in kubectl-relay_v0.0.6_windows-amd64.tar.gz to have the .exe-suffix and manually putting it into the krew-folder I can now use kubectl relay from my windows client.

knight42 commented 1 year ago

I made a quick proof-of-concept in a fork and it seems to boil down to just these changes:

Thanks for your work, really appreciate it! The changes LGTM, please feel free to file a PR.

helmuthb commented 1 year ago

Thanks for your work, really appreciate it! The changes LGTM, please feel free to file a PR.

I tried to make a clean PR with only the needed changes. I also added changes which create a kubectl-relay.exe instead of kubectl-relay for Windows, and also added a change to use the kubectl-relay.exe when creating the windows version of the .tar.gz file. For the last change I use a case-statement in the Makefile - let me know if you prefer a different approach instead and I'll rework it accordingly.

transmogrifix commented 1 year ago

Thank you!