(ctx devspacecontext.Context, devContainer *latest.DevContainer, opts Options, selectedPod *selector.SelectedPodContainer, parent *tomb.Tomb)
| 419 | } |
| 420 | |
| 421 | func (d *devPod) startAttach(ctx devspacecontext.Context, devContainer *latest.DevContainer, opts Options, selectedPod *selector.SelectedPodContainer, parent *tomb.Tomb) error { |
| 422 | parent.Go(func() error { |
| 423 | id, err := logpkg.AcquireGlobalSilence() |
| 424 | if err != nil { |
| 425 | return err |
| 426 | } |
| 427 | defer logpkg.ReleaseGlobalSilence(id) |
| 428 | |
| 429 | // make sure the global log is silent |
| 430 | ctx = ctx.WithLogger(ctx.Log().WithPrefixColor("attach ", "yellow+b")) |
| 431 | err = attach.StartAttach( |
| 432 | ctx, |
| 433 | devContainer, |
| 434 | newTargetSelector(selectedPod.Pod.Name, selectedPod.Pod.Namespace, selectedPod.Container.Name, parent), |
| 435 | DefaultTerminalStdout, |
| 436 | DefaultTerminalStderr, |
| 437 | DefaultTerminalStdin, |
| 438 | parent, |
| 439 | ) |
| 440 | if err != nil { |
| 441 | return errors.Wrap(err, "error in attach") |
| 442 | } |
| 443 | |
| 444 | // if context is done we just return |
| 445 | if ctx.IsDone() { |
| 446 | return nil |
| 447 | } |
| 448 | |
| 449 | // kill ourselves here |
| 450 | if !opts.ContinueOnTerminalExit { |
| 451 | kill.StopDevSpace("") |
| 452 | } else { |
| 453 | parent.Kill(nil) |
| 454 | } |
| 455 | return nil |
| 456 | }) |
| 457 | |
| 458 | return nil |
| 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 { |
no test coverage detected