Skip to content
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

[Feature] replace version command with provided via kubernetes-sigs/release-utils #304

Closed
developer-guy opened this issue Sep 19, 2022 · 2 comments · Fixed by #305
Closed
Assignees
Labels
enhancement New feature or request

Comments

@developer-guy
Copy link

Current Behavior

When writing this, regctl's version command displays vcsref and vcstag in JSON by embedding this information into a binary1. I thought we could provide much more information about the build we release.

Expected Behavior

Alternative way:
command.go#L31

Steps To Reproduce

Version

(paste output of `regctl version` or similar for binaries, or `docker image inspect regclient/...` on the image and paste the labels)

Environment

  • Running as binary or container:
  • Host platform:
  • Registry description:

Anything else

Footnotes

  1. https://github.com/regclient/regclient/blob/main/cmd/regctl/root.go#L153

@developer-guy developer-guy added the enhancement New feature or request label Sep 19, 2022
@developer-guy
Copy link
Author

I'm willing to do this, and cosign is also using the same method.

@sudo-bmitch
Copy link
Contributor

sudo-bmitch commented Sep 19, 2022

I'm leaning against pulling in a k8s dependency for this, but after 1.18, the embed code can be factored back out.
https://go.dev/doc/go1.18#debug/buildinfo

I was holding back on this just in case someone was importing from an older version of Go, so I'll have a look at what k8s does for this.

Edit: it looks like k8s is using the debug/buildinfo, so I'd probably just copy what makes sense from there to avoid the dependency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants