Skip to content

Add version command#216

Merged
k8s-ci-robot merged 1 commit intokubernetes-sigs:mainfrom
spencerhance:add-version-cmd
Apr 18, 2025
Merged

Add version command#216
k8s-ci-robot merged 1 commit intokubernetes-sigs:mainfrom
spencerhance:add-version-cmd

Conversation

@spencerhance
Copy link
Copy Markdown
Contributor

@spencerhance spencerhance commented Apr 18, 2025

What type of PR is this?
/kind feature

What this PR does / why we need it:

Adds a version command that can be used to display the current binary version.

This is useful for users to be able to tell what version they are running, especially if installing via a package manager like homebrew.

Example:

./ingress2gateway version
ingress2gateway version: v0.4.0
Built with Go version: go1.24.2
  • This is implemented via a combination of ldflags (to propogate the git tag info) and debug.BuildInfo (to get the golang version).
  • This does not modify the CurrentVersion var in the i2gw package, but plan is to migrate that in a follow-up.

Which issue(s) this PR fixes:
Fixes #213

Does this PR introduce a user-facing change?:

The version of the binary can now be printed with the `version` command (e.g. ingress2gateway version)

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 18, 2025
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Apr 18, 2025
@spencerhance
Copy link
Copy Markdown
Contributor Author

/assign @mlavacca

Adds a `version` command that can be used to display the current binary version.

Example:

    ./ingress2gateway version
    ingress2gateway version: v0.4.0
    Built with Go version: go1.24.2

* This is implemented via a combination of ldflags (to propogate the git tag info) and debug.BuildInfo (to get the golang version).
* This does not modify the CurrentVersion var in the i2gw package, but plan is to migrate that in a follow-up.
@robscott
Copy link
Copy Markdown
Member

This is great, thanks @spencerhance!

/lgtm
/approve

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: robscott, spencerhance

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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 lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Apr 18, 2025
@k8s-ci-robot k8s-ci-robot merged commit 936b78e into kubernetes-sigs:main Apr 18, 2025
5 checks passed
@spencerhance spencerhance deleted the add-version-cmd branch April 18, 2025 23:07
rajashish pushed a commit to rajashish/ingress2gateway1 that referenced this pull request Feb 21, 2026
Adds a `version` command that can be used to display the current binary version.

Example:

    ./ingress2gateway version
    ingress2gateway version: v0.4.0
    Built with Go version: go1.24.2

* This is implemented via a combination of ldflags (to propogate the git tag info) and debug.BuildInfo (to get the golang version).
* This does not modify the CurrentVersion var in the i2gw package, but plan is to migrate that in a follow-up.
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. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Print version number of ingress2gateway

4 participants