-
Notifications
You must be signed in to change notification settings - Fork 111
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
Add a version command #108
Comments
/assign |
/remove-help |
#111 is in but needs follow-ups (I think) |
I don't believe there's any way the callee (kubetest2 repo) can inject the version when something uses |
we have a version when you call kind even with |
Sure, with
The caller can (they could set that linker flag w/ go install, or they could use your makefile), but not the callee, right? |
Yes, I should have looked back at the rest of the context 👍 With kind IMO we instead encourage:
IMO it's an anti-pattern that kubetest2 encourages go get at HEAD still, as soon as we tag a version I think the problem has just been getting to a point ready to tag as a version, which seems to be getting overdue for at least v0.1.x |
+1 yeah we should release a v0.1.0 soon. For the record I don't think we "encourage" folks to go get it from HEAD :) that's just how I've seen most folks use it. /shrug We already have them for CI: https://gcsweb.k8s.io/gcs/k8s-staging-kubetest2/ @coryrc as you said the caller can inject build time variables during
Agreed this is complicated for a human to do, but possible to setup in CI as part of getting the binary. |
right now go get is got get from HEAD until there is a tagged version, encouraging |
kubetest2 --version
should output the tag/commit that it's built from.This is especially important since currently kubetest2 is used in a lot of place by go getting (mostly latest)
so knowing which exact binary(commit) was used is useful.
This will be further useful if it gets surfaced in testgrid metadata for any kubetest2 based job.
Additionally, this should be done for all the in-tree deployers and testers.
The version will also reflect the release once we move to tagged releases.
related: #17
A typical useful pattern is to inject and set package variables at build time through linker flags.
https://blog.alexellis.io/inject-build-time-vars-golang/
A good example can be found in the kind repo
https://github.com/kubernetes-sigs/kind/blob/fbf6cdcf5240c6b994657c9a4f85657ee0591331/Makefile#L57
https://github.com/kubernetes-sigs/kind/blob/fbf6cdcf5240c6b994657c9a4f85657ee0591331/pkg/cmd/kind/version/version.go
xref: kubernetes/enhancements#2464
/help
/good-first-issue
The text was updated successfully, but these errors were encountered: