-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
✨ Infer version information for go-install #4516
base: master
Are you sure you want to change the base?
✨ Infer version information for go-install #4516
Conversation
Hi @migueleliasweb. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
/ok-to-test |
2a365ac
to
e3072e5
Compare
@dmvolod Simplified the version function now. Added a new |
e3072e5
to
d7dd0cb
Compare
Signed-off-by: Miguel Elias dos Santos <[email protected]>
d7dd0cb
to
7e4c789
Compare
goos = unknown | ||
goarch = unknown | ||
gitCommit = "$Format:%H$" // sha1 from git, output of $(git rev-parse HEAD) | ||
kubernetesVendorVersion = "1.32.1" |
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.
Just to share, if you want to work on this one.
We can do that as a follow up, but we need a target to be called when we run amke generate that will update the k8s version here and in the goreleaser based on the k8s/api (like https://github.com/kubernetes-sigs/kubebuilder/blob/master/testdata/project-v4/Makefile#L179) so, that we can ensure that it is in sync always.
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.
See: #4588
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.
Yeah, I thought of that too while I was working on this file. I'll give it 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.
Ops, it has been assigned already. All good.
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.
/lgtm
/approve
/ok-to-test
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: camilamacedo86, migueleliasweb 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 |
} | ||
|
||
for _, setting := range info.Settings { | ||
if buildDate == unknown && setting.Key == "vcs.revision" { |
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 should be a vcs.time
getting buildDate
, not vcs.revision
Also would be nice to have a minimal test for this case, as I described before mocking debug.ReadBuildInfo()
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.
/hold until @dmvolod give LGTM
and the questions be answered
Now that
kubebuilder
is go-installable 🎉, this is a small improvement to fetch more information when dealing withgo install
installations.With this PR, we will now infer correctly
GitCommit
,BuildDate
,GoOs
andGoArch
for normalGoReleaser
builds but alsogo install
installations.Also a new field is added for
goVersion
Outputs from
make build
andgoreleaser
are kept intact: