odo icon indicating copy to clipboard operation
odo copied to clipboard

`odo logs`: add option to limit component logs to a particular container

Open rm3l opened this issue 3 years ago • 7 comments

/kind user-story

User Story

As an odo user, I want to limit the output of my component logs to a particular container, so that I can focus on that container and debug.

This is feedback received during the "Sprint 220" review.

Acceptance Criteria

  • [ ] odo logs should have a -c, --container option that returns the logs of this particular container
  • [ ] It should error out if there is no matching container
  • [ ] It should be possible to use this option along with the --follow flag

Links

  • Related Epic (mandatory): https://github.com/redhat-developer/odo/issues/5848

/kind user-story

rm3l avatar Jun 29 '22 08:06 rm3l

Before doing this, we first need to figure out a way to show the user the list of containers and segregate them to Dev mode or Deploy mode.

/area log

dharmit avatar Jun 29 '22 12:06 dharmit

We've looked into several ways to approach this issue:

  1. odo logs --list-containers that lists containers before user can decide which container, and then run odo logs --container
  2. odo logs interactive mode that gives a list of containers to choose from
  3. odo logs --container [--pods]- odo logs should show what pod the container belongs to if there are multiple containers with the same name.
  4. provide completion for container names when running odo logs --container

We are inclined towards approach 3.

There might some changes to odo logs from #5872, we'll wait until that is in. /status blocked

valaparthvi avatar Jul 07 '22 13:07 valaparthvi

We've looked into several ways to approach this issue:

  1. odo logs --list-containers that lists containers before user can decide which container, and then run odo logs --container

  2. odo logs interactive mode that gives a list of containers to choose from

  3. odo logs --container [--pods]- odo logs should show what pod the container belongs to if there are multiple containers with the same name.

  4. provide completion for container names when running odo logs --container

IMO, it should be odo list containers.

dharmit avatar Jul 07 '22 13:07 dharmit

We'll wait until we're GA since this is not a blocking feature.

valaparthvi avatar Aug 18 '22 13:08 valaparthvi