(out io.Writer, args []string, logSetup func(bool))
| 103 | var settings = cli.New() |
| 104 | |
| 105 | func NewRootCmd(out io.Writer, args []string, logSetup func(bool)) (*cobra.Command, error) { |
| 106 | actionConfig := action.NewConfiguration() |
| 107 | cmd, err := newRootCmdWithConfig(actionConfig, out, args, logSetup) |
| 108 | if err != nil { |
| 109 | return nil, err |
| 110 | } |
| 111 | cobra.OnInitialize(func() { |
| 112 | helmDriver := os.Getenv("HELM_DRIVER") |
| 113 | if err := actionConfig.Init(settings.RESTClientGetter(), settings.Namespace(), helmDriver); err != nil { |
| 114 | log.Fatal(err) |
| 115 | } |
| 116 | if helmDriver == "memory" { |
| 117 | loadReleasesInMemory(actionConfig) |
| 118 | } |
| 119 | actionConfig.SetHookOutputFunc(hookOutputWriter) |
| 120 | }) |
| 121 | return cmd, nil |
| 122 | } |
| 123 | |
| 124 | // SetupLogging sets up Helm logging used by the Helm client. |
| 125 | // This function is passed to the NewRootCmd function to enable logging. Any other |
nothing calls this directly
no test coverage detected
searching dependent graphs…