Expose NewRootCmd

Signed-off-by: Kimmo Lehto <kimmo.lehto@gmail.com>
Signed-off-by: Kimmo Lehto <klehto@mirantis.com>
pull/10412/head
Kimmo Lehto 4 years ago committed by Kimmo Lehto
parent 5d47255a3d
commit 99d3c9e63c
No known key found for this signature in database
GPG Key ID: DD4E00A9C059F929

@ -43,10 +43,6 @@ const FeatureGateOCI = gates.Gate("HELM_EXPERIMENTAL_OCI")
var settings = cli.New()
func init() {
log.SetFlags(log.Lshortfile)
}
func debug(format string, v ...interface{}) {
if settings.Debug {
format = fmt.Sprintf("[debug] %s\n", format)
@ -60,6 +56,8 @@ func warning(format string, v ...interface{}) {
}
func main() {
log.SetFlags(log.Lshortfile)
// Setting the name of the app for managedFields in the Kubernetes client.
// It is set here to the full name of "helm" so that renaming of helm to
// another name (e.g., helm2 or helm3) does not change the name of the
@ -67,7 +65,7 @@ func main() {
kube.ManagedFieldsManager = "helm"
actionConfig := new(action.Configuration)
cmd, err := newRootCmd(actionConfig, os.Stdout, os.Args[1:])
cmd, err := NewRootCmd(actionConfig, os.Stdout, os.Args[1:])
if err != nil {
warning("%+v", err)
os.Exit(1)

@ -115,7 +115,7 @@ func executeActionCommandStdinC(store *storage.Storage, in *os.File, cmd string)
Log: func(format string, v ...interface{}) {},
}
root, err := newRootCmd(actionConfig, buf, args)
root, err := NewRootCmd(actionConfig, buf, args)
if err != nil {
return nil, "", err
}

@ -83,7 +83,7 @@ By default, the default directories depend on the Operating System. The defaults
| Windows | %TEMP%\helm | %APPDATA%\helm | %APPDATA%\helm |
`
func newRootCmd(actionConfig *action.Configuration, out io.Writer, args []string) (*cobra.Command, error) {
func NewRootCmd(actionConfig *action.Configuration, out io.Writer, args []string) (*cobra.Command, error) {
cmd := &cobra.Command{
Use: "helm",
Short: "The Helm package manager for Kubernetes.",

Loading…
Cancel
Save