Diff two zombie service states.
It takes a current
and a wanted
state and returns an object containing add
, remove
and keep
properties.
npm install --save @zombiec0rn/zombie-service-diff
require('@zombiec0rn/zombie-service-diff')(current, wanted)
// => { add : [], remove : [], keep : [] }
It can on some engines be quite hard to extract the exact configuration used to start a service. Because of this we support a fingerprint
property on services being diffed, that will take precedence over the object hash.
{
"id": "yolo",
"image": "zombiec0rn/yolo:1.0.0",
"fingerprint": "0c0d289f8743bac4719509a04261c3f2d359a58d"
}
The module also exports a fingerprint
function that can be used to create the fingerprint.
require('@zombiec0rn/zombie-service-diff').fingerprint({
id: 'yolo',
image: 'zombiec0rn/yolo:1.0.0'
})
// => 0c0d289f8743bac4719509a04261c3f2d359a58d
- Support for the
fingerprint
property
- Initial release