extend tools/cleanup-containers to support regex of container to remove

Bug #1522168 reported by sean mooney
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kolla
Fix Released
Wishlist
sean mooney

Bug Description

when developing with kolla it is sometime useful to cleanup a set of related containers.

currently the tools/cleanup-containers script removes all deployed kolla containers.
this rfe bug request proposes extending the script to take a grep extended regex as an option first argument

for example running
tools/cleanup-containers "neutron|openvswitch"

would cleanup only the container containing neutron or openvswitch in their name.

running tools/cleanup-containers with no arguments would revert to the current behavior of cleaning up
all containers.

Tags: rfe
Changed in kolla:
assignee: nobody → sean mooney (sean-k-mooney)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla (master)

Fix proposed to branch: master
Review: https://review.openstack.org/252667

Changed in kolla:
status: New → In Progress
Revision history for this message
sean mooney (sean-k-mooney) wrote :

this is just a nice to have but it will stop me typeing
for ct in $(docker ps | grep -E "neutron|openvswitch" | awk '{print $1}'); do docker stop $ct; docker rm $ct; done
every time i want to cleanup a set of related containers.

Changed in kolla:
importance: Undecided → Wishlist
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kolla (master)

Reviewed: https://review.openstack.org/252667
Committed: https://git.openstack.org/cgit/openstack/kolla/commit/?id=2ffb35ee5308ece3717263d38163e5fd9b29a3ae
Submitter: Jenkins
Branch: master

commit 2ffb35ee5308ece3717263d38163e5fd9b29a3ae
Author: Sean Mooney <email address hidden>
Date: Wed Dec 2 22:54:52 2015 +0000

    adds tools/cleanup-containers regex support

    - this change extends the tools/cleanup-containers script to
      support a grep extended regex as a first paramater.
    - if tools/cleanup-containers is called with a grep extended
      regex string as a first paramater, only containers mataching
      that regex will be cleaned up.
    - e.g. tools/cleanup-containers "neutron|openvswitch"
      will cleanup all container whoes name contains either neutron
      or openvswitch.

    Change-Id: Iadb68c0a8de40e9ec2c0a27568e3a372ec0e8303
    Closes-Bug: #1522168

Changed in kolla:
status: In Progress → Fix Committed
Steven Dake (sdake)
Changed in kolla:
milestone: none → mitaka-3
Steven Dake (sdake)
Changed in kolla:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.