Bug 1324211

Summary: deleting a container using hammer silently fails without error
Product: Red Hat Satellite 6 Reporter: sthirugn <sthirugn>
Component: Container ManagementAssignee: Daniel Lobato Garcia <dlobatog>
Status: CLOSED ERRATA QA Contact: sthirugn <sthirugn>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.2.0CC: bbuckingham, dzhukous, sthirugn
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/14519
Whiteboard:
Fixed In Version: rubygem-foreman_docker-2.0.1.4-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-27 09:30:56 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:
Bug Depends On: 1327320    
Bug Blocks:    

Description sthirugn@redhat.com 2016-04-05 20:23:07 UTC
Description of problem:
deleting a container in hammer is successful but the container is not actually removed from external docker compute resource

Version-Release number of selected component (if applicable):
Satellite-6.2-beta-snap6.1

How reproducible:
Always

Steps to Reproduce:
1. Create an external docker compute resource
2. Create a docker container using the external docker computer resource
3. delete the docker container using hammer
# hammer -u admin -p changeme docker container list
---|--------------|----------------------------------------------------------------|--------|---------|-----------------
ID | NAME         | IMAGE REPOSITORY                                               | TAG    | COMMAND | COMPUTE RESOURCE
---|--------------|----------------------------------------------------------------|--------|---------|-----------------
5  | container_02 | default_organization-dev1-docker_cv-dockerproduct1-dockerrepo1 | latest | top     | docker_cr       
---|--------------|----------------------------------------------------------------|--------|---------|-----------------


# hammer -u admin -p changeme docker container delete --name container_02
Docker container deleted


# hammer -u admin -p changeme docker container list
---|------|------------------|-----|---------|-----------------
ID | NAME | IMAGE REPOSITORY | TAG | COMMAND | COMPUTE RESOURCE
---|------|------------------|-----|---------|-----------------

Actual results:
Hammer delete was successful as shown above.  But 
* Container is still shown as running in Satellite UI
* Container is still running in the external docker compute resource

Expected results:
Container should be removed from Satellite UI too.
Container should be removed in external docker compute resource too.

Additional info:

Comment 2 Daniel Lobato Garcia 2016-04-07 08:15:14 UTC
Created redmine issue http://projects.theforeman.org/issues/14519 from this bug

Comment 3 Daniel Lobato Garcia 2016-04-07 08:40:03 UTC
Containers deletion does work on the UI but the API is using a different method. I'll create a service so both use the same method for deleting containers - the API was just removing the Foreman object instead of making a delete call to the Docker API

Comment 4 Daniel Lobato Garcia 2016-04-07 14:37:08 UTC
Now under review at https://github.com/theforeman/foreman-docker/pull/154

Comment 5 Daniel Lobato Garcia 2016-04-07 14:40:31 UTC
*** Bug 1266842 has been marked as a duplicate of this bug. ***

Comment 7 sthirugn@redhat.com 2016-04-14 19:08:01 UTC
Blocked with https://bugzilla.redhat.com/show_bug.cgi?id=1327320

Comment 8 Daniel Lobato Garcia 2016-04-15 10:01:16 UTC
How is this blocked by https://bugzilla.redhat.com/show_bug.cgi?id=1327320? You can create a container using the hub, delete it using the API and see if it was deleted on the Docker host or not.

Comment 10 sthirugn@redhat.com 2016-04-15 21:16:24 UTC
Verified in satellite-6.2.0-8.0.beta.el7sat.noarch

hammer> docker container delete --name newcontainer_01
Docker container deleted
hammer> docker container delete --id 10
Docker container deleted

And the external docker host had the containers deleted as well.

Comment 12 errata-xmlrpc 2016-07-27 09:30:56 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2016:1501