redpanda-data / helm-charts

Redpanda Helm Chart
http://redpanda.com
Apache License 2.0
77 stars 96 forks source link

gotohelm: don't transpile in `init()` #1562

Closed chrisseto closed 1 month ago

chrisseto commented 1 month ago

Prior to this commit gotohelm could not safely be imported in other packages/binaries (namely the operator). This was due to gotohelm's init function calling packages.Load which delegates to go list which may not exist (e.g. in distroless) or be readily executable (e.g. with read-only file systems).

This commit moves the transpilation of the bootstrap package into a lazy operation which is only invoked by the transpiler. Doing so will allow other packages/binaries to consume charts in the form of gotohelm.GoChart without needing to worry about the transpiler.

chrisseto commented 1 month ago

Ah, I also removed a handful of unused flags from packages.Load. It might make transpilation a touch faster.