Skip to content

✨Add RELEASE_TAG to tools/setup-envtest to show binary version with setup-envtest version #3166

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

Merged

Conversation

troy0820
Copy link
Member

@troy0820 troy0820 commented Mar 19, 2025

With the setup-envtest binary, it is difficult to determine the version of the binary that is installed. This will allow the user to use the command setup-envtest version to see what version of the binary is installed.

Note: This is targeting the branch when built and not a specific tag. The setup-envtest instructions for installation shows to target the release branch for specific versions

This will target the release tag defined in the GitHub action when binaries are built.

Resolves #3158

image

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 19, 2025
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 19, 2025
@troy0820 troy0820 force-pushed the troy0820/setup-envtest-version branch from a400b11 to e6fb8d3 Compare March 19, 2025 14:46
@sbueringer
Copy link
Member

sbueringer commented Mar 19, 2025

I think setup-envtest should show the exact version. We are also publishing setup-envtest binaries on every release and it's not ideal if that just shows the branch

(there was some similar work in controller-gen recently: kubernetes-sigs/controller-tools#1046. In general I would expect setup-envtest and controller-gen to behave the same)

@troy0820
Copy link
Member Author

I think setup-envtest should show the exact version. We are also publishing setup-envtest binaries on every release and it's not ideal if that just shows the branch

(there was some similar work in controller-gen recently: kubernetes-sigs/controller-tools#1046. In general I would expect setup-envtest and controller-gen to behave the same)

This makes sense. I made the assumption with how we install to provide the same installation version technique. I can change this to provide the same as controller-gen.

@troy0820 troy0820 force-pushed the troy0820/setup-envtest-version branch from 28eee84 to 7120bc5 Compare March 19, 2025 18:25
@troy0820 troy0820 force-pushed the troy0820/setup-envtest-version branch from 7120bc5 to 51c6d75 Compare March 19, 2025 18:57
@troy0820 troy0820 changed the title ✨Add BranchVersion to tools/setup-envtest to show binary version with setup-envtest version ✨Add RELEASE_TAG to tools/setup-envtest to show binary version with setup-envtest version Mar 21, 2025
@troy0820 troy0820 force-pushed the troy0820/setup-envtest-version branch from 5b38dbb to b81bc88 Compare March 21, 2025 19:04
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 21, 2025
@troy0820 troy0820 force-pushed the troy0820/setup-envtest-version branch from b81bc88 to 2cc7686 Compare March 21, 2025 22:41
@sbueringer
Copy link
Member

Thx!

I'll cherry-pick so we can verify this e2e with the next patch release

/cherry-pick release-0.20

@k8s-infra-cherrypick-robot

@sbueringer: once the present PR merges, I will cherry-pick it on top of release-0.20 in a new PR and assign it to you.

In response to this:

Thx!

I'll cherry-pick so we can verify this e2e with the next patch release

/cherry-pick release-0.20

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.

@sbueringer
Copy link
Member

/lgtm
/approve

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

LGTM label has been added.

Git tree hash: cc081df330d194cd9bc15b0206524629dec178d5

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sbueringer, troy0820

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 Mar 23, 2025
@k8s-ci-robot k8s-ci-robot merged commit 53f325f into kubernetes-sigs:main Mar 23, 2025
10 checks passed
@k8s-infra-cherrypick-robot

@sbueringer: new pull request created: #3175

In response to this:

Thx!

I'll cherry-pick so we can verify this e2e with the next patch release

/cherry-pick release-0.20

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.

import "runtime/debug"

// Version to be set using ldflags:
// -ldflags "-X sigs.k8s.io/controller-tools/pkg/version.version=v1.0.0"
Copy link
Member Author

Choose a reason for hiding this comment

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

Suggested change
// -ldflags "-X sigs.k8s.io/controller-tools/pkg/version.version=v1.0.0"
// -ldflags "-X sigs.k8s.io/controller-runtime/tools/setup-envtest/version.version=v1.0.0"

Copy link
Member Author

Choose a reason for hiding this comment

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

@sbueringer I can make a PR for this to fix the godoc rendering with the correct comment.

Copy link
Member

Choose a reason for hiding this comment

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

Ups. Yup, thx!

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. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

setup-envtest: add version option to print installed version
4 participants