Repository navigation
Conversation
Signed-off-by: Branch Vincent <[email protected]>
Signed-off-by: Branch Vincent <[email protected]>
|
This PR is a bit in depth could you attend the developer call on Thursdays at 9:30-10:00 Pacific (meeting details)?? |
There was a problem hiding this comment.
Thanks for the PR. I do think this is a worthy change. TIL about https://pkg.go.dev/runtime/debug#ReadBuildInfo . Removing these ldflags and Makefile logic from Helm's certainly seems an improvement.
And in particular, Helm is often used as an SDK. And SDK users (presumably) find out the hard way they need to set these ldflags in their build system.
The only concerns I can think of are a) accuracy. I assume debug.ReadBuildInfo() can be accurate here. But probably just need to do some diligence to confirm, and b) performance. As long as reading this info does have some significant latency (I can't imagine it does), I can't imagine Helm wouldn't want to read this info at runtime.
gjenkins8
left a comment
There was a problem hiding this comment.
Git commit changes I think need more thought. If we move them to a seperate PR, can approve the Kubernetes client-go version changes
| if !ok { | ||
| return nil, false | ||
| } | ||
| for _, m := range info.Deps { |
There was a problem hiding this comment.
Could perhaps write this now with slices.IndexFunc ?
| return vs | ||
| } | ||
|
|
||
| func k8sClientVersion() (*semver.Version, bool) { |
There was a problem hiding this comment.
nit: kubernetesClientGoModVersion might be a more accurate name for this function?
This comment is partly inspired by the below v.Major()+1, where client-go uses zero-based major version for some reason I forget. So thought the name should be very clear to what is being determined.
|
This pull request has been marked as stale because it has been open for 90 days with no activity. This pull request will be automatically closed in 30 days if no further activity occurs. |
|
Note: I copied and reworked this PR into: #31296 (which has some differences in implementation, which I think are worthwhile). Also to move this forward and simplify Helm's build. |
|
Thanks for pushing this forward @gjenkins8 |
|
Whoops closed |
|
Yes this was superseded by #31296 |
What this PR does / why we need it:
This is inspired by #13174, where Homebrew built
helmoutside of the Makefile and accidentally did not set the correct ldflags for thek8sVersionvariables (which were defaulted to1.20instead of1.30)Instead, this uses
runtime/debug'sReadBuildInfoto automatically extract the correctk8s.io/client-goversion, regardless if the Makefile was used (for example, usinggo install helm.sh/helm/v3/cmd/helm@latest). It also adds a similar fallback for the git metadata ldflags using 1.18'sBuildSetting(but respects the variables if they are already set):Special notes for your reviewer:
This does introduce a lot of test golden changes since tests now also run with the correct
k8s.io/client-goversionIf applicable: