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

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

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

Conversation

gotha
Copy link

@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).

Signed-off-by: Hristo Georgiev <h.georgiev@hotmail.com>
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.

1 participant