Skip to content

Load GITHUB_PATH in PATH to use correct binaries when creating registry#133

Merged
cpanato merged 1 commit intohelm:mainfrom
gotha:fix/bin-path
Apr 11, 2025
Merged

Load GITHUB_PATH in PATH to use correct binaries when creating registry#133
cpanato merged 1 commit intohelm:mainfrom
gotha:fix/bin-path

Conversation

@gotha
Copy link
Copy Markdown
Contributor

@gotha gotha commented Jan 31, 2025

When kind.sh installs 'kubectl' and 'kind', they are put in GITHUB_PATH which makes them discoverable for the next steps in the pipeline, but not for other scripts in the same step, like registry.sh for example.

The reason it currently works is that 'kubectl' and 'kind' are already present in Github Action's image. This means that regardless what the actions installs, registry.sh will always use the versions provided by the GH runner.

The version mismatch can potentially cause some issues when running in Github Actions, but completely breaks the pipeline when using local runner like nektos/act where 'kubectl' might not exist in the first place

Here is a more verbose debugging version of this PR that shows what binaries are used at each stage where you can see that when registry.sh starts which -a kubectl reports:

/usr/bin/kubectl
/bin/kubectl

and after GITHUB_PATH is loaded

/opt/hostedtoolcache/kind/v0.26.0/amd64/kubectl/bin//kubectl
/usr/bin/kubectl
/bin/kubectl

The approach in this PR is just one way to do it. I am looking for comments and suggestions on what would be a better way to fix the issue (or even if you consider it an issue at all).

Copy link
Copy Markdown
Member

@cpanato cpanato left a comment

Choose a reason for hiding this comment

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

seems ok
thanks

@cpanato cpanato merged commit d730aaf into helm:main Apr 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants