Refactor cmd/helm to allow library usage#13617
Conversation
|
Are you looking for a user experience like https://oras.land/docs/1.3.0-beta.1/how_to_guides/go_script The associated PR oras-project/oras#825 |
|
@TerryHowe Somewhat. The implementation is essentially the same, expose the root command. However, I plan to use the root command so I can embed it into a tool I maintain called Zarf, which simplifies air-gap Kubernetes. We do a similar embedding of Kubectl, see - https://github.com/zarf-dev/zarf/blob/fc183abb20353c8d4ce3ba2ecc16c6190e5dbecf/src/cmd/tools/kubectl.go#L23, which allows us to make kubectl callable using the zarf binary with |
joejulian
left a comment
There was a problem hiding this comment.
Just need to restore the SECURITY.md. The rest looks good to me.
|
@AustinAbro321 looks like it needs a rebase already. |
|
@joejulian Rebased, but looks like it's failing from a flake, I'm able to repeat the flake on main #30573 |
|
@joejulian @TerryHowe Looks like the flake was fixed, should be good now |
|
Can you squash this, please. That tar file will remain in the data that would get merged. |
491b353 to
297f7b9
Compare
|
Done |
gjenkins8
left a comment
There was a problem hiding this comment.
(no changes to PR since last approval)
|
A quick example in the docs would bring awareness to this feature. |
|
@AustinAbro321 Has this been backported to v3 as well? |
This is reopening #12725
What this PR does / why we need it:
The Zarf project currently ships additional vendored tools that may be needed in an airgapped environment. Helm doesn't expose the root command and makes use of internal APIs (version for example) so we are a bit stuck at the moment with attempting to vendor a quasi-fork in tree.
It looks like someone else was attempting to do something similar #12122.
I do not believe this to be a breaking change as anything that was in cmd/helm was part of a main package and not exported. I think the bigger question is what surface (if any) do you want to expose.
Here's an example of what this looks like to be used.
Special notes for your reviewer:
My initial goal here is to find out if y'all are open to a change like this - doesn't have to be in this shape. My approach was to publicly expose the bare minimum to make it possible to embed the root Helm command. Aside from the NewRootCmd this included the debug/warning log functions and the PluginError. Would love a discussion and I'm happy to modify/resubmit as needed.
If applicable:
docs neededlabel should be applied if so)