-
Notifications
You must be signed in to change notification settings - Fork 7k
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
feat: plugin.yaml support platformHooks (closes #7117) #10126
base: main
Are you sure you want to change the base?
Conversation
closes #7117 |
Signed-off-by: Dima Brusilovsky <dimabru@gmail.com>
cecee5a
to
da6294c
Compare
Hi @bacongobbler, any chance you can have a look at the code? |
With a quick look, this also changes the behaviour of
Helm plugins run on Windows, as long as their installer bash script recognises Windows and installs a Windows binary as, e.g., https://github.com/helm/helm-2to3/blob/main/scripts/install_plugin.sh, does. Also, it continues to hard-code a per-platform shell. At least, by my suggestion in #7117, I'm not sure if I'd group the platform hooks by OS as done here, or by event as the current hooks are. That's assuming I'm reading this correctly: lack of tests means I have to imagine what the config file looks like with these changes. It might even be handy to prepare a draft PR against a plugin or two (that already support WIndows) to see how your changes look in the real world, or ask the maintainers of those plugins to do so. That would be important ecosystem feedback anyway. |
Hi @TBBle In your suggestion in #7117 (comment) you suggest to deprecate I think I understand what you mean when you say this change will break existing behavior. I will change the script to not assume exec script by checking os, but rather add an option for the user to explicitly declare the preffered way of execution. As you suggested, I will add unit-tests and a draft pr in another plugin to give a clear example on how this behavior might look. |
Deprecating Basically, I was mirroring the behaviour of |
What this PR does / why we need it:
This pr adds
platformHook
behavior for plugin installations. This is mainly to support plugin installation for windows, since at this point, helm plugins are not able to run on windows.Usage is very similar to current
platformCommand
. The user can specify specific os to run hooks on, and if missing, default to roothooks
key in plugin yamlcloses #7117
Special notes for your reviewer:
For env vars, there was an issue with using built-in
os.ExpandEnv
function on windows.Hence, there's no support for
$var
in windows scripts. What is working though is windows env var syntax%VAR%
- mainly used for%HELM_PLUGIN_DIR%
If applicable: