(ctx devspacecontext.Context, devContainer *latest.DevContainer, opts Options, selectedPod *selector.SelectedPodContainer, parent *tomb.Tomb)
| 459 | } |
| 460 | |
| 461 | func (d *devPod) startTerminal(ctx devspacecontext.Context, devContainer *latest.DevContainer, opts Options, selectedPod *selector.SelectedPodContainer, parent *tomb.Tomb) error { |
| 462 | parent.Go(func() error { |
| 463 | id, err := logpkg.AcquireGlobalSilence() |
| 464 | if err != nil { |
| 465 | return err |
| 466 | } |
| 467 | defer logpkg.ReleaseGlobalSilence(id) |
| 468 | |
| 469 | // make sure the global log is silent |
| 470 | ctx = ctx.WithLogger(ctx.Log().WithPrefixColor("term ", "yellow+b")) |
| 471 | err = terminal.StartTerminal( |
| 472 | ctx, |
| 473 | devContainer, |
| 474 | newTargetSelector(selectedPod.Pod.Name, selectedPod.Pod.Namespace, selectedPod.Container.Name, parent), |
| 475 | DefaultTerminalStdout, |
| 476 | DefaultTerminalStderr, |
| 477 | DefaultTerminalStdin, |
| 478 | parent, |
| 479 | ) |
| 480 | if err != nil { |
| 481 | return errors.Wrap(err, "error in terminal forwarding") |
| 482 | } |
| 483 | |
| 484 | // if context is done we just return |
| 485 | if ctx.IsDone() { |
| 486 | return nil |
| 487 | } |
| 488 | |
| 489 | // kill ourselves here |
| 490 | if !opts.ContinueOnTerminalExit { |
| 491 | kill.StopDevSpace("") |
| 492 | } else { |
| 493 | parent.Kill(nil) |
| 494 | } |
| 495 | return nil |
| 496 | }) |
| 497 | |
| 498 | return nil |
| 499 | } |
| 500 | |
| 501 | func (d *devPod) startServices(ctx devspacecontext.Context, devPod *latest.DevPod, selector targetselector.TargetSelector, opts Options, parent *tomb.Tomb) error { |
| 502 | pluginErr := hook.ExecuteHooks(ctx, map[string]interface{}{}, "devCommand:before:sync", "dev.beforeSync", "devCommand:before:portForwarding", "dev.beforePortForwarding") |
no test coverage detected