-
Notifications
You must be signed in to change notification settings - Fork 160
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
OCB v0.107.0 and onward no longer report version on command line #664
Comments
Hey @jackgopack4, I'm a bot designed to help you solve bugs, answer questions, and become a contributor. I'm here to assist you while waiting for a human maintainer. 🤖 The OCB binary on version 0.107.0 and onward shows "devel" instead of the appropriate version number because the Here is the relevant part of the Makefile: CGO_ENABLED=0 go install -trimpath -ldflags="-s -w" go.opentelemetry.io/collector/cmd/builder@v$(OTELCOL_BUILDER_VERSION) To fix this, you need to modify the CGO_ENABLED=0 go install -trimpath -ldflags="-s -w -X main.version=$(OTELCOL_BUILDER_VERSION)" go.opentelemetry.io/collector/cmd/builder@v$(OTELCOL_BUILDER_VERSION) This will embed the version number into the binary, ensuring that it shows the correct version instead of "devel" [1]. |
I believe our goreleaser file isn't correct. It is missing:
|
yes @TylerHelmuth you're right; working on the PR to re-add that. Also had to submit a PR for opentelemetry-collector; some code was removed in version.go that was actually enabling setting/viewing the version number when running the binary: open-telemetry/opentelemetry-collector#11208 |
Revert "[chore] delete code to set a version and date, as it it not used (#10715)" Remove date string but re-add functions that check for version number This (mostly) reverts commit b53f57d. <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description This re-enables the functionality to set a version number for ocb binary (cmd/builder). It was erroneously removed. It also adds unit tests for this functionality, as a warning is given on CI with no code coverage. <!-- Issue number if applicable --> #### Link to tracking issue Relates to open-telemetry/opentelemetry-collector-releases#664. Closes #11220 along with open-telemetry/opentelemetry-collector-releases#665 <!--Describe what testing was performed and which tests were added.--> #### Testing ran build and release cycles inside personal fork repositories (jackgopack4/opentelemetry-collector and jackgopack4/opentelemetry-collector-releases) <!--Describe the documentation added.--> #### Documentation .chloggen file <!--Please delete paragraphs that you did not use before submitting.-->
#665 still needs to be merged in order to fix version before v0.111.0 |
After merging #608 and releasing ocb version v0.107.0, ocb binary no longer shows the version and date from v0.106.1 and earlier, instead displaying
devel
Issue first raised by @Tim Chan on the CNCF Slack:
The text was updated successfully, but these errors were encountered: