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

🌱 make ensure scripts fail if GOPATH/bin not in PATH #8017

Merged

Conversation

tuminoid
Copy link
Contributor

@tuminoid tuminoid commented Jan 30, 2023

ensure-kind.sh and ensure-kubectl.sh install binaries into $GOPATH/bin, but nowhere it checks that $GOPATH/bin is in user's PATH. In this case, the newly installed binaries won't be found later on.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jan 30, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @tuminoid. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jan 30, 2023
Copy link
Contributor

@killianmuldoon killianmuldoon left a comment

Choose a reason for hiding this comment

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

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 30, 2023
@sbueringer
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 30, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: c42d2beef84fd72ae4b933f4a4f4141aa61372d6

@tuminoid
Copy link
Contributor Author

/assign @CecileRobertMichon

@tuminoid tuminoid force-pushed the tuomo/ensure-kind-path-fix branch from e6530a3 to ff68964 Compare January 30, 2023 13:13
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 30, 2023
@sbueringer
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 30, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: be59b7912822e64ebb578166035ade2726127c80

@tuminoid tuminoid force-pushed the tuomo/ensure-kind-path-fix branch from ff68964 to a613749 Compare January 31, 2023 08:45
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 31, 2023
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jan 31, 2023
@tuminoid tuminoid force-pushed the tuomo/ensure-kind-path-fix branch from a613749 to 16647b5 Compare January 31, 2023 08:48
@tuminoid
Copy link
Contributor Author

Moved the logic to ensure-go.sh, which is called before other ensure scripts.

@tuminoid tuminoid changed the title 🌱 hack: have ensure-kind warn if newly installed kind is not found 🌱 make ensure-go.sh fail if GOPATH/bin is not in PATH Jan 31, 2023
@tuminoid tuminoid force-pushed the tuomo/ensure-kind-path-fix branch from 16647b5 to 128a27b Compare January 31, 2023 11:44
@tuminoid
Copy link
Contributor Author

Move logic to function in utils.sh, called by ensure-*.sh if they install binary to GOPATH_BIN.

ensure-kind.sh and ensure-kubectl.sh install binaries into $GOPATH/bin,
but nowhere it checks that $GOPATH/bin is in user's PATH. In this case,
the newly installed binaries won't be found later on.
@tuminoid tuminoid force-pushed the tuomo/ensure-kind-path-fix branch from 128a27b to 1eb729b Compare January 31, 2023 11:51
@tuminoid tuminoid changed the title 🌱 make ensure-go.sh fail if GOPATH/bin is not in PATH 🌱 make ensure scripts fail if GOPATH/bin not in PATH Jan 31, 2023
@sbueringer
Copy link
Member

Thank you!

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 31, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: bd61588f209f3b8253063e37105288e3a8a210e6

Copy link
Contributor

@CecileRobertMichon CecileRobertMichon left a comment

Choose a reason for hiding this comment

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

thanks!

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CecileRobertMichon

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 31, 2023
@k8s-ci-robot k8s-ci-robot merged commit a8a0a58 into kubernetes-sigs:main Jan 31, 2023
@k8s-ci-robot k8s-ci-robot added this to the v1.4 milestone Jan 31, 2023
@tuminoid tuminoid deleted the tuomo/ensure-kind-path-fix branch January 31, 2023 19:46
@sbueringer
Copy link
Member

sbueringer commented Feb 1, 2023

@tuminoid @CecileRobertMichon @furkatgofurov7
Just fyi. This broke the test periodics because we didn't have the same config there as in our presubmits.

Here is the fix: kubernetes/test-infra#28602

@CecileRobertMichon
Copy link
Contributor

Interesting, not sure I understand how the preriodics were working before that but in any case, thanks for fixing it!

@sbueringer
Copy link
Member

sbueringer commented Feb 1, 2023

I guess the images had the binaries built in (and not sure what the unit tests actually need) and we weren't depending on runner.sh in those jobs (as we are not using kind/ dind there)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants