-SERVICE_STATES = ['starting', 'running', 'stopping', 'stopped', 'removed']
+SERVICE_STATES = ['starting', 'restarting', 'running', 'stopping', 'stopped', 'removed']
 
 atLeastOneWithState = (services, states...) ->
   _.reduce services, ((memo, service) -> memo or service.state in states), false

  #
  imagePull: (image) ->
    updated = Instances.update {'steps.image': image}, {$set: {'steps.$.completed': true}}

    if f then Instances.update doc._id, $set:
      state: 'created'
      desiredState: 'running'
      status: 'Created'

Instances.find({state: 'removed', desiredState: 'stopped'}, fields: {_id: 1}).observe
  added: (doc, olddoc) -> Instances.remove doc._id
