Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

registry: remove units from etcd registry upon DestroyUnit() #1510

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Commits on Aug 31, 2016

  1. registry: remove units from etcd registry upon DestroyUnit()

    So far each command "fleetctl destroy unit" has removed job entries from
    the etcd registry, under /_coreos.com/fleet/job. But it has not removed
    its unit file, under /_coreos.com/fleet/unit. As a result, fleet left
    lots of garbages in the etcd registry, so users had to manually clean
    them up.
    
    So this patch gets unit contents deleted actually from etcd registry
    when DestroyUnit() gets called. To avoid potential hash collisions,
    it first fetches a list of units from registry, to check there's any
    duplicated entry. Only if no duplicated unit is found, fleetd actually
    deletes the unit from registry.
    
    Fixes: coreos#1456
    Fixes: coreos#1290
    Reference: coreos#1291
    Dongsu Park committed Aug 31, 2016
    Configuration menu
    Copy the full SHA
    e33ffed View commit details
    Browse the repository at this point in the history
  2. functional: support running etcdctl, as well as using Cluster.Keyspace

    Introduce new helpers for running etcdctl for functional tests.
    Also export a method Cluster.Keyspace() to get it called by functional
    tests.
    Dongsu Park committed Aug 31, 2016
    Configuration menu
    Copy the full SHA
    bc26df1 View commit details
    Browse the repository at this point in the history
  3. functional: add a new test TestUnitDestroyFromRegistry

    A new test TestUnitDestroyFromRegistry() checks for a submitted unit
    being actually deleted from the etcd registry. To compare the old unit
    body with the one registered in the etcd registry, we need to go
    through several steps for queries to etcd.
    Dongsu Park committed Aug 31, 2016
    Configuration menu
    Copy the full SHA
    60c9c80 View commit details
    Browse the repository at this point in the history