MCPcopy Index your code
hub / github.com/devspace-sh/devspace / LogExecuteHooks

Function LogExecuteHooks

pkg/devspace/hook/hook.go:53–72  ·  view source on GitHub ↗

LogExecuteHooks executes plugin hooks and config hooks and prints errors to the log

(ctx devspacecontext.Context, extraEnv map[string]interface{}, events ...string)

Source from the content-addressed store, hash-verified

51
52// LogExecuteHooks executes plugin hooks and config hooks and prints errors to the log
53func LogExecuteHooks(ctx devspacecontext.Context, extraEnv map[string]interface{}, events ...string) {
54 // call plugin first
55 plugin.LogExecutePluginHookWithContext(extraEnv, events...)
56
57 // now execute hooks
58 if ctx != nil && ctx.Config() != nil {
59 if ctx.Log() == nil {
60 ctx = ctx.WithLogger(logpkg.GetInstance())
61 }
62
63 convertedExtraEnv := plugin.ConvertExtraEnv("DEVSPACE_HOOK", extraEnv)
64 for _, e := range events {
65 convertedExtraEnv["DEVSPACE_HOOK_EVENT"] = e
66 err := executeSingle(ctx, convertedExtraEnv, e)
67 if err != nil {
68 ctx.Log().Warn(err)
69 }
70 }
71 }
72}
73
74// ExecuteHooks executes plugin hooks and config hooks
75func ExecuteHooks(ctx devspacecontext.Context, extraEnv map[string]interface{}, events ...string) error {

Callers 7

doneReverseForwardingFunction · 0.92
StartForwardingFunction · 0.92
stopPortForwardingFunction · 0.92
startWithWaitMethod · 0.92
syncDoneFunction · 0.92
runWithHooksFunction · 0.92

Calls 7

ConvertExtraEnvFunction · 0.92
executeSingleFunction · 0.85
ConfigMethod · 0.65
LogMethod · 0.65
WithLoggerMethod · 0.65
WarnMethod · 0.45

Tested by

no test coverage detected