Skip to content
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: Added multi-platform plugin hook support #12962

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

stevehipwell
Copy link

@stevehipwell stevehipwell commented Apr 18, 2024

What this PR does / why we need it:

This PR addresses #7117 to allow plugin installation on Windows in a backwards compatible way. It also adds better OS specific hook support and improved platform command logic to support args containing a space.

Special notes for your reviewer:

Is there guidance for updating the documentation as AFAIK it's in a separate repo?

If applicable:

  • this PR contains documentation
  • this PR contains unit tests
  • this PR has been tested for backwards compatibility

@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Apr 18, 2024
@stevehipwell stevehipwell changed the title feat: Added multi-platform plugin hook support WIP: Added multi-platform plugin hook support Apr 19, 2024
@stevehipwell stevehipwell force-pushed the add-plugin-platform-hooks branch 2 times, most recently from 1a5d6c7 to d8b46cc Compare April 19, 2024 12:28
@stevehipwell stevehipwell changed the title WIP: Added multi-platform plugin hook support feat: Added multi-platform plugin hook support Apr 19, 2024
@stevehipwell stevehipwell marked this pull request as ready for review April 19, 2024 12:29
@stevehipwell
Copy link
Author

@sabre1041 could you or one of the other maintainers please take a look at this?

@sabre1041
Copy link
Contributor

@sabre1041 could you or one of the other maintainers please take a look at this?

I've started to take a look. Will add some further thoughts in the next day or so

@stevehipwell
Copy link
Author

@sabre1041 have you been able to find any time to look at this? And if so is there any feedback?

@sabre1041
Copy link
Contributor

@sabre1041 have you been able to find any time to look at this? And if so is there any feedback?

getting back up to speed after a work conference. will review this week

Copy link
Contributor

@sabre1041 sabre1041 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified in Linux/OSX environments. Will try to find a Windows box to test against this week

@sabre1041
Copy link
Contributor

sabre1041 commented May 21, 2024

@stevehipwell Receiving the following error on windows when installing a plugin:

helm plugin install https://github.com/databus23/helm-diff
/usr/bin/bash: C:Users<USERNAME>AppDataRoaminghelmpluginshelm-diff/install-binary.sh: No such file or directory
Error: plugin install hook for "diff" exited with error

Not receiving the same error with the latest helm release

@stevehipwell
Copy link
Author

@sabre1041 the error should be consistent, but not necessarily identical, to the existing behaviour on Windows. Basically no currently published Helm plugins can support Windows (unless they have no hooks) so the install script should still fail with the new code.

@sabre1041
Copy link
Contributor

@sabre1041 the error should be consistent, but not necessarily identical, to the existing behaviour on Windows. Basically no currently published Helm plugins can support Windows (unless they have no hooks) so the install script should still fail with the new code.

Contents of PR causes an error while the released code completes successfully. Tested using the helm diff plugin

@stevehipwell
Copy link
Author

@sabre1041 I'm getting the exact same error for both the published code and the code on this branch using my Windows machine.

helm plugin install https://github.com/databus23/helm-diff
Error: exec: "sh": executable file not found in %PATH%

Has the Windows machine you're currently testing on been configured to support sh and do you have a custom value for HELM_PLUGIN_DIR set in this non-Windows shell? If so the difference could be caused by the early evaluation of the environment variables in the new version, which matches the way the platform command functions. I could short circuit the behaviour so that the legacy behaviour stays consistent.

Signed-off-by: Steve Hipwell <steve.hipwell@gmail.com>
@stevehipwell
Copy link
Author

@sabre1041 this should now keep the current behaviour on Windows machines which can run sh commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Windows support for Helm plugin installers
2 participants