New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows support for Helm plugin installers #7117
Comments
ref: Lines 56 to 60 in 22e00be
|
I'm almost completely new to helm, so this might be a stupid question..., but why is there a windows executable of helm (https://github.com/helm/helm/releases) if we can't use it? I followed the steps listed at https://helm.sh/blog/migrate-from-helm-v2-to-helm-v3/ using cmd.com since that is my command line, and soon hit the error described above:
however, now, when trying to use wsl, I get:
Is this salvageable? Could there be a note in the docs (at https://helm.sh/blog/migrate-from-helm-v2-to-helm-v3/) warning windows users to not try this procedure in any of the windows shells? |
@thebjorn I assume you installed the 2to3 plugin outside of WSL. That's probably causing the errors due to the forward slashes in the path used in your example. If you install the plugin from WSL it should work. This issue has good info on your problem: helm/helm-2to3#55 |
@marckhouzam Thanks for the info, I'm sure that will work (although I opted to just stay with helm 2 for now). Your answer seems to indicate that I'll need a parallel helm installation in WSL and that it will not be interchangeable with the one installed from cmd.exe - have I understood that correctly? If I have then I would urge you to update the docs! |
@thebjorn I agree with you, thanks for raising. This need better clarification for users. I have opened the following issue for it: helm/helm-2to3#114 |
This seems hard to fix without requiring installation of some Bourne shell on Windows, e.g. bash from MSYS2 or Git For Windows. Particularly because the plugins contain the shell script, so would each need extra work to support a CMD batch file or PowerShell script. That said, if plugin authors are willing to maintain parallel install scripts for Bourne shell and PowerShell, then it should be relatively easy to fix on the Helm side. |
A search on GitHub suggests we have over 300 public Helm plugins that reference The only way I can see forward here would be to have The cost is that plugins need to take an action to become compatible with this, and we also cannot use |
I also look into hybrid script. Hybrid scripts are runnable inside cmd and bash. They could be use as bootstraper to call the right script on the right platform. |
This issue has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs. |
This remains a reasonable important feature to implement, but it looks like no one (including me) has had the time/priority to advance it. |
I have seen quite some people talk about issues with true support for Windows and that needing bash / sh for installing helm plugins is a bit annoying Personally I don't have a windows machine so I can't even guess how the experience is |
This issue has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs. |
This remains a reasonable important feature to implement, but it looks like no one (including me) has had the time/priority to advance it. |
Looks like the helm maintainer are under powered in general. There are a lot of opened topic but the maintainers did not have the time for it. |
Generally speaking the maintainers have their hands full reviewing code. There are over 100 PRs in the queue. We really don’t have time to write new features ourselves. A very large majority of helm’s functionality was written by the community. |
This issue has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs. |
This remains a reasonable important feature to implement, but it looks like no one (including me) has had the time/priority to advance it. |
A lot of people still use helm on windows 😉 |
@TBBle could doing something like below work with less complexity than the other solutions and offload shell selection to the plugin developers and/or OS? platformHooks:
install:
- os: linux
command: ["sh", "-c", "$HELM_PLUGIN_DIR/scripts/install.sh"]
- os: windows
command: ["pwsh", "-c", "$HELM_PLUGIN_DIR/scripts/install.ps1"] The commands would then be run by If this design (or something like it) looks good and there is enough bandwidth to review the PR I'd be happy to have a go at it as I don't think it adds much complexity. |
Take a look at #10126, it may answers your question. |
@stevehipwell Yeah, that was my preferred solution. It looks like both what I thought #7117 (comment) would look like:
and what I was thinking in #10126 (comment):
I'm in-general not a fan of implicit shell-calls in "exec" systems; this includes things like the I also liked the idea (although I didn't actually try to implement this) of sharing more code with the But that of course is just my opinion, for as much or as little as it's worth. |
@TBBle does it matter that although closely aligned to It's been a while but I think the YAML package used by Helm can support an array value mapped as a single string so potentially we could support both patterns? |
Oh, I missed that difference. I personally prefer it as an array. I recognise not everyone loves the ergonomics of that, i.e. people still write Obviously the most flexible is if we have have both do both, as long as that's not maximising surprise for users, e.g., Dockerfile's This is used by plugin authors, rather than all Helm users, so some complexity to gain features is reasonable. On the other hand, just having the array format is also probably not unworkable for the target audience, no one's going to be writing dozens of these every week. |
I'm not sure if the abstraction on top of go-yaml in sigs.k8s.io/yaml limits the ability to use a custom marshalling solution to solve the multi-type issue. But IMHO this is more of a nice to have than an essential feature. |
I got a working solution for my plugin by creating a hybrid hook script as mentioned in the stackoverflow link above which works fine for me. :; if [ -z 0 ]; then
@echo off
goto :WINDOWS
fi
# ***********************************************************
# * This script is runnable on windows with cmd and linux with bash
# * cmd will ignore lines that start with :;
# * See https://stackoverflow.com/questions/17510688/single-script-to-run-in-both-windows-batch-and-linux-bash
# * and https://github.com/helm/helm/issues/7117
# *
# * The script must have LF line separator and must have extension *.cmd
# * git update-index --chmod=+x bin/install-tools-hook.sh.cmd
# ***********************************************************
# bash stuff
echo "Installing for Linux"
${HELM_PLUGIN_DIR}/bin/install-tools.sh
exit
:WINDOWS
:: windows stuff
echo Installing for Windows
%HELM_PLUGIN_DIR%\bin\install-tools.cmd
This script the executes the windows/linux specific install-tools.xxx script to install the required tools. It is the uses as hook in plugin.yaml hooks:
install: "$HELM_PLUGIN_DIR/bin/install-tools-hook.sh.cmd"
update: "$HELM_PLUGIN_DIR/bin/install-tools-hook.sh.cmd" |
This issue has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs. |
People still insist on using helm on windows. |
Here a manual way to get plugins working which are just copying a binary in the helm plugin folder. Example for helm-images plugin:
|
This issue has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs. |
And yet, people still insist on using helm on windows. |
This issue has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs. |
/not-stale |
Helm's plugin install hook system relies on
/bin/sh
, regardless of the operating system present. Windows users can work around this by using Helm under WSL, but it would be great to have true Windows support out of the box.Example use case as demonstrated in helm/helm-2to3#55:
The text was updated successfully, but these errors were encountered: