| 20 | } |
| 21 | |
| 22 | func (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 | } |