itaysk / kubectl-neat

Clean up Kubernetes yaml and json output to make it readable

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Windows release

itaysk opened this issue · comments

nothing really prohibits this plugin from running perfectly on windows. just need to add windows CI tests and builds.

  • add e2e test that runs the tool on windows
  • modification to the makefile to cross compile a windows binary

Currently there is support for Linux and MacOS but the tests run only on Linux (Ubuntu). Do we want to run tests for MacOS too in that case? Or it's just that it's mostly similar (linux, unix) and we don't use any OS specific feature so not problem?

But we want to run tests in Windows though, any reason why? Is it about file path separator issues and any possible windows specific issues?

@itaysk I have question. The release is not automated currently? I can't find any GitHub Action that does a release, for the standalone binaries and for the krew (I haven't worked with krew before though)

@karancode there are a few different levels of testing. only the make test-e2e should be tested on Windows cause they test the binary itself.

the release is automated using goreleaser but is not run from github actions, I release by running make release from my environment.

There are a couple of subtasks here (I'll add them to the issue description):

  1. add e2e test that runs the tool on windows
  2. modification to the makefile to cross compile a windows binary

Once we have these I can release a windows binary as well. Running the release process in GitHub actions is another welcome improvement but not a requirement for this issue.

hope this clarifies, let me know if you have other questions.

What kind of modification do you mean? The current makefile looks fine, except for the fact that the OS is determined with a command and when this runs in GitHub Actions, the os value is Not windows and hence Golang throws error. Any reason why the os is needed? However Golang can determine which platform it's running on. For cross compilation I believe goreleaser is used. I'm wondering how to modify the Makefile to overcome the issue occurring in the GitHub Actions

great questions, actually
sorry when I said modification to the makefile I meant to the goreleaser definition.
the os var in the makefile is a leftover from before we started using goreleaser, and can be removed now

Oh wow. Then I'll remove it as that will cause some problems when running e2e test which first needs a build

On windows 10 64-bit

k krew install neat
Updated the local copy of plugin index.
Installing plugin: neat
W0101 16:42:06.513280 25136 install.go:164] failed to install plugin "neat": plugin "neat" does not offer installation for this platform
F0101 16:42:06.536273 25136 root.go:79] failed to install some plugins: [neat]: plugin "neat" does not offer installation for this platform
exit status 255

I can be your platform tester

@djkormo can you pull the golang codebase and build it with make and try it out with "kubectl-neat" standalone command? That would help! :)

You can try the command and the get subcommand too

@djkormo if you want to test kubectl-neat on windows yourself, you can build the windows branch from source and manually add the plugin to kubectl. the executable works on windows but there's still a last mile to go before releasing an official windows release. try something like:

git clone https://github.com/itaysk/kubectl-neat.git && cd kubectl-neat
git checkout windows
make build #the executable will be created under dist/kubectl-neat
export PATH=$PWD:$PATH #make the executable discoverable by kubectl. add this to your bash_profile if it works
kubectl plugin list #see if kubectl recognize it

I'm not working on this issue anymore. Others are welcome to work on this! 😄 I think this is a good first issue!

@djkormo if you want to test kubectl-neat on windows yourself, you can build the windows branch from source and manually add the plugin to kubectl. the executable works on windows but there's still a last mile to go before releasing an official windows release. try something like:

git clone https://github.com/itaysk/kubectl-neat.git && cd kubectl-neat
git checkout windows
make build #the executable will be created under dist/kubectl-neat
export PATH=$PWD:$PATH #make the executable discoverable by kubectl. add this to your bash_profile if it works
kubectl plugin list #see if kubectl recognize it

Besides go lang, make is also needed on Windows. A quick way to install both is:
Install chocolatey first from https://chocolatey.org/install
Then issue the below two commands in Windows PowerShell:
choco install make -y
choco install golang -y
After make build, a file named kubectl-neat is created under dist. Rename it to kubectl-neat.exe and you can use it.