Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1327483

Summary: [RFE]enhancement request: support name of container in atomic top
Product: Red Hat Enterprise Linux 7 Reporter: Alex Jia <ajia>
Component: atomicAssignee: Brent Baude <bbaude>
Status: CLOSED CURRENTRELEASE QA Contact: atomic-bugs <atomic-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2CC: dwalsh, miabbott
Target Milestone: rcKeywords: FutureFeature
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-08-26 19:08:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Alex Jia 2016-04-15 08:34:48 UTC
Description of problem:
When users ran a container w/ name then use atomic top to monitor the running container, atomic stop doesn't work, the image id is okay, but it's not very friendly for users, we should support container name just like atomic run, etc.

Version-Release number of selected component (if applicable):

[cloud-user@plat-infra-4zpfp3 ~]$ sudo atomic host status
  TIMESTAMP (UTC)         VERSION     ID             OSNAME               REFSPEC                                                        
* 2016-04-12 14:20:45     7.2.3-1     644fcc6035     rhel-atomic-host     rhel-atomic-host-ostree:rhel-atomic-host/7/x86_64/standard     
  2015-02-19 20:26:26     7.1.0       5799825b36     rhel-atomic-host     rhel-atomic-host-ostree:rhel-atomic-host/7/x86_64/standard   
  
[cloud-user@plat-infra-4zpfp3 ~]$ rpm -q atomic docker
atomic-1.9-4.gitff44c6a.el7.x86_64
docker-1.9.1-25.el7.x86_64

[cloud-user@plat-infra-4zpfp3 ~]$ sudo docker inspect --format='{{.Config.Labels.Version}}-{{.Config.Labels.Release}}' registry.access.redhat.com/rhel7/rsyslog
7.2-21

How reproducible:
always

Steps to Reproduce:
1. atomic install registry.access.redhat.com/rhel7/rsyslog:latest
2. atomic run -n rsyslog registry.access.redhat.com/rhel7/rsyslog:latest
3. docker ps
4. atomic top rsyslog

Actual results:

[cloud-user@plat-infra-4zpfp3 ~]$ sudo docker ps
CONTAINER ID        IMAGE                                      COMMAND             CREATED             STATUS              PORTS               NAMES
366df94058cf        registry.access.redhat.com/rhel7/rsyslog   "/bin/rsyslog.sh"   4 seconds ago       Up 3 seconds                            rsyslog

[cloud-user@plat-infra-4zpfp3 ~]$ sudo atomic top -n 2 366df94058cf|grep rsyslogd
366df94058cf rsyslog 11711      0.0    0.3    0      0      /usr/sbin/rsyslogd -n
366df94058cf rsyslog 11711      0.0    0.3    0      0      /usr/sbin/rsyslogd -n

[cloud-user@plat-infra-4zpfp3 ~]$ sudo atomic top rsyslog
Traceback (most recent call last):
  File "/bin/atomic", line 525, in <module>
    sys.exit(_func())
  File "/usr/lib/python2.7/site-packages/Atomic/top.py", line 121, in atomic_top
    proc_info += self.get_pids_by_container(cid)
  File "/usr/lib/python2.7/site-packages/Atomic/top.py", line 161, in get_pids_by_container
    con_name = str(next((l for l in self.active_containers if l['Id'].startswith(con_id)), None)['Names'][0])
TypeError: 'NoneType' object has no attribute '__getitem__'

Expected results:


Additional info:

Comment 2 Daniel Walsh 2016-08-26 19:08:11 UTC
Works properly in atomic-1.10.