-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Store tektoncd/pipeline release version to a variable during build #1650
Store tektoncd/pipeline release version to a variable during build #1650
Conversation
Hi @waveywaves. Thanks for your PR. I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the 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. |
24275b3
to
4aff5fb
Compare
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.
The main problem with that approach is that, the final binaries are built using ko
and not the go build
task from the release pipeline. This means, on released version (or even nightly), the version will always be "dev" 😓
@vdemeester Can I add ldflags to ko build then ? :p |
I don't know if it's possible, but if it is, yeah 😅 |
@vdemeester It is possible. Here's an example of the same. ko-build/ko#54 (comment) But it seems that we are not building a binary directly due to which it seems hard to do or if it is being created.. is https://github.com/tektoncd/pipeline/blob/master/tekton/resources.yaml#L109 using it ? |
Also another approach would be to use the github api, should I try that instead ? Based on that I am able to query https://api.github.com/repos/tektoncd/cli/releases/latest but querying https://api.github.com/repos/tektoncd/pipeline/releases/latest is giving me a |
Oh nice 🎉 We should have that in
I didn't understand this question 😛. The resource is just to have the image tag, nothing else.
I wouldn't go there, we shouldn't need to query and depend on GitHub API to be able to add the version in our binary, the information is already in the git repository, no need to depend on GitHub. |
But do we create an explicit binary which we can augment with ldflags ? If there is then it would be easy I wasnt able to find it 😞 (1650.1)
Sorry for that. I just wanted to if there is a binary being create. (which I wasn't able to fine if there was an intermediate one being created) (1650.2)
That makes sense, something even I wouldn't "prefer" to do as it involves being hacky if you will. But, https://github.com/tektoncd/cli/blob/2ca6adbe0168d3c8da79a8891709b5138cd7f49d/pkg/cmd/version/version.go seemed to do it, hence I asked. (1650.3) If all else fails and the binary for the controller in (1650.1) doesn't really exist, what is the next step for this solution in terms of solving the problem to tekton version in the controller ? |
That's a common pattern for CLIs to check the binary version, i.e: |
Any package in |
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.
Thank you for this.
Versions is definitely something I would like to improve on from where we are today.
I'm not sure this will work with our release process today, but it is possible to pick the tag from the pipeline parameter instead of $(git describe)
, so this should still be doable.
4aff5fb
to
41edcb3
Compare
c816ac7
to
3d5ebac
Compare
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.
Thanks for the updates. This looks good now!
Only one comment on the nightly task please.
/ok-to-test |
4012daa
to
b5a13cb
Compare
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.
Looks good :)
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vdemeester 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 |
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.
Thanks. This looks good now, only the missing 's' needs fixing.
It would be nice to document how to query the version from the binaries and/or from the running containers. I understand that the CLI plans to provide an nice way to query it, but we should also doc how to do so using only k8s tools.
Fixes tektoncd#1543 Introduces variable for storing the pipeline version
b5a13cb
to
ea063f8
Compare
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.
Thank you!
It would be great if you could follow up with docs on this.
/lgtm
As a followup to tektoncd#1650 , the `tekton.dev/release` annotation is set on the pod to reflect the value of version.PipelineVersion Signed-off-by: Vibhav Bobade <vibhav.bobde@gmail.com>
As a followup to tektoncd#1650 , the `tekton.dev/release` annotation is set on the pod to reflect the value of version.PipelineVersion Signed-off-by: Vibhav Bobade <vibhav.bobde@gmail.com>
As a followup to tektoncd#1650 , the `tekton.dev/release` annotation is set on the pod to reflect the value of version.PipelineVersion Signed-off-by: Vibhav Bobade <vibhav.bobde@gmail.com>
As a followup to tektoncd#1650 , the `tekton.dev/release` annotation is set on the pod to reflect the value of version.PipelineVersion Signed-off-by: Vibhav Bobade <vibhav.bobde@gmail.com>
As a followup to tektoncd#1650 , the `tekton.dev/release` annotation is set on the pod to reflect the value of version.PipelineVersion Signed-off-by: Vibhav Bobade <vibhav.bobde@gmail.com>
As a followup to tektoncd#1650 , the `tekton.dev/release` annotation is set on the pod to reflect the value of version.PipelineVersion Signed-off-by: Vibhav Bobade <vibhav.bobde@gmail.com>
As a followup to tektoncd#1650 , the `tekton.dev/release` annotation is set on the pod to reflect the value of version.PipelineVersion Signed-off-by: Vibhav Bobade <vibhav.bobde@gmail.com>
As a followup to tektoncd#1650 , the `tekton.dev/release` annotation is set on the pod to reflect the value of version.PipelineVersion Signed-off-by: Vibhav Bobade <vibhav.bobde@gmail.com>
As a followup to tektoncd#1650 , the `tekton.dev/release` annotation is set on the pod to reflect the value of version.PipelineVersion Signed-off-by: Vibhav Bobade <vibhav.bobde@gmail.com>
As a followup to tektoncd#1650 , the `tekton.dev/release` annotation is set on the pod to reflect the value of version.PipelineVersion Signed-off-by: Vibhav Bobade <vibhav.bobde@gmail.com>
As a followup to tektoncd#1650 , the `tekton.dev/release` annotation is set on the pod to reflect the value of version.PipelineVersion Signed-off-by: Vibhav Bobade <vibhav.bobde@gmail.com>
As a followup to #1650 , the `tekton.dev/release` annotation is set on the pod to reflect the value of version.PipelineVersion Signed-off-by: Vibhav Bobade <vibhav.bobde@gmail.com>
Changes
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
See the contribution guide for more details.
Double check this list of stuff that's easy to miss:
cmd
dir, please updatethe release Task to build and release this image.
Reviewer Notes
If API changes are included, additive changes must be approved by at least two OWNERS and backwards incompatible changes must be approved by more than 50% of the OWNERS, and they must first be added in a backwards compatible way.
Release Notes