`odo logs`: add option to limit component logs to a particular container
/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 logsshould have a-c,--containeroption 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
--followflag
Links
- Related Epic (mandatory): https://github.com/redhat-developer/odo/issues/5848
/kind user-story
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
We've looked into several ways to approach this issue:
-
odo logs --list-containersthat lists containers before user can decide which container, and then runodo logs --container -
odo logsinteractive mode that gives a list of containers to choose from -
odo logs --container [--pods]- odo logs should show what pod the container belongs to if there are multiple containers with the same name. - 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
We've looked into several ways to approach this issue:
odo logs --list-containersthat lists containers before user can decide which container, and then runodo logs --container
odo logsinteractive mode that gives a list of containers to choose from
odo logs --container [--pods]- odo logs should show what pod the container belongs to if there are multiple containers with the same name.provide completion for container names when running
odo logs --container
IMO, it should be odo list containers.
We'll wait until we're GA since this is not a blocking feature.