-
Notifications
You must be signed in to change notification settings - Fork 69
[release-1.15] 🐛 Fix knative.dev/toolbox for older versions of Golang #440
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
[release-1.15] 🐛 Fix knative.dev/toolbox for older versions of Golang #440
Conversation
This commit introduces a new shell helper function, `resolve_dep_version`, which retrieves the version of a specified Go module from the project's `go.mod` file. As part of this change: - All usages of `knative.dev/toolbox/...@latest` have been pinned to a specific commit (`@bc7e152`) to ensure reproducible builds and prevent unexpected failures due to upstream changes. - The shell script test harness has been improved to more reliably locate the `go` executable, making the tests more robust across different environments.
The `go_run` helper function is updated to set `GOTOOLCHAIN=auto` when executing toolbox tools.
This change corrects the logic to set `GOTOOLCHAIN=auto` for any package within the `knative.dev/toolbox` module.
This commit makes two corrections to the test suite in `sharedlib_test.go`: 1. In the main test runner, the `errOut` variable (which captures stderr) was incorrectly being checked against the `outputTypeStdout` constant. This has been corrected to `outputTypeStderr` to ensure test failure messages accurately reflect the stream being checked. 2. Potential errors from `io.ReadAll` when capturing stdout and stderr in the `goRunHelpPrefetcher` were being ignored. Assertions have been added to ensure that any errors during these reads are caught, making the test more robust.
cardil
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cardil, knative-prow-robot The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This is an automated cherry-pick of #436