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

Method ExecuteRemotely

pkg/devspace/hook/logs.go:22–31  ·  view source on GitHub ↗
(ctx devspacecontext.Context, hook *latest.HookConfig, podContainer *selector.SelectedPodContainer)

Source from the content-addressed store, hash-verified

20}
21
22func (r *remoteLogsHook) ExecuteRemotely(ctx devspacecontext.Context, hook *latest.HookConfig, podContainer *selector.SelectedPodContainer) error {
23 ctx.Log().Infof("Execute hook '%s' in container '%s/%s/%s'", ansi.Color(hookName(hook), "white+b"), podContainer.Pod.Namespace, podContainer.Pod.Name, podContainer.Container.Name)
24 reader, err := ctx.KubeClient().Logs(ctx.Context(), podContainer.Pod.Namespace, podContainer.Pod.Name, podContainer.Container.Name, false, hook.Logs.TailLines, true)
25 if err != nil {
26 return err
27 }
28
29 _, err = io.Copy(r.Writer, reader)
30 return err
31}

Callers

nothing calls this directly

Calls 7

hookNameFunction · 0.85
LogMethod · 0.65
LogsMethod · 0.65
KubeClientMethod · 0.65
ContextMethod · 0.65
CopyMethod · 0.65
InfofMethod · 0.45

Tested by

no test coverage detected