diff --git a/vendor/github.com/weaveworks/go-checkpoint/checkpoint.go b/vendor/github.com/weaveworks/go-checkpoint/checkpoint.go index 8acc1f4a2..dbff7d20f 100644 --- a/vendor/github.com/weaveworks/go-checkpoint/checkpoint.go +++ b/vendor/github.com/weaveworks/go-checkpoint/checkpoint.go @@ -118,18 +118,19 @@ func Check(p *CheckParams) (*CheckResponse, error) { p.OS = runtime.GOOS } - // If we're not given a Signature, then attempt to read one. - signature := p.Signature - if p.Signature == "" { - var err error - if p.SignatureFile == "" { - signature, err = getSystemUUID() - } else { - signature, err = checkSignature(p.SignatureFile) - } - if err != nil { - return nil, err - } + // If we're not given a Signature, then attempt to read one from a + // file, if specified, or derive it from the system uuid. + // + // NB: We ignore errors here since it is better to perform the + // check with an empty signature than not at all. + var signature string + switch { + case p.Signature != "": + signature = p.Signature + case p.SignatureFile != "": + signature, _ = checkSignature(p.SignatureFile) + default: + signature, _ = getSystemUUID() } v := u.Query() @@ -293,9 +294,13 @@ func checkResult(r io.Reader) (*CheckResponse, error) { } // getSystemUUID returns the base64 encoded, scrypt hashed contents of -// /sys/class/dmi/id/product_uuid. +// /sys/class/dmi/id/product_uuid, or, if that is not available, +// sys/hypervisor/uuid. func getSystemUUID() (string, error) { uuid, err := ioutil.ReadFile("/sys/class/dmi/id/product_uuid") + if os.IsNotExist(err) { + uuid, err = ioutil.ReadFile("/sys/hypervisor/uuid") + } if err != nil { return "", err } diff --git a/vendor/manifest b/vendor/manifest index 929bc3956..6eadf3d79 100644 --- a/vendor/manifest +++ b/vendor/manifest @@ -803,7 +803,7 @@ { "importpath": "github.com/weaveworks/go-checkpoint", "repository": "https://github.com/weaveworks/go-checkpoint", - "revision": "a235d5b1d2bd7be80fa52ff681f6d6baa933f635", + "revision": "d99cc14f13e7845b370a7dc81d47cafb29cdc97f", "branch": "master" }, {