-
Notifications
You must be signed in to change notification settings - Fork 473
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
Setup goreleaser for gwctl to generate binaries for various platforms #3038
Setup goreleaser for gwctl to generate binaries for various platforms #3038
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gauravkghildiyal 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 |
f411b84
to
997fc07
Compare
- go mod tidy | ||
- go build -o ./dist/gwctl ./main.go |
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.
At some point, both this and the repo CI should probably include a test suite. Much larger change, non-blocking for this one, but something to put on your todo.
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.
Absolutely yes.
/lgtm |
/retest |
# For local testing, use: | ||
# | ||
# goreleaser release --snapshot --clean | ||
project_name: gwctl |
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.
Do we intend to keep gwctl as a standalone binary or as a kubectl plugin? If it is both, then wouldn't it be better to name the binary kubectl-*
?
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.
This PR only intended to make this available as a standalone binary, but you are right for kubectl plugin that is indeed a better name. (I'll attempt at addressing this in the new PR)
func newVersionCommand() *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "version", | ||
Short: "Print the version information of gwctl", | ||
Long: `Print the version information of gwctl, including version, git commit and build date.`, | ||
Run: func(*cobra.Command, []string) { | ||
fmt.Println(version.GetVersionInfo()) | ||
}, | ||
} | ||
return cmd | ||
} |
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.
nit: Shouldn't this be moved to a separate file like the rest of the subcommands?
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.
Sure can! Thanks
PR needs rebase. 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. |
The Kubernetes project currently lacks enough active contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
I'll take a look into it /cc |
- -s -w | ||
# Embed versioning and build information in the binary. | ||
- -X sigs.k8s.io/gateway-api/gwctl/pkg/version.version={{.Version}} | ||
- -X sigs.k8s.io/gateway-api/gwctl/pkg/version.gitCommit={{.Commit}} |
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.
I think .Commit
is deprecated. Should we use .FullCommit
perhaps instead?
- -X sigs.k8s.io/gateway-api/gwctl/pkg/version.gitCommit={{.Commit}} | |
- -X sigs.k8s.io/gateway-api/gwctl/pkg/version.gitCommit={{.FullCommit}} |
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.
Ah thanks! Didn't know about the deprecation. Will update.
@gauravkghildiyal: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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. I understand the commands that are listed here. |
Thanks for the reviews here everyone! Closing this in favor of resolving this within https://github.com/kubernetes-sigs/gwctl. /close |
@gauravkghildiyal: Closed this PR. In 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. |
What type of PR is this?
/kind feature
What this PR does / why we need it:
gwctl version
command to print binary information.NOTES for the reviewer:
Does this PR introduce a user-facing change?: