MCPcopy Index your code
hub / github.com/helm/helm / executeCmd

Function executeCmd

internal/plugin/runtime_subprocess.go:171–190  ·  view source on GitHub ↗

TODO decide the best way to handle this code right now we implement status and error return in 3 slightly different ways in this file then replace the other three with a call to this func

(prog *exec.Cmd, pluginName string)

Source from the content-addressed store, hash-verified

169// right now we implement status and error return in 3 slightly different ways in this file
170// then replace the other three with a call to this func
171func executeCmd(prog *exec.Cmd, pluginName string) error {
172 if err := prog.Run(); err != nil {
173 if eerr, ok := err.(*exec.ExitError); ok {
174 slog.Debug(
175 "plugin execution failed",
176 slog.String("pluginName", pluginName),
177 slog.String("error", err.Error()),
178 slog.Int("exitCode", eerr.ExitCode()),
179 slog.String("stderr", string(bytes.TrimSpace(eerr.Stderr))))
180 return &InvokeExecError{
181 Err: fmt.Errorf("plugin %q exited with error", pluginName),
182 ExitCode: eerr.ExitCode(),
183 }
184 }
185
186 return err
187 }
188
189 return nil
190}
191
192func (r *SubprocessPluginRuntime) runCLI(input *Input) (*Output, error) {
193 if _, ok := input.Message.(schema.InputMessageCLIV1); !ok {

Callers 4

InvokeWithEnvMethod · 0.85
runCLIMethod · 0.85
runPostrendererMethod · 0.85
runGetterMethod · 0.85

Calls 3

RunMethod · 0.65
StringMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…