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

fleetd: detect the existing machine ID #1561

Merged
merged 4 commits into from
Apr 21, 2016

Commits on Apr 21, 2016

  1. fleetd: Detecting the existing machine-id

    Now support detecting the existing machine-id on startup.
    
    Fixes coreos#1241 coreos#615
    wuqixuan authored and Dongsu Park committed Apr 21, 2016
    Configuration menu
    Copy the full SHA
    32c1760 View commit details
    Browse the repository at this point in the history
  2. fleetd: distinguish restart context when beating the Heart

    When beating the Heart in the clean start context, call Heart.Register()
    to avoid such a case of registering machine with the same ID. In the
    restart context, however, call Heart.Beat() to allow registration with
    the same ID. That way fleetd can handle the machine presence in a
    graceful way.
    
    Without this patch, functional tests like TestSingleNodeConnectivityLoss
    fail, because Heart.Register() would always return an error, especially
    when it's in the restart context. That could result in a case of fleetd
    being unable to recover in an expected time frame.
    Dongsu Park committed Apr 21, 2016
    Configuration menu
    Copy the full SHA
    19deb9b View commit details
    Browse the repository at this point in the history
  3. functional: move newMachineID() from nspawn to util.NewMachineID()

    Move newMachineID() from the platform/nspawn.go to util.NewMachineID(),
    to make it available for functional tests. This will be necessary for
    following test cases where machine IDs need to be regenerated.
    Dongsu Park committed Apr 21, 2016
    Configuration menu
    Copy the full SHA
    5157930 View commit details
    Browse the repository at this point in the history
  4. functional: introduce a new test TestDetectMachineId

    A new test TestDetectMachineId checks if a etcd registration fails
    when a duplicated entry for /etc/machine-id gets registered to
    different machines. Note that it's expected to fail in this case.
    
    Goal of the test is to cover the improvement patch by @wuqixuan
    ("fleetd: Detecting the existing machine-id").
    
    See also coreos#1288,
    coreos#1241,
    coreos#615.
    
    Suggested-by: Olaf Buddenhagen <olaf@endocode.com>
    Cc: wuqixuan <wuqixuan@huawei.com>
    Cc: Djalal Harouni <djalal@endocode.com>
    Dongsu Park committed Apr 21, 2016
    Configuration menu
    Copy the full SHA
    176825f View commit details
    Browse the repository at this point in the history