fix: source func CLI version from build ldflags - #4029
Conversation
|
Hi @pmeida. Thanks for your PR. I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with Tip We noticed you've done this a few times! Consider joining the org to skip this step and gain Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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-sigs/prow repository. |
|
/approve |
The func CLI version in generated GitHub workflows was hardcoded to a specific release (knative-v1.22.0), meaning it would silently go stale as new releases shipped. FuncCliVersion is now sourced from version.Kver, which is set via ldflags at build time to the current release tag. The git describe suffix (e.g. "-22-g2871d3bf") is stripped so that dev builds between releases still emit a real, installable tag rather than a ref that does not exist on GitHub releases. When version.Kver is empty (plain go build without ldflags, or the package used as a library), the field falls back to DefaultFuncCliVersion.
a6b4f2d to
0cbe88e
Compare
|
@matejvasek It should be backported to release 4.23 right? |
|
Yeah, we will charrypick it to release 1.23. |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: matejvasek, pmeida 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 |
|
/cherry-pick release-1.23 |
|
@matejvasek: once the present PR merges, I will cherry-pick it on top of DetailsIn response to this:
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-sigs/prow repository. |
|
/ok-to-test |
|
@matejvasek: new pull request created: #4030 DetailsIn response to this:
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-sigs/prow repository. |
Changes
FuncCliVersionfromversion.Kver(set via ldflags at build time) instead of a hardcoded stringgit describesuffix (e.g.-22-g2871d3bf) so dev builds between releases emit the nearest real release tagFuncCliVersionas a field onWorkflowConfigso library consumers can override it directlyno ldflagshave emptyversion.Kver, so it falls back toDefaultFuncCliVersionwhich may be out of date as it has to be manually updated/kind bug
Fixes #4028
Release Note
Docs