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

Implement a kapow version subcommand #99

Open
4 tasks
nilp0inter opened this issue Dec 19, 2019 · 2 comments
Open
4 tasks

Implement a kapow version subcommand #99

nilp0inter opened this issue Dec 19, 2019 · 2 comments
Labels
discussion things to discuss about enhancement New feature or request
Milestone

Comments

@nilp0inter
Copy link
Contributor

nilp0inter commented Dec 19, 2019

We need to know which kapow version is running on the client as well as in the server side.

Taking inspiration from Blatanly copying the docker version subcommand:

$ docker version
Client:
 Version:           19.03.5-ce
 API version:       1.40
 Go version:        go1.13.4
 Git commit:        633a0ea838
 Built:             Fri Nov 15 03:19:09 2019
 OS/Arch:           linux/amd64
 Experimental:      false

Server:
 Engine:
  Version:          19.03.5-ce
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.13.4
  Git commit:       633a0ea838
  Built:            Fri Nov 15 03:17:51 2019
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.3.2.m
  GitCommit:        d50db0a42053864a270f648048f9a8b4f24eced3.m
 runc:
  Version:          1.0.0-rc9
  GitCommit:        d736ef14f0288d6993a1845745d6756cfc9ddd5a
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

Several thing are needed to have this information:

  • Embed git describe output at compilation time. This way we can match the output with the documentation. I've found this
  • Extract information about how the binary was compiled. I don't know if Go already provide this at runtime, but if not we can use the method mentioned earlier.
  • Expose this information via the Control API and/or Data API. This point has to be discussed.
  • Embed the version of the Go compiler used and expose it as well (suggested by @hhurtado & @panchoh)
@nilp0inter nilp0inter added enhancement New feature or request discussion things to discuss about labels Dec 19, 2019
@nilp0inter nilp0inter added this to the Backlog Inbox milestone Dec 19, 2019
@panchoh
Copy link
Contributor

panchoh commented Dec 19, 2019

goreleaser supports leveraging -X vars by default.

See https://goreleaser.com/customization/build/ and look for -X for a taste of it.

@nilp0inter
Copy link
Contributor Author

Very nice! The only thing we have to keep in mind is that whatever method we use it must be consistent with the documentation versioning (even if this means changing the documentation versioning system).

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

No branches or pull requests

2 participants