MCPcopy
hub / github.com/helm/helm / NewRootCmd

Function NewRootCmd

pkg/cmd/root.go:105–122  ·  view source on GitHub ↗
(out io.Writer, args []string, logSetup func(bool))

Source from the content-addressed store, hash-verified

103var settings = cli.New()
104
105func 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

Callers

nothing calls this directly

Calls 8

InitMethod · 0.95
SetHookOutputFuncMethod · 0.95
NewConfigurationFunction · 0.92
newRootCmdWithConfigFunction · 0.85
loadReleasesInMemoryFunction · 0.85
RESTClientGetterMethod · 0.80
FatalMethod · 0.80
NamespaceMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…