From eac418cee1e720f26c5ed7e5357a710f714b2cac Mon Sep 17 00:00:00 2001 From: Emmanuel Nyachoke Date: Thu, 31 Oct 2024 12:46:30 +0300 Subject: [PATCH] OZ-726: Add Service ability to provide extra service metadata --- README.md | 1 + coverage/coverage.json | 2 +- coverage/lcov-report/index.html | 46 +- .../lcov-report/lib/consul/catalog.js.html | 2 +- coverage/lcov-report/lib/consul/index.html | 30 +- coverage/lcov-report/lib/consul/index.js.html | 27 +- coverage/lcov-report/lib/consul/kv.js.html | 2 +- .../lib/container-to-consul.js.html | 41 +- coverage/lcov-report/lib/docker.js.html | 2 +- coverage/lcov-report/lib/errors/index.html | 2 +- .../lcov-report/lib/errors/skipError.js.html | 2 +- coverage/lcov-report/lib/index.html | 43 +- coverage/lcov-report/lib/typedefs.js.html | 2 +- coverage/lcov.info | 399 ++++++++++-------- e2e/docker/test-compose.yaml | 2 + lib/consul/index.js | 3 + lib/container-to-consul.js | 12 +- lib/parse-key-pair.js | 38 ++ test/lib/container-to-consul.test.js | 2 + 19 files changed, 409 insertions(+), 249 deletions(-) create mode 100644 lib/parse-key-pair.js diff --git a/README.md b/README.md index c313798..de6a2ba 100644 --- a/README.md +++ b/README.md @@ -104,6 +104,7 @@ Container registration is an opt-in process. By default, Container-to-Consul wil | `consul.port` | The port that the service will be discovered on| `none` | | `consul.service` | The name of the service in Consul | `container name` | | `consul.tags` | The tags that will be added to the service in Consul | `[]` | +| `consul.meta` | The service [meta](https://developer.hashicorp.com/consul/api-docs/catalog#meta) as `key=value,key=value` | empty | | `consul.kv.` | Key/Value pairs | `{}` | ### Registration diff --git a/coverage/coverage.json b/coverage/coverage.json index 0f96786..ffbe34a 100644 --- a/coverage/coverage.json +++ b/coverage/coverage.json @@ -1 +1 @@ -{"/Users/emmanuelnyachoke/Code/Mekom/con-tainer2sul/lib/consul/catalog.js":{"path":"/Users/emmanuelnyachoke/Code/Mekom/con-tainer2sul/lib/consul/catalog.js","s":{"1":3,"2":1,"3":1,"4":1},"b":{},"f":{"1":3,"2":1,"3":1},"fnMap":{"1":{"name":"(anonymous_1)","line":4,"loc":{"start":{"line":4,"column":14},"end":{"line":4,"column":23}}},"2":{"name":"(anonymous_2)","line":8,"loc":{"start":{"line":8,"column":11},"end":{"line":8,"column":18}}},"3":{"name":"(anonymous_3)","line":12,"loc":{"start":{"line":12,"column":13},"end":{"line":12,"column":20}}}},"statementMap":{"1":{"start":{"line":5,"column":4},"end":{"line":5,"column":25}},"2":{"start":{"line":9,"column":4},"end":{"line":9,"column":58}},"3":{"start":{"line":13,"column":4},"end":{"line":13,"column":60}},"4":{"start":{"line":17,"column":0},"end":{"line":17,"column":25}}},"branchMap":{}},"/Users/emmanuelnyachoke/Code/Mekom/con-tainer2sul/lib/consul/kv.js":{"path":"/Users/emmanuelnyachoke/Code/Mekom/con-tainer2sul/lib/consul/kv.js","s":{"1":5,"2":1,"3":1,"4":1,"5":1,"6":1,"7":0,"8":1,"9":1},"b":{"1":[0,1]},"f":{"1":5,"2":1,"3":1,"4":1,"5":1},"fnMap":{"1":{"name":"(anonymous_1)","line":4,"loc":{"start":{"line":4,"column":14},"end":{"line":4,"column":23}}},"2":{"name":"(anonymous_2)","line":8,"loc":{"start":{"line":8,"column":7},"end":{"line":8,"column":16}}},"3":{"name":"(anonymous_3)","line":12,"loc":{"start":{"line":12,"column":6},"end":{"line":12,"column":19}}},"4":{"name":"(anonymous_4)","line":16,"loc":{"start":{"line":16,"column":6},"end":{"line":16,"column":12}}},"5":{"name":"(anonymous_5)","line":20,"loc":{"start":{"line":20,"column":9},"end":{"line":20,"column":24}}}},"statementMap":{"1":{"start":{"line":5,"column":4},"end":{"line":5,"column":25}},"2":{"start":{"line":9,"column":4},"end":{"line":9,"column":53}},"3":{"start":{"line":13,"column":4},"end":{"line":13,"column":52}},"4":{"start":{"line":17,"column":4},"end":{"line":17,"column":49}},"5":{"start":{"line":21,"column":4},"end":{"line":21,"column":30}},"6":{"start":{"line":23,"column":4},"end":{"line":25,"column":5}},"7":{"start":{"line":24,"column":6},"end":{"line":24,"column":24}},"8":{"start":{"line":27,"column":4},"end":{"line":27,"column":36}},"9":{"start":{"line":31,"column":0},"end":{"line":31,"column":20}}},"branchMap":{"1":{"line":23,"type":"if","locations":[{"start":{"line":23,"column":4},"end":{"line":23,"column":4}},{"start":{"line":23,"column":4},"end":{"line":23,"column":4}}]}}},"/Users/emmanuelnyachoke/Code/Mekom/con-tainer2sul/lib/errors/skipError.js":{"path":"/Users/emmanuelnyachoke/Code/Mekom/con-tainer2sul/lib/errors/skipError.js","s":{"1":1,"2":1},"b":{},"f":{"1":1},"fnMap":{"1":{"name":"(anonymous_1)","line":4,"loc":{"start":{"line":4,"column":14},"end":{"line":4,"column":20}}}},"statementMap":{"1":{"start":{"line":5,"column":4},"end":{"line":5,"column":15}},"2":{"start":{"line":9,"column":0},"end":{"line":9,"column":27}}},"branchMap":{}},"/Users/emmanuelnyachoke/Code/Mekom/con-tainer2sul/lib/consul/index.js":{"path":"/Users/emmanuelnyachoke/Code/Mekom/con-tainer2sul/lib/consul/index.js","s":{"1":1,"2":1,"3":1,"4":6,"5":6,"6":6,"7":6,"8":2,"9":2,"10":2,"11":2,"12":0,"13":0,"14":0,"15":0,"16":0,"17":2,"18":1,"19":2,"20":1,"21":2,"22":1,"23":2,"24":1,"25":1,"26":1,"27":1},"b":{"1":[6,6],"2":[2,0],"3":[1,1],"4":[1,1],"5":[1,1]},"f":{"1":6,"2":2,"3":1,"4":2,"5":1,"6":1,"7":1},"fnMap":{"1":{"name":"(anonymous_1)","line":7,"loc":{"start":{"line":7,"column":13},"end":{"line":7,"column":22}}},"2":{"name":"(anonymous_2)","line":15,"loc":{"start":{"line":15,"column":7},"end":{"line":15,"column":27}}},"3":{"name":"(anonymous_3)","line":45,"loc":{"start":{"line":45,"column":6},"end":{"line":45,"column":12}}},"4":{"name":"(anonymous_4)","line":59,"loc":{"start":{"line":59,"column":6},"end":{"line":59,"column":18}}},"5":{"name":"(anonymous_5)","line":67,"loc":{"start":{"line":67,"column":9},"end":{"line":67,"column":15}}},"6":{"name":"(anonymous_6)","line":71,"loc":{"start":{"line":71,"column":13},"end":{"line":71,"column":16}}},"7":{"name":"(anonymous_7)","line":75,"loc":{"start":{"line":75,"column":8},"end":{"line":75,"column":11}}}},"statementMap":{"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":31}},"2":{"start":{"line":3,"column":0},"end":{"line":3,"column":37}},"3":{"start":{"line":4,"column":0},"end":{"line":4,"column":27}},"4":{"start":{"line":8,"column":4},"end":{"line":8,"column":28}},"5":{"start":{"line":9,"column":4},"end":{"line":9,"column":28}},"6":{"start":{"line":11,"column":4},"end":{"line":11,"column":26}},"7":{"start":{"line":12,"column":4},"end":{"line":12,"column":33}},"8":{"start":{"line":16,"column":4},"end":{"line":19,"column":5}},"9":{"start":{"line":17,"column":6},"end":{"line":17,"column":47}},"10":{"start":{"line":18,"column":6},"end":{"line":18,"column":33}},"11":{"start":{"line":20,"column":4},"end":{"line":37,"column":6}},"12":{"start":{"line":26,"column":10},"end":{"line":26,"column":19}},"13":{"start":{"line":27,"column":10},"end":{"line":33,"column":11}},"14":{"start":{"line":28,"column":12},"end":{"line":28,"column":36}},"15":{"start":{"line":30,"column":12},"end":{"line":32,"column":14}},"16":{"start":{"line":34,"column":10},"end":{"line":34,"column":22}},"17":{"start":{"line":39,"column":4},"end":{"line":41,"column":5}},"18":{"start":{"line":40,"column":6},"end":{"line":40,"column":26}},"19":{"start":{"line":42,"column":4},"end":{"line":42,"column":26}},"20":{"start":{"line":46,"column":4},"end":{"line":46,"column":34}},"21":{"start":{"line":60,"column":4},"end":{"line":62,"column":5}},"22":{"start":{"line":61,"column":6},"end":{"line":61,"column":32}},"23":{"start":{"line":64,"column":4},"end":{"line":64,"column":40}},"24":{"start":{"line":68,"column":4},"end":{"line":68,"column":37}},"25":{"start":{"line":72,"column":4},"end":{"line":72,"column":29}},"26":{"start":{"line":76,"column":4},"end":{"line":76,"column":24}},"27":{"start":{"line":80,"column":0},"end":{"line":80,"column":24}}},"branchMap":{"1":{"line":12,"type":"binary-expr","locations":[{"start":{"line":12,"column":14},"end":{"line":12,"column":23}},{"start":{"line":12,"column":27},"end":{"line":12,"column":32}}]},"2":{"line":16,"type":"if","locations":[{"start":{"line":16,"column":4},"end":{"line":16,"column":4}},{"start":{"line":16,"column":4},"end":{"line":16,"column":4}}]},"3":{"line":17,"type":"cond-expr","locations":[{"start":{"line":17,"column":37},"end":{"line":17,"column":40}},{"start":{"line":17,"column":43},"end":{"line":17,"column":46}}]},"4":{"line":39,"type":"if","locations":[{"start":{"line":39,"column":4},"end":{"line":39,"column":4}},{"start":{"line":39,"column":4},"end":{"line":39,"column":4}}]},"5":{"line":60,"type":"if","locations":[{"start":{"line":60,"column":4},"end":{"line":60,"column":4}},{"start":{"line":60,"column":4},"end":{"line":60,"column":4}}]}}},"/Users/emmanuelnyachoke/Code/Mekom/con-tainer2sul/lib/container-to-consul.js":{"path":"/Users/emmanuelnyachoke/Code/Mekom/con-tainer2sul/lib/container-to-consul.js","s":{"1":22,"2":22,"3":22,"4":22,"5":22,"6":21,"7":21,"8":21,"9":21,"10":21,"11":25,"12":2,"13":1,"14":1,"15":1,"16":25,"17":2,"18":1,"19":1,"20":1,"21":5,"22":5,"23":2,"24":1,"25":1,"26":4,"27":6,"28":6,"29":1,"30":1,"31":5,"32":4,"33":1,"34":1,"35":3,"36":3,"37":2,"38":2,"39":1,"40":2,"41":4,"42":4,"43":4,"44":2,"45":1,"46":1,"47":1,"48":2,"49":2,"50":2,"51":1,"52":1,"53":1,"54":1,"55":2,"56":2,"57":2,"58":0,"59":0,"60":0,"61":0,"62":0,"63":2,"64":2,"65":1,"66":1,"67":1,"68":1,"69":3,"70":3,"71":3,"72":3,"73":3,"74":3,"75":0,"76":3,"77":3,"78":9,"79":2,"80":2,"81":1,"82":2,"83":2,"84":2,"85":2,"86":1,"87":0,"88":2,"89":1,"90":1,"91":1,"92":2,"93":1,"94":3,"95":3,"96":3,"97":3,"98":1,"99":3,"100":3,"101":1,"102":3,"103":2,"104":3,"105":3,"106":5,"107":5,"108":1,"109":5,"110":22},"b":{"1":[1,1],"2":[2,1],"3":[1,0],"4":[4,1],"5":[5,4],"6":[1,1],"7":[2,0],"8":[0,0],"9":[3,0],"10":[0,3],"11":[3,3,3],"12":[3,0],"13":[2,2,1,1],"14":[1,1],"15":[1,1],"16":[1,2],"17":[3,1],"18":[1,2],"19":[3,2,1],"20":[2,1],"21":[3,2],"22":[1,4],"23":[5,3,1]},"f":{"1":21,"2":25,"3":5,"4":1,"5":4,"6":2,"7":2,"8":3,"9":3,"10":5},"fnMap":{"1":{"name":"(anonymous_1)","line":10,"loc":{"start":{"line":10,"column":13},"end":{"line":10,"column":22}}},"2":{"name":"(anonymous_2)","line":20,"loc":{"start":{"line":20,"column":15},"end":{"line":20,"column":18}}},"3":{"name":"(anonymous_3)","line":41,"loc":{"start":{"line":41,"column":7},"end":{"line":41,"column":10}}},"4":{"name":"(anonymous_4)","line":85,"loc":{"start":{"line":85,"column":20},"end":{"line":85,"column":33}}},"5":{"name":"(anonymous_5)","line":94,"loc":{"start":{"line":94,"column":19},"end":{"line":94,"column":31}}},"6":{"name":"(anonymous_6)","line":127,"loc":{"start":{"line":127,"column":21},"end":{"line":127,"column":33}}},"7":{"name":"(anonymous_7)","line":156,"loc":{"start":{"line":156,"column":19},"end":{"line":156,"column":29}}},"8":{"name":"(anonymous_8)","line":174,"loc":{"start":{"line":174,"column":19},"end":{"line":174,"column":31}}},"9":{"name":"(anonymous_9)","line":240,"loc":{"start":{"line":240,"column":22},"end":{"line":240,"column":34}}},"10":{"name":"(anonymous_10)","line":265,"loc":{"start":{"line":265,"column":18},"end":{"line":265,"column":30}}}},"statementMap":{"1":{"start":{"line":3,"column":0},"end":{"line":3,"column":33}},"2":{"start":{"line":4,"column":0},"end":{"line":4,"column":35}},"3":{"start":{"line":5,"column":0},"end":{"line":5,"column":35}},"4":{"start":{"line":6,"column":0},"end":{"line":6,"column":36}},"5":{"start":{"line":7,"column":0},"end":{"line":7,"column":48}},"6":{"start":{"line":11,"column":4},"end":{"line":11,"column":25}},"7":{"start":{"line":13,"column":4},"end":{"line":13,"column":44}},"8":{"start":{"line":14,"column":4},"end":{"line":14,"column":35}},"9":{"start":{"line":15,"column":4},"end":{"line":15,"column":50}},"10":{"start":{"line":17,"column":4},"end":{"line":17,"column":25}},"11":{"start":{"line":21,"column":4},"end":{"line":29,"column":7}},"12":{"start":{"line":22,"column":6},"end":{"line":28,"column":11}},"13":{"start":{"line":24,"column":27},"end":{"line":24,"column":60}},"14":{"start":{"line":26,"column":10},"end":{"line":26,"column":32}},"15":{"start":{"line":27,"column":10},"end":{"line":27,"column":22}},"16":{"start":{"line":30,"column":4},"end":{"line":38,"column":7}},"17":{"start":{"line":31,"column":6},"end":{"line":37,"column":11}},"18":{"start":{"line":33,"column":27},"end":{"line":33,"column":87}},"19":{"start":{"line":35,"column":10},"end":{"line":35,"column":32}},"20":{"start":{"line":36,"column":10},"end":{"line":36,"column":22}},"21":{"start":{"line":42,"column":4},"end":{"line":77,"column":9}},"22":{"start":{"line":44,"column":18},"end":{"line":50,"column":10}},"23":{"start":{"line":46,"column":10},"end":{"line":48,"column":11}},"24":{"start":{"line":47,"column":12},"end":{"line":47,"column":22}},"25":{"start":{"line":49,"column":10},"end":{"line":49,"column":22}},"26":{"start":{"line":52,"column":8},"end":{"line":70,"column":12}},"27":{"start":{"line":53,"column":10},"end":{"line":69,"column":15}},"28":{"start":{"line":55,"column":14},"end":{"line":68,"column":19}},"29":{"start":{"line":58,"column":18},"end":{"line":60,"column":19}},"30":{"start":{"line":59,"column":20},"end":{"line":59,"column":55}},"31":{"start":{"line":63,"column":18},"end":{"line":65,"column":19}},"32":{"start":{"line":64,"column":20},"end":{"line":64,"column":55}},"33":{"start":{"line":66,"column":18},"end":{"line":66,"column":40}},"34":{"start":{"line":67,"column":18},"end":{"line":67,"column":30}},"35":{"start":{"line":72,"column":18},"end":{"line":72,"column":42}},"36":{"start":{"line":73,"column":26},"end":{"line":73,"column":61}},"37":{"start":{"line":75,"column":8},"end":{"line":75,"column":30}},"38":{"start":{"line":76,"column":8},"end":{"line":76,"column":20}},"39":{"start":{"line":86,"column":4},"end":{"line":86,"column":87}},"40":{"start":{"line":86,"column":51},"end":{"line":86,"column":84}},"41":{"start":{"line":95,"column":4},"end":{"line":95,"column":16}},"42":{"start":{"line":97,"column":4},"end":{"line":107,"column":5}},"43":{"start":{"line":98,"column":6},"end":{"line":98,"column":50}},"44":{"start":{"line":101,"column":6},"end":{"line":104,"column":7}},"45":{"start":{"line":102,"column":8},"end":{"line":102,"column":33}},"46":{"start":{"line":103,"column":8},"end":{"line":103,"column":33}},"47":{"start":{"line":106,"column":6},"end":{"line":106,"column":31}},"48":{"start":{"line":109,"column":4},"end":{"line":109,"column":52}},"49":{"start":{"line":111,"column":4},"end":{"line":118,"column":9}},"50":{"start":{"line":112,"column":18},"end":{"line":112,"column":55}},"51":{"start":{"line":113,"column":18},"end":{"line":113,"column":112}},"52":{"start":{"line":115,"column":8},"end":{"line":115,"column":88}},"53":{"start":{"line":116,"column":8},"end":{"line":116,"column":30}},"54":{"start":{"line":117,"column":8},"end":{"line":117,"column":20}},"55":{"start":{"line":128,"column":4},"end":{"line":131,"column":57}},"56":{"start":{"line":133,"column":4},"end":{"line":135,"column":5}},"57":{"start":{"line":134,"column":6},"end":{"line":134,"column":31}},"58":{"start":{"line":137,"column":4},"end":{"line":145,"column":7}},"59":{"start":{"line":138,"column":6},"end":{"line":144,"column":7}},"60":{"start":{"line":139,"column":8},"end":{"line":141,"column":28}},"61":{"start":{"line":143,"column":8},"end":{"line":143,"column":81}},"62":{"start":{"line":147,"column":4},"end":{"line":147,"column":33}},"63":{"start":{"line":157,"column":4},"end":{"line":157,"column":54}},"64":{"start":{"line":159,"column":4},"end":{"line":165,"column":9}},"65":{"start":{"line":160,"column":18},"end":{"line":160,"column":72}},"66":{"start":{"line":161,"column":18},"end":{"line":161,"column":68}},"67":{"start":{"line":163,"column":8},"end":{"line":163,"column":30}},"68":{"start":{"line":164,"column":8},"end":{"line":164,"column":20}},"69":{"start":{"line":175,"column":4},"end":{"line":181,"column":6}},"70":{"start":{"line":182,"column":4},"end":{"line":185,"column":17}},"71":{"start":{"line":187,"column":4},"end":{"line":189,"column":5}},"72":{"start":{"line":188,"column":6},"end":{"line":188,"column":43}},"73":{"start":{"line":191,"column":4},"end":{"line":191,"column":50}},"74":{"start":{"line":193,"column":4},"end":{"line":195,"column":5}},"75":{"start":{"line":194,"column":6},"end":{"line":194,"column":87}},"76":{"start":{"line":196,"column":4},"end":{"line":227,"column":5}},"77":{"start":{"line":197,"column":6},"end":{"line":226,"column":9}},"78":{"start":{"line":198,"column":8},"end":{"line":225,"column":9}},"79":{"start":{"line":200,"column":12},"end":{"line":200,"column":42}},"80":{"start":{"line":201,"column":12},"end":{"line":203,"column":13}},"81":{"start":{"line":202,"column":14},"end":{"line":202,"column":52}},"82":{"start":{"line":204,"column":12},"end":{"line":204,"column":18}},"83":{"start":{"line":206,"column":12},"end":{"line":215,"column":13}},"84":{"start":{"line":207,"column":14},"end":{"line":207,"column":59}},"85":{"start":{"line":208,"column":14},"end":{"line":210,"column":15}},"86":{"start":{"line":209,"column":16},"end":{"line":209,"column":44}},"87":{"start":{"line":214,"column":14},"end":{"line":214,"column":32}},"88":{"start":{"line":216,"column":12},"end":{"line":216,"column":18}},"89":{"start":{"line":218,"column":12},"end":{"line":218,"column":50}},"90":{"start":{"line":219,"column":12},"end":{"line":219,"column":18}},"91":{"start":{"line":221,"column":12},"end":{"line":223,"column":38}},"92":{"start":{"line":223,"column":26},"end":{"line":223,"column":36}},"93":{"start":{"line":224,"column":12},"end":{"line":224,"column":18}},"94":{"start":{"line":229,"column":4},"end":{"line":229,"column":39}},"95":{"start":{"line":231,"column":4},"end":{"line":231,"column":19}},"96":{"start":{"line":241,"column":4},"end":{"line":241,"column":30}},"97":{"start":{"line":243,"column":4},"end":{"line":245,"column":5}},"98":{"start":{"line":244,"column":6},"end":{"line":244,"column":32}},"99":{"start":{"line":247,"column":4},"end":{"line":247,"column":32}},"100":{"start":{"line":248,"column":4},"end":{"line":250,"column":5}},"101":{"start":{"line":249,"column":6},"end":{"line":249,"column":37}},"102":{"start":{"line":251,"column":4},"end":{"line":253,"column":5}},"103":{"start":{"line":252,"column":6},"end":{"line":252,"column":33}},"104":{"start":{"line":254,"column":4},"end":{"line":254,"column":35}},"105":{"start":{"line":256,"column":4},"end":{"line":256,"column":16}},"106":{"start":{"line":266,"column":4},"end":{"line":266,"column":32}},"107":{"start":{"line":267,"column":4},"end":{"line":269,"column":5}},"108":{"start":{"line":268,"column":6},"end":{"line":268,"column":37}},"109":{"start":{"line":270,"column":4},"end":{"line":270,"column":16}},"110":{"start":{"line":275,"column":0},"end":{"line":275,"column":35}}},"branchMap":{"1":{"line":46,"type":"if","locations":[{"start":{"line":46,"column":10},"end":{"line":46,"column":10}},{"start":{"line":46,"column":10},"end":{"line":46,"column":10}}]},"2":{"line":46,"type":"binary-expr","locations":[{"start":{"line":46,"column":14},"end":{"line":46,"column":30}},{"start":{"line":46,"column":34},"end":{"line":46,"column":58}}]},"3":{"line":58,"type":"if","locations":[{"start":{"line":58,"column":18},"end":{"line":58,"column":18}},{"start":{"line":58,"column":18},"end":{"line":58,"column":18}}]},"4":{"line":63,"type":"if","locations":[{"start":{"line":63,"column":18},"end":{"line":63,"column":18}},{"start":{"line":63,"column":18},"end":{"line":63,"column":18}}]},"5":{"line":63,"type":"binary-expr","locations":[{"start":{"line":63,"column":22},"end":{"line":63,"column":38}},{"start":{"line":63,"column":42},"end":{"line":63,"column":66}}]},"6":{"line":101,"type":"if","locations":[{"start":{"line":101,"column":6},"end":{"line":101,"column":6}},{"start":{"line":101,"column":6},"end":{"line":101,"column":6}}]},"7":{"line":133,"type":"if","locations":[{"start":{"line":133,"column":4},"end":{"line":133,"column":4}},{"start":{"line":133,"column":4},"end":{"line":133,"column":4}}]},"8":{"line":138,"type":"if","locations":[{"start":{"line":138,"column":6},"end":{"line":138,"column":6}},{"start":{"line":138,"column":6},"end":{"line":138,"column":6}}]},"9":{"line":187,"type":"if","locations":[{"start":{"line":187,"column":4},"end":{"line":187,"column":4}},{"start":{"line":187,"column":4},"end":{"line":187,"column":4}}]},"10":{"line":193,"type":"if","locations":[{"start":{"line":193,"column":4},"end":{"line":193,"column":4}},{"start":{"line":193,"column":4},"end":{"line":193,"column":4}}]},"11":{"line":193,"type":"binary-expr","locations":[{"start":{"line":193,"column":8},"end":{"line":193,"column":38}},{"start":{"line":193,"column":42},"end":{"line":193,"column":77}},{"start":{"line":193,"column":81},"end":{"line":193,"column":105}}]},"12":{"line":196,"type":"if","locations":[{"start":{"line":196,"column":4},"end":{"line":196,"column":4}},{"start":{"line":196,"column":4},"end":{"line":196,"column":4}}]},"13":{"line":198,"type":"switch","locations":[{"start":{"line":199,"column":10},"end":{"line":204,"column":18}},{"start":{"line":205,"column":10},"end":{"line":216,"column":18}},{"start":{"line":217,"column":10},"end":{"line":219,"column":18}},{"start":{"line":220,"column":10},"end":{"line":224,"column":18}}]},"14":{"line":201,"type":"if","locations":[{"start":{"line":201,"column":12},"end":{"line":201,"column":12}},{"start":{"line":201,"column":12},"end":{"line":201,"column":12}}]},"15":{"line":208,"type":"if","locations":[{"start":{"line":208,"column":14},"end":{"line":208,"column":14}},{"start":{"line":208,"column":14},"end":{"line":208,"column":14}}]},"16":{"line":243,"type":"if","locations":[{"start":{"line":243,"column":4},"end":{"line":243,"column":4}},{"start":{"line":243,"column":4},"end":{"line":243,"column":4}}]},"17":{"line":243,"type":"binary-expr","locations":[{"start":{"line":243,"column":8},"end":{"line":243,"column":13}},{"start":{"line":243,"column":17},"end":{"line":243,"column":32}}]},"18":{"line":248,"type":"if","locations":[{"start":{"line":248,"column":4},"end":{"line":248,"column":4}},{"start":{"line":248,"column":4},"end":{"line":248,"column":4}}]},"19":{"line":248,"type":"binary-expr","locations":[{"start":{"line":248,"column":8},"end":{"line":248,"column":13}},{"start":{"line":248,"column":17},"end":{"line":248,"column":33}},{"start":{"line":248,"column":37},"end":{"line":248,"column":60}}]},"20":{"line":251,"type":"if","locations":[{"start":{"line":251,"column":4},"end":{"line":251,"column":4}},{"start":{"line":251,"column":4},"end":{"line":251,"column":4}}]},"21":{"line":251,"type":"binary-expr","locations":[{"start":{"line":251,"column":8},"end":{"line":251,"column":12}},{"start":{"line":251,"column":16},"end":{"line":251,"column":35}}]},"22":{"line":267,"type":"if","locations":[{"start":{"line":267,"column":4},"end":{"line":267,"column":4}},{"start":{"line":267,"column":4},"end":{"line":267,"column":4}}]},"23":{"line":267,"type":"binary-expr","locations":[{"start":{"line":267,"column":8},"end":{"line":267,"column":13}},{"start":{"line":267,"column":17},"end":{"line":267,"column":33}},{"start":{"line":267,"column":37},"end":{"line":267,"column":60}}]}}},"/Users/emmanuelnyachoke/Code/Mekom/con-tainer2sul/lib/docker.js":{"path":"/Users/emmanuelnyachoke/Code/Mekom/con-tainer2sul/lib/docker.js","s":{"1":7,"2":7,"3":7,"4":7,"5":6,"6":6,"7":6,"8":6,"9":6,"10":6,"11":6,"12":5,"13":4,"14":4,"15":4,"16":4,"17":4,"18":5,"19":1,"20":1,"21":2,"22":1,"23":1,"24":1,"25":1,"26":7},"b":{"1":[1,1]},"f":{"1":6,"2":6,"3":1},"fnMap":{"1":{"name":"(anonymous_1)","line":9,"loc":{"start":{"line":9,"column":14},"end":{"line":9,"column":34}}},"2":{"name":"(anonymous_2)","line":20,"loc":{"start":{"line":20,"column":8},"end":{"line":20,"column":11}}},"3":{"name":"(anonymous_3)","line":50,"loc":{"start":{"line":50,"column":13},"end":{"line":50,"column":16}}}},"statementMap":{"1":{"start":{"line":3,"column":0},"end":{"line":3,"column":39}},"2":{"start":{"line":4,"column":0},"end":{"line":4,"column":54}},"3":{"start":{"line":5,"column":0},"end":{"line":5,"column":46}},"4":{"start":{"line":6,"column":0},"end":{"line":6,"column":36}},"5":{"start":{"line":10,"column":4},"end":{"line":10,"column":47}},"6":{"start":{"line":12,"column":4},"end":{"line":12,"column":50}},"7":{"start":{"line":13,"column":4},"end":{"line":13,"column":52}},"8":{"start":{"line":14,"column":4},"end":{"line":14,"column":32}},"9":{"start":{"line":15,"column":4},"end":{"line":17,"column":7}},"10":{"start":{"line":21,"column":4},"end":{"line":47,"column":9}},"11":{"start":{"line":22,"column":6},"end":{"line":22,"column":26}},"12":{"start":{"line":24,"column":6},"end":{"line":32,"column":9}},"13":{"start":{"line":25,"column":8},"end":{"line":25,"column":63}},"14":{"start":{"line":27,"column":8},"end":{"line":31,"column":13}},"15":{"start":{"line":29,"column":12},"end":{"line":29,"column":99}},"16":{"start":{"line":29,"column":50},"end":{"line":29,"column":71}},"17":{"start":{"line":30,"column":12},"end":{"line":30,"column":22}},"18":{"start":{"line":34,"column":6},"end":{"line":37,"column":9}},"19":{"start":{"line":35,"column":8},"end":{"line":35,"column":82}},"20":{"start":{"line":36,"column":8},"end":{"line":36,"column":28}},"21":{"start":{"line":41,"column":8},"end":{"line":43,"column":9}},"22":{"start":{"line":42,"column":10},"end":{"line":42,"column":30}},"23":{"start":{"line":45,"column":8},"end":{"line":45,"column":48}},"24":{"start":{"line":46,"column":8},"end":{"line":46,"column":37}},"25":{"start":{"line":51,"column":4},"end":{"line":51,"column":40}},"26":{"start":{"line":55,"column":0},"end":{"line":55,"column":24}}},"branchMap":{"1":{"line":41,"type":"if","locations":[{"start":{"line":41,"column":8},"end":{"line":41,"column":8}},{"start":{"line":41,"column":8},"end":{"line":41,"column":8}}]}}},"/Users/emmanuelnyachoke/Code/Mekom/con-tainer2sul/lib/typedefs.js":{"path":"/Users/emmanuelnyachoke/Code/Mekom/con-tainer2sul/lib/typedefs.js","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}} \ No newline at end of file +{"/Users/emmanuelnyachoke/Code/Mekom/con-tainer2sul/lib/consul/catalog.js":{"path":"/Users/emmanuelnyachoke/Code/Mekom/con-tainer2sul/lib/consul/catalog.js","s":{"1":3,"2":1,"3":1,"4":1},"b":{},"f":{"1":3,"2":1,"3":1},"fnMap":{"1":{"name":"(anonymous_1)","line":4,"loc":{"start":{"line":4,"column":14},"end":{"line":4,"column":23}}},"2":{"name":"(anonymous_2)","line":8,"loc":{"start":{"line":8,"column":11},"end":{"line":8,"column":18}}},"3":{"name":"(anonymous_3)","line":12,"loc":{"start":{"line":12,"column":13},"end":{"line":12,"column":20}}}},"statementMap":{"1":{"start":{"line":5,"column":4},"end":{"line":5,"column":25}},"2":{"start":{"line":9,"column":4},"end":{"line":9,"column":58}},"3":{"start":{"line":13,"column":4},"end":{"line":13,"column":60}},"4":{"start":{"line":17,"column":0},"end":{"line":17,"column":25}}},"branchMap":{}},"/Users/emmanuelnyachoke/Code/Mekom/con-tainer2sul/lib/consul/kv.js":{"path":"/Users/emmanuelnyachoke/Code/Mekom/con-tainer2sul/lib/consul/kv.js","s":{"1":5,"2":1,"3":1,"4":1,"5":1,"6":1,"7":0,"8":1,"9":1},"b":{"1":[0,1]},"f":{"1":5,"2":1,"3":1,"4":1,"5":1},"fnMap":{"1":{"name":"(anonymous_1)","line":4,"loc":{"start":{"line":4,"column":14},"end":{"line":4,"column":23}}},"2":{"name":"(anonymous_2)","line":8,"loc":{"start":{"line":8,"column":7},"end":{"line":8,"column":16}}},"3":{"name":"(anonymous_3)","line":12,"loc":{"start":{"line":12,"column":6},"end":{"line":12,"column":19}}},"4":{"name":"(anonymous_4)","line":16,"loc":{"start":{"line":16,"column":6},"end":{"line":16,"column":12}}},"5":{"name":"(anonymous_5)","line":20,"loc":{"start":{"line":20,"column":9},"end":{"line":20,"column":24}}}},"statementMap":{"1":{"start":{"line":5,"column":4},"end":{"line":5,"column":25}},"2":{"start":{"line":9,"column":4},"end":{"line":9,"column":53}},"3":{"start":{"line":13,"column":4},"end":{"line":13,"column":52}},"4":{"start":{"line":17,"column":4},"end":{"line":17,"column":49}},"5":{"start":{"line":21,"column":4},"end":{"line":21,"column":30}},"6":{"start":{"line":23,"column":4},"end":{"line":25,"column":5}},"7":{"start":{"line":24,"column":6},"end":{"line":24,"column":24}},"8":{"start":{"line":27,"column":4},"end":{"line":27,"column":36}},"9":{"start":{"line":31,"column":0},"end":{"line":31,"column":20}}},"branchMap":{"1":{"line":23,"type":"if","locations":[{"start":{"line":23,"column":4},"end":{"line":23,"column":4}},{"start":{"line":23,"column":4},"end":{"line":23,"column":4}}]}}},"/Users/emmanuelnyachoke/Code/Mekom/con-tainer2sul/lib/errors/skipError.js":{"path":"/Users/emmanuelnyachoke/Code/Mekom/con-tainer2sul/lib/errors/skipError.js","s":{"1":1,"2":1},"b":{},"f":{"1":1},"fnMap":{"1":{"name":"(anonymous_1)","line":4,"loc":{"start":{"line":4,"column":14},"end":{"line":4,"column":20}}}},"statementMap":{"1":{"start":{"line":5,"column":4},"end":{"line":5,"column":15}},"2":{"start":{"line":9,"column":0},"end":{"line":9,"column":27}}},"branchMap":{}},"/Users/emmanuelnyachoke/Code/Mekom/con-tainer2sul/lib/consul/index.js":{"path":"/Users/emmanuelnyachoke/Code/Mekom/con-tainer2sul/lib/consul/index.js","s":{"1":1,"2":1,"3":1,"4":6,"5":6,"6":6,"7":6,"8":2,"9":2,"10":2,"11":2,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":2,"20":1,"21":2,"22":1,"23":2,"24":1,"25":2,"26":1,"27":1,"28":1,"29":1},"b":{"1":[6,6],"2":[2,0],"3":[1,1],"4":[0,0],"5":[1,1],"6":[1,1]},"f":{"1":6,"2":2,"3":1,"4":2,"5":1,"6":1,"7":1},"fnMap":{"1":{"name":"(anonymous_1)","line":7,"loc":{"start":{"line":7,"column":13},"end":{"line":7,"column":22}}},"2":{"name":"(anonymous_2)","line":15,"loc":{"start":{"line":15,"column":7},"end":{"line":15,"column":27}}},"3":{"name":"(anonymous_3)","line":48,"loc":{"start":{"line":48,"column":6},"end":{"line":48,"column":12}}},"4":{"name":"(anonymous_4)","line":62,"loc":{"start":{"line":62,"column":6},"end":{"line":62,"column":18}}},"5":{"name":"(anonymous_5)","line":70,"loc":{"start":{"line":70,"column":9},"end":{"line":70,"column":15}}},"6":{"name":"(anonymous_6)","line":74,"loc":{"start":{"line":74,"column":13},"end":{"line":74,"column":16}}},"7":{"name":"(anonymous_7)","line":78,"loc":{"start":{"line":78,"column":8},"end":{"line":78,"column":11}}}},"statementMap":{"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":31}},"2":{"start":{"line":3,"column":0},"end":{"line":3,"column":37}},"3":{"start":{"line":4,"column":0},"end":{"line":4,"column":27}},"4":{"start":{"line":8,"column":4},"end":{"line":8,"column":28}},"5":{"start":{"line":9,"column":4},"end":{"line":9,"column":28}},"6":{"start":{"line":11,"column":4},"end":{"line":11,"column":26}},"7":{"start":{"line":12,"column":4},"end":{"line":12,"column":33}},"8":{"start":{"line":16,"column":4},"end":{"line":19,"column":5}},"9":{"start":{"line":17,"column":6},"end":{"line":17,"column":47}},"10":{"start":{"line":18,"column":6},"end":{"line":18,"column":33}},"11":{"start":{"line":20,"column":4},"end":{"line":40,"column":6}},"12":{"start":{"line":26,"column":10},"end":{"line":26,"column":19}},"13":{"start":{"line":27,"column":10},"end":{"line":29,"column":11}},"14":{"start":{"line":28,"column":12},"end":{"line":28,"column":22}},"15":{"start":{"line":30,"column":10},"end":{"line":36,"column":11}},"16":{"start":{"line":31,"column":12},"end":{"line":31,"column":36}},"17":{"start":{"line":33,"column":12},"end":{"line":35,"column":14}},"18":{"start":{"line":37,"column":10},"end":{"line":37,"column":22}},"19":{"start":{"line":42,"column":4},"end":{"line":44,"column":5}},"20":{"start":{"line":43,"column":6},"end":{"line":43,"column":26}},"21":{"start":{"line":45,"column":4},"end":{"line":45,"column":26}},"22":{"start":{"line":49,"column":4},"end":{"line":49,"column":34}},"23":{"start":{"line":63,"column":4},"end":{"line":65,"column":5}},"24":{"start":{"line":64,"column":6},"end":{"line":64,"column":32}},"25":{"start":{"line":67,"column":4},"end":{"line":67,"column":40}},"26":{"start":{"line":71,"column":4},"end":{"line":71,"column":37}},"27":{"start":{"line":75,"column":4},"end":{"line":75,"column":29}},"28":{"start":{"line":79,"column":4},"end":{"line":79,"column":24}},"29":{"start":{"line":83,"column":0},"end":{"line":83,"column":24}}},"branchMap":{"1":{"line":12,"type":"binary-expr","locations":[{"start":{"line":12,"column":14},"end":{"line":12,"column":23}},{"start":{"line":12,"column":27},"end":{"line":12,"column":32}}]},"2":{"line":16,"type":"if","locations":[{"start":{"line":16,"column":4},"end":{"line":16,"column":4}},{"start":{"line":16,"column":4},"end":{"line":16,"column":4}}]},"3":{"line":17,"type":"cond-expr","locations":[{"start":{"line":17,"column":37},"end":{"line":17,"column":40}},{"start":{"line":17,"column":43},"end":{"line":17,"column":46}}]},"4":{"line":27,"type":"if","locations":[{"start":{"line":27,"column":10},"end":{"line":27,"column":10}},{"start":{"line":27,"column":10},"end":{"line":27,"column":10}}]},"5":{"line":42,"type":"if","locations":[{"start":{"line":42,"column":4},"end":{"line":42,"column":4}},{"start":{"line":42,"column":4},"end":{"line":42,"column":4}}]},"6":{"line":63,"type":"if","locations":[{"start":{"line":63,"column":4},"end":{"line":63,"column":4}},{"start":{"line":63,"column":4},"end":{"line":63,"column":4}}]}}},"/Users/emmanuelnyachoke/Code/Mekom/con-tainer2sul/lib/container-to-consul.js":{"path":"/Users/emmanuelnyachoke/Code/Mekom/con-tainer2sul/lib/container-to-consul.js","s":{"1":22,"2":22,"3":22,"4":22,"5":22,"6":22,"7":21,"8":21,"9":21,"10":21,"11":21,"12":25,"13":2,"14":1,"15":1,"16":1,"17":25,"18":2,"19":1,"20":1,"21":1,"22":5,"23":5,"24":2,"25":1,"26":1,"27":4,"28":6,"29":6,"30":1,"31":1,"32":5,"33":4,"34":1,"35":1,"36":3,"37":3,"38":2,"39":2,"40":1,"41":2,"42":4,"43":4,"44":4,"45":2,"46":1,"47":1,"48":1,"49":2,"50":2,"51":2,"52":1,"53":1,"54":1,"55":1,"56":2,"57":2,"58":2,"59":0,"60":0,"61":0,"62":0,"63":0,"64":2,"65":2,"66":1,"67":1,"68":1,"69":1,"70":3,"71":3,"72":3,"73":3,"74":3,"75":3,"76":0,"77":3,"78":3,"79":10,"80":2,"81":2,"82":1,"83":2,"84":2,"85":2,"86":2,"87":1,"88":0,"89":2,"90":1,"91":1,"92":1,"93":2,"94":1,"95":1,"96":1,"97":3,"98":3,"99":3,"100":3,"101":1,"102":3,"103":3,"104":1,"105":3,"106":2,"107":3,"108":3,"109":5,"110":5,"111":1,"112":5,"113":22},"b":{"1":[1,1],"2":[2,1],"3":[1,0],"4":[4,1],"5":[5,4],"6":[1,1],"7":[2,0],"8":[0,0],"9":[3,0],"10":[0,3],"11":[3,3,3],"12":[3,0],"13":[2,2,1,1,1],"14":[1,1],"15":[1,1],"16":[1,2],"17":[3,1],"18":[1,2],"19":[3,2,1],"20":[2,1],"21":[3,2],"22":[1,4],"23":[5,3,1]},"f":{"1":21,"2":25,"3":5,"4":1,"5":4,"6":2,"7":2,"8":3,"9":3,"10":5},"fnMap":{"1":{"name":"(anonymous_1)","line":11,"loc":{"start":{"line":11,"column":13},"end":{"line":11,"column":22}}},"2":{"name":"(anonymous_2)","line":21,"loc":{"start":{"line":21,"column":15},"end":{"line":21,"column":18}}},"3":{"name":"(anonymous_3)","line":42,"loc":{"start":{"line":42,"column":7},"end":{"line":42,"column":10}}},"4":{"name":"(anonymous_4)","line":86,"loc":{"start":{"line":86,"column":20},"end":{"line":86,"column":33}}},"5":{"name":"(anonymous_5)","line":95,"loc":{"start":{"line":95,"column":19},"end":{"line":95,"column":31}}},"6":{"name":"(anonymous_6)","line":128,"loc":{"start":{"line":128,"column":21},"end":{"line":128,"column":33}}},"7":{"name":"(anonymous_7)","line":157,"loc":{"start":{"line":157,"column":19},"end":{"line":157,"column":29}}},"8":{"name":"(anonymous_8)","line":175,"loc":{"start":{"line":175,"column":19},"end":{"line":175,"column":31}}},"9":{"name":"(anonymous_9)","line":247,"loc":{"start":{"line":247,"column":22},"end":{"line":247,"column":34}}},"10":{"name":"(anonymous_10)","line":272,"loc":{"start":{"line":272,"column":18},"end":{"line":272,"column":30}}}},"statementMap":{"1":{"start":{"line":3,"column":0},"end":{"line":3,"column":33}},"2":{"start":{"line":4,"column":0},"end":{"line":4,"column":35}},"3":{"start":{"line":5,"column":0},"end":{"line":5,"column":35}},"4":{"start":{"line":6,"column":0},"end":{"line":6,"column":36}},"5":{"start":{"line":7,"column":0},"end":{"line":7,"column":48}},"6":{"start":{"line":8,"column":0},"end":{"line":8,"column":42}},"7":{"start":{"line":12,"column":4},"end":{"line":12,"column":25}},"8":{"start":{"line":14,"column":4},"end":{"line":14,"column":44}},"9":{"start":{"line":15,"column":4},"end":{"line":15,"column":35}},"10":{"start":{"line":16,"column":4},"end":{"line":16,"column":50}},"11":{"start":{"line":18,"column":4},"end":{"line":18,"column":25}},"12":{"start":{"line":22,"column":4},"end":{"line":30,"column":7}},"13":{"start":{"line":23,"column":6},"end":{"line":29,"column":11}},"14":{"start":{"line":25,"column":27},"end":{"line":25,"column":60}},"15":{"start":{"line":27,"column":10},"end":{"line":27,"column":32}},"16":{"start":{"line":28,"column":10},"end":{"line":28,"column":22}},"17":{"start":{"line":31,"column":4},"end":{"line":39,"column":7}},"18":{"start":{"line":32,"column":6},"end":{"line":38,"column":11}},"19":{"start":{"line":34,"column":27},"end":{"line":34,"column":87}},"20":{"start":{"line":36,"column":10},"end":{"line":36,"column":32}},"21":{"start":{"line":37,"column":10},"end":{"line":37,"column":22}},"22":{"start":{"line":43,"column":4},"end":{"line":78,"column":9}},"23":{"start":{"line":45,"column":18},"end":{"line":51,"column":10}},"24":{"start":{"line":47,"column":10},"end":{"line":49,"column":11}},"25":{"start":{"line":48,"column":12},"end":{"line":48,"column":22}},"26":{"start":{"line":50,"column":10},"end":{"line":50,"column":22}},"27":{"start":{"line":53,"column":8},"end":{"line":71,"column":12}},"28":{"start":{"line":54,"column":10},"end":{"line":70,"column":15}},"29":{"start":{"line":56,"column":14},"end":{"line":69,"column":19}},"30":{"start":{"line":59,"column":18},"end":{"line":61,"column":19}},"31":{"start":{"line":60,"column":20},"end":{"line":60,"column":55}},"32":{"start":{"line":64,"column":18},"end":{"line":66,"column":19}},"33":{"start":{"line":65,"column":20},"end":{"line":65,"column":55}},"34":{"start":{"line":67,"column":18},"end":{"line":67,"column":40}},"35":{"start":{"line":68,"column":18},"end":{"line":68,"column":30}},"36":{"start":{"line":73,"column":18},"end":{"line":73,"column":42}},"37":{"start":{"line":74,"column":26},"end":{"line":74,"column":61}},"38":{"start":{"line":76,"column":8},"end":{"line":76,"column":30}},"39":{"start":{"line":77,"column":8},"end":{"line":77,"column":20}},"40":{"start":{"line":87,"column":4},"end":{"line":87,"column":87}},"41":{"start":{"line":87,"column":51},"end":{"line":87,"column":84}},"42":{"start":{"line":96,"column":4},"end":{"line":96,"column":16}},"43":{"start":{"line":98,"column":4},"end":{"line":108,"column":5}},"44":{"start":{"line":99,"column":6},"end":{"line":99,"column":50}},"45":{"start":{"line":102,"column":6},"end":{"line":105,"column":7}},"46":{"start":{"line":103,"column":8},"end":{"line":103,"column":33}},"47":{"start":{"line":104,"column":8},"end":{"line":104,"column":33}},"48":{"start":{"line":107,"column":6},"end":{"line":107,"column":31}},"49":{"start":{"line":110,"column":4},"end":{"line":110,"column":52}},"50":{"start":{"line":112,"column":4},"end":{"line":119,"column":9}},"51":{"start":{"line":113,"column":18},"end":{"line":113,"column":55}},"52":{"start":{"line":114,"column":18},"end":{"line":114,"column":112}},"53":{"start":{"line":116,"column":8},"end":{"line":116,"column":88}},"54":{"start":{"line":117,"column":8},"end":{"line":117,"column":30}},"55":{"start":{"line":118,"column":8},"end":{"line":118,"column":20}},"56":{"start":{"line":129,"column":4},"end":{"line":132,"column":57}},"57":{"start":{"line":134,"column":4},"end":{"line":136,"column":5}},"58":{"start":{"line":135,"column":6},"end":{"line":135,"column":31}},"59":{"start":{"line":138,"column":4},"end":{"line":146,"column":7}},"60":{"start":{"line":139,"column":6},"end":{"line":145,"column":7}},"61":{"start":{"line":140,"column":8},"end":{"line":142,"column":28}},"62":{"start":{"line":144,"column":8},"end":{"line":144,"column":81}},"63":{"start":{"line":148,"column":4},"end":{"line":148,"column":33}},"64":{"start":{"line":158,"column":4},"end":{"line":158,"column":54}},"65":{"start":{"line":160,"column":4},"end":{"line":166,"column":9}},"66":{"start":{"line":161,"column":18},"end":{"line":161,"column":72}},"67":{"start":{"line":162,"column":18},"end":{"line":162,"column":68}},"68":{"start":{"line":164,"column":8},"end":{"line":164,"column":30}},"69":{"start":{"line":165,"column":8},"end":{"line":165,"column":20}},"70":{"start":{"line":176,"column":4},"end":{"line":185,"column":6}},"71":{"start":{"line":186,"column":4},"end":{"line":189,"column":17}},"72":{"start":{"line":191,"column":4},"end":{"line":193,"column":5}},"73":{"start":{"line":192,"column":6},"end":{"line":192,"column":43}},"74":{"start":{"line":195,"column":4},"end":{"line":195,"column":50}},"75":{"start":{"line":197,"column":4},"end":{"line":199,"column":5}},"76":{"start":{"line":198,"column":6},"end":{"line":198,"column":87}},"77":{"start":{"line":200,"column":4},"end":{"line":234,"column":5}},"78":{"start":{"line":201,"column":6},"end":{"line":233,"column":9}},"79":{"start":{"line":202,"column":8},"end":{"line":232,"column":9}},"80":{"start":{"line":204,"column":12},"end":{"line":204,"column":42}},"81":{"start":{"line":205,"column":12},"end":{"line":207,"column":13}},"82":{"start":{"line":206,"column":14},"end":{"line":206,"column":52}},"83":{"start":{"line":208,"column":12},"end":{"line":208,"column":18}},"84":{"start":{"line":210,"column":12},"end":{"line":219,"column":13}},"85":{"start":{"line":211,"column":14},"end":{"line":211,"column":59}},"86":{"start":{"line":212,"column":14},"end":{"line":214,"column":15}},"87":{"start":{"line":213,"column":16},"end":{"line":213,"column":44}},"88":{"start":{"line":218,"column":14},"end":{"line":218,"column":32}},"89":{"start":{"line":220,"column":12},"end":{"line":220,"column":18}},"90":{"start":{"line":222,"column":12},"end":{"line":222,"column":50}},"91":{"start":{"line":223,"column":12},"end":{"line":223,"column":18}},"92":{"start":{"line":225,"column":12},"end":{"line":227,"column":38}},"93":{"start":{"line":227,"column":26},"end":{"line":227,"column":36}},"94":{"start":{"line":228,"column":12},"end":{"line":228,"column":18}},"95":{"start":{"line":230,"column":12},"end":{"line":230,"column":54}},"96":{"start":{"line":231,"column":12},"end":{"line":231,"column":18}},"97":{"start":{"line":236,"column":4},"end":{"line":236,"column":39}},"98":{"start":{"line":238,"column":4},"end":{"line":238,"column":19}},"99":{"start":{"line":248,"column":4},"end":{"line":248,"column":30}},"100":{"start":{"line":250,"column":4},"end":{"line":252,"column":5}},"101":{"start":{"line":251,"column":6},"end":{"line":251,"column":32}},"102":{"start":{"line":254,"column":4},"end":{"line":254,"column":32}},"103":{"start":{"line":255,"column":4},"end":{"line":257,"column":5}},"104":{"start":{"line":256,"column":6},"end":{"line":256,"column":37}},"105":{"start":{"line":258,"column":4},"end":{"line":260,"column":5}},"106":{"start":{"line":259,"column":6},"end":{"line":259,"column":33}},"107":{"start":{"line":261,"column":4},"end":{"line":261,"column":35}},"108":{"start":{"line":263,"column":4},"end":{"line":263,"column":16}},"109":{"start":{"line":273,"column":4},"end":{"line":273,"column":32}},"110":{"start":{"line":274,"column":4},"end":{"line":276,"column":5}},"111":{"start":{"line":275,"column":6},"end":{"line":275,"column":37}},"112":{"start":{"line":277,"column":4},"end":{"line":277,"column":16}},"113":{"start":{"line":282,"column":0},"end":{"line":282,"column":35}}},"branchMap":{"1":{"line":47,"type":"if","locations":[{"start":{"line":47,"column":10},"end":{"line":47,"column":10}},{"start":{"line":47,"column":10},"end":{"line":47,"column":10}}]},"2":{"line":47,"type":"binary-expr","locations":[{"start":{"line":47,"column":14},"end":{"line":47,"column":30}},{"start":{"line":47,"column":34},"end":{"line":47,"column":58}}]},"3":{"line":59,"type":"if","locations":[{"start":{"line":59,"column":18},"end":{"line":59,"column":18}},{"start":{"line":59,"column":18},"end":{"line":59,"column":18}}]},"4":{"line":64,"type":"if","locations":[{"start":{"line":64,"column":18},"end":{"line":64,"column":18}},{"start":{"line":64,"column":18},"end":{"line":64,"column":18}}]},"5":{"line":64,"type":"binary-expr","locations":[{"start":{"line":64,"column":22},"end":{"line":64,"column":38}},{"start":{"line":64,"column":42},"end":{"line":64,"column":66}}]},"6":{"line":102,"type":"if","locations":[{"start":{"line":102,"column":6},"end":{"line":102,"column":6}},{"start":{"line":102,"column":6},"end":{"line":102,"column":6}}]},"7":{"line":134,"type":"if","locations":[{"start":{"line":134,"column":4},"end":{"line":134,"column":4}},{"start":{"line":134,"column":4},"end":{"line":134,"column":4}}]},"8":{"line":139,"type":"if","locations":[{"start":{"line":139,"column":6},"end":{"line":139,"column":6}},{"start":{"line":139,"column":6},"end":{"line":139,"column":6}}]},"9":{"line":191,"type":"if","locations":[{"start":{"line":191,"column":4},"end":{"line":191,"column":4}},{"start":{"line":191,"column":4},"end":{"line":191,"column":4}}]},"10":{"line":197,"type":"if","locations":[{"start":{"line":197,"column":4},"end":{"line":197,"column":4}},{"start":{"line":197,"column":4},"end":{"line":197,"column":4}}]},"11":{"line":197,"type":"binary-expr","locations":[{"start":{"line":197,"column":8},"end":{"line":197,"column":38}},{"start":{"line":197,"column":42},"end":{"line":197,"column":77}},{"start":{"line":197,"column":81},"end":{"line":197,"column":105}}]},"12":{"line":200,"type":"if","locations":[{"start":{"line":200,"column":4},"end":{"line":200,"column":4}},{"start":{"line":200,"column":4},"end":{"line":200,"column":4}}]},"13":{"line":202,"type":"switch","locations":[{"start":{"line":203,"column":10},"end":{"line":208,"column":18}},{"start":{"line":209,"column":10},"end":{"line":220,"column":18}},{"start":{"line":221,"column":10},"end":{"line":223,"column":18}},{"start":{"line":224,"column":10},"end":{"line":228,"column":18}},{"start":{"line":229,"column":10},"end":{"line":231,"column":18}}]},"14":{"line":205,"type":"if","locations":[{"start":{"line":205,"column":12},"end":{"line":205,"column":12}},{"start":{"line":205,"column":12},"end":{"line":205,"column":12}}]},"15":{"line":212,"type":"if","locations":[{"start":{"line":212,"column":14},"end":{"line":212,"column":14}},{"start":{"line":212,"column":14},"end":{"line":212,"column":14}}]},"16":{"line":250,"type":"if","locations":[{"start":{"line":250,"column":4},"end":{"line":250,"column":4}},{"start":{"line":250,"column":4},"end":{"line":250,"column":4}}]},"17":{"line":250,"type":"binary-expr","locations":[{"start":{"line":250,"column":8},"end":{"line":250,"column":13}},{"start":{"line":250,"column":17},"end":{"line":250,"column":32}}]},"18":{"line":255,"type":"if","locations":[{"start":{"line":255,"column":4},"end":{"line":255,"column":4}},{"start":{"line":255,"column":4},"end":{"line":255,"column":4}}]},"19":{"line":255,"type":"binary-expr","locations":[{"start":{"line":255,"column":8},"end":{"line":255,"column":13}},{"start":{"line":255,"column":17},"end":{"line":255,"column":33}},{"start":{"line":255,"column":37},"end":{"line":255,"column":60}}]},"20":{"line":258,"type":"if","locations":[{"start":{"line":258,"column":4},"end":{"line":258,"column":4}},{"start":{"line":258,"column":4},"end":{"line":258,"column":4}}]},"21":{"line":258,"type":"binary-expr","locations":[{"start":{"line":258,"column":8},"end":{"line":258,"column":12}},{"start":{"line":258,"column":16},"end":{"line":258,"column":35}}]},"22":{"line":274,"type":"if","locations":[{"start":{"line":274,"column":4},"end":{"line":274,"column":4}},{"start":{"line":274,"column":4},"end":{"line":274,"column":4}}]},"23":{"line":274,"type":"binary-expr","locations":[{"start":{"line":274,"column":8},"end":{"line":274,"column":13}},{"start":{"line":274,"column":17},"end":{"line":274,"column":33}},{"start":{"line":274,"column":37},"end":{"line":274,"column":60}}]}}},"/Users/emmanuelnyachoke/Code/Mekom/con-tainer2sul/lib/parse-key-pair.js":{"path":"/Users/emmanuelnyachoke/Code/Mekom/con-tainer2sul/lib/parse-key-pair.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":0,"9":1,"10":0,"11":1,"12":0,"13":1,"14":0,"15":1,"16":0,"17":1,"18":0,"19":1,"20":1,"21":0,"22":1,"23":1,"24":1},"b":{"1":[1,0],"2":[1,1],"3":[1,0],"4":[0,1],"5":[0,1],"6":[0,1],"7":[0,1],"8":[0,1],"9":[1,0],"10":[0,1]},"f":{"1":1,"2":1},"fnMap":{"1":{"name":"parser","line":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}},"2":{"name":"(anonymous_2)","line":29,"loc":{"start":{"line":29,"column":17},"end":{"line":29,"column":43}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":27,"column":1}},"2":{"start":{"line":3,"column":2},"end":{"line":3,"column":161}},"3":{"start":{"line":4,"column":2},"end":{"line":26,"column":3}},"4":{"start":{"line":5,"column":4},"end":{"line":5,"column":71}},"5":{"start":{"line":6,"column":4},"end":{"line":22,"column":5}},"6":{"start":{"line":7,"column":6},"end":{"line":7,"column":76}},"7":{"start":{"line":9,"column":6},"end":{"line":19,"column":7}},"8":{"start":{"line":10,"column":8},"end":{"line":10,"column":39}},"9":{"start":{"line":11,"column":13},"end":{"line":19,"column":7}},"10":{"start":{"line":12,"column":8},"end":{"line":12,"column":33}},"11":{"start":{"line":13,"column":13},"end":{"line":19,"column":7}},"12":{"start":{"line":14,"column":8},"end":{"line":14,"column":28}},"13":{"start":{"line":15,"column":13},"end":{"line":19,"column":7}},"14":{"start":{"line":16,"column":8},"end":{"line":16,"column":29}},"15":{"start":{"line":18,"column":8},"end":{"line":18,"column":27}},"16":{"start":{"line":21,"column":6},"end":{"line":21,"column":44}},"17":{"start":{"line":23,"column":4},"end":{"line":25,"column":5}},"18":{"start":{"line":24,"column":6},"end":{"line":24,"column":33}},"19":{"start":{"line":29,"column":0},"end":{"line":38,"column":2}},"20":{"start":{"line":31,"column":2},"end":{"line":37,"column":3}},"21":{"start":{"line":32,"column":4},"end":{"line":32,"column":27}},"22":{"start":{"line":34,"column":4},"end":{"line":34,"column":16}},"23":{"start":{"line":35,"column":4},"end":{"line":35,"column":27}},"24":{"start":{"line":36,"column":4},"end":{"line":36,"column":18}}},"branchMap":{"1":{"line":4,"type":"if","locations":[{"start":{"line":4,"column":2},"end":{"line":4,"column":2}},{"start":{"line":4,"column":2},"end":{"line":4,"column":2}}]},"2":{"line":4,"type":"binary-expr","locations":[{"start":{"line":4,"column":6},"end":{"line":4,"column":12}},{"start":{"line":4,"column":16},"end":{"line":4,"column":25}}]},"3":{"line":6,"type":"if","locations":[{"start":{"line":6,"column":4},"end":{"line":6,"column":4}},{"start":{"line":6,"column":4},"end":{"line":6,"column":4}}]},"4":{"line":9,"type":"if","locations":[{"start":{"line":9,"column":6},"end":{"line":9,"column":6}},{"start":{"line":9,"column":6},"end":{"line":9,"column":6}}]},"5":{"line":11,"type":"if","locations":[{"start":{"line":11,"column":13},"end":{"line":11,"column":13}},{"start":{"line":11,"column":13},"end":{"line":11,"column":13}}]},"6":{"line":13,"type":"if","locations":[{"start":{"line":13,"column":13},"end":{"line":13,"column":13}},{"start":{"line":13,"column":13},"end":{"line":13,"column":13}}]},"7":{"line":15,"type":"if","locations":[{"start":{"line":15,"column":13},"end":{"line":15,"column":13}},{"start":{"line":15,"column":13},"end":{"line":15,"column":13}}]},"8":{"line":23,"type":"if","locations":[{"start":{"line":23,"column":4},"end":{"line":23,"column":4}},{"start":{"line":23,"column":4},"end":{"line":23,"column":4}}]},"9":{"line":23,"type":"binary-expr","locations":[{"start":{"line":23,"column":8},"end":{"line":23,"column":17}},{"start":{"line":23,"column":21},"end":{"line":23,"column":41}}]},"10":{"line":31,"type":"if","locations":[{"start":{"line":31,"column":2},"end":{"line":31,"column":2}},{"start":{"line":31,"column":2},"end":{"line":31,"column":2}}]}}},"/Users/emmanuelnyachoke/Code/Mekom/con-tainer2sul/lib/docker.js":{"path":"/Users/emmanuelnyachoke/Code/Mekom/con-tainer2sul/lib/docker.js","s":{"1":7,"2":7,"3":7,"4":7,"5":6,"6":6,"7":6,"8":6,"9":6,"10":6,"11":6,"12":5,"13":4,"14":4,"15":4,"16":4,"17":4,"18":5,"19":1,"20":1,"21":2,"22":1,"23":1,"24":1,"25":1,"26":7},"b":{"1":[1,1]},"f":{"1":6,"2":6,"3":1},"fnMap":{"1":{"name":"(anonymous_1)","line":9,"loc":{"start":{"line":9,"column":14},"end":{"line":9,"column":34}}},"2":{"name":"(anonymous_2)","line":20,"loc":{"start":{"line":20,"column":8},"end":{"line":20,"column":11}}},"3":{"name":"(anonymous_3)","line":50,"loc":{"start":{"line":50,"column":13},"end":{"line":50,"column":16}}}},"statementMap":{"1":{"start":{"line":3,"column":0},"end":{"line":3,"column":39}},"2":{"start":{"line":4,"column":0},"end":{"line":4,"column":54}},"3":{"start":{"line":5,"column":0},"end":{"line":5,"column":46}},"4":{"start":{"line":6,"column":0},"end":{"line":6,"column":36}},"5":{"start":{"line":10,"column":4},"end":{"line":10,"column":47}},"6":{"start":{"line":12,"column":4},"end":{"line":12,"column":50}},"7":{"start":{"line":13,"column":4},"end":{"line":13,"column":52}},"8":{"start":{"line":14,"column":4},"end":{"line":14,"column":32}},"9":{"start":{"line":15,"column":4},"end":{"line":17,"column":7}},"10":{"start":{"line":21,"column":4},"end":{"line":47,"column":9}},"11":{"start":{"line":22,"column":6},"end":{"line":22,"column":26}},"12":{"start":{"line":24,"column":6},"end":{"line":32,"column":9}},"13":{"start":{"line":25,"column":8},"end":{"line":25,"column":63}},"14":{"start":{"line":27,"column":8},"end":{"line":31,"column":13}},"15":{"start":{"line":29,"column":12},"end":{"line":29,"column":99}},"16":{"start":{"line":29,"column":50},"end":{"line":29,"column":71}},"17":{"start":{"line":30,"column":12},"end":{"line":30,"column":22}},"18":{"start":{"line":34,"column":6},"end":{"line":37,"column":9}},"19":{"start":{"line":35,"column":8},"end":{"line":35,"column":82}},"20":{"start":{"line":36,"column":8},"end":{"line":36,"column":28}},"21":{"start":{"line":41,"column":8},"end":{"line":43,"column":9}},"22":{"start":{"line":42,"column":10},"end":{"line":42,"column":30}},"23":{"start":{"line":45,"column":8},"end":{"line":45,"column":48}},"24":{"start":{"line":46,"column":8},"end":{"line":46,"column":37}},"25":{"start":{"line":51,"column":4},"end":{"line":51,"column":40}},"26":{"start":{"line":55,"column":0},"end":{"line":55,"column":24}}},"branchMap":{"1":{"line":41,"type":"if","locations":[{"start":{"line":41,"column":8},"end":{"line":41,"column":8}},{"start":{"line":41,"column":8},"end":{"line":41,"column":8}}]}}},"/Users/emmanuelnyachoke/Code/Mekom/con-tainer2sul/lib/typedefs.js":{"path":"/Users/emmanuelnyachoke/Code/Mekom/con-tainer2sul/lib/typedefs.js","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}} \ No newline at end of file diff --git a/coverage/lcov-report/index.html b/coverage/lcov-report/index.html index 749f73c..ad84d9f 100644 --- a/coverage/lcov-report/index.html +++ b/coverage/lcov-report/index.html @@ -20,24 +20,24 @@

- 92.7% + 89.37% Statements - 165/178 + 185/207
- 86.15% + 77.27% Branches - 56/65 + 68/88
100% Functions - 29/29 + 31/31
- 92.61% + 89.27% Lines - 163/176 + 183/205
@@ -60,28 +60,28 @@

lib/ -
- 94.85% - 129/136 - 86.79% - 46/53 +
+ 91.41% + 149/163 + 78.38% + 58/74 100% - 13/13 - 94.78% - 127/134 + 15/15 + 91.3% + 147/161 lib/consul/ -
- 85% - 34/40 - 83.33% - 10/12 +
+ 80.95% + 34/42 + 71.43% + 10/14 100% 15/15 - 85% - 34/40 + 80.95% + 34/42 @@ -103,7 +103,7 @@

diff --git a/coverage/lcov-report/lib/consul/catalog.js.html b/coverage/lcov-report/lib/consul/catalog.js.html index 9849ffa..95de3f9 100644 --- a/coverage/lcov-report/lib/consul/catalog.js.html +++ b/coverage/lcov-report/lib/consul/catalog.js.html @@ -97,7 +97,7 @@

diff --git a/coverage/lcov-report/lib/consul/index.html b/coverage/lcov-report/lib/consul/index.html index 2c9f7a6..50d5b0b 100644 --- a/coverage/lcov-report/lib/consul/index.html +++ b/coverage/lcov-report/lib/consul/index.html @@ -20,14 +20,14 @@

- 85% + 80.95% Statements - 34/40 + 34/42
- 83.33% + 71.43% Branches - 10/12 + 10/14
100% @@ -35,9 +35,9 @@

15/15

- 85% + 80.95% Lines - 34/40 + 34/42
@@ -72,16 +72,16 @@

- index.js -
- 81.48% - 22/27 - 90% - 9/10 + index.js +
+ 75.86% + 22/29 + 75% + 9/12 100% 7/7 - 81.48% - 22/27 + 75.86% + 22/29 @@ -103,7 +103,7 @@

diff --git a/coverage/lcov-report/lib/consul/index.js.html b/coverage/lcov-report/lib/consul/index.js.html index 92117ca..299c307 100644 --- a/coverage/lcov-report/lib/consul/index.js.html +++ b/coverage/lcov-report/lib/consul/index.js.html @@ -20,14 +20,14 @@

- 81.48% + 75.86% Statements - 22/27 + 22/29
- 90% + 75% Branches - 9/10 + 9/12
100% @@ -35,13 +35,13 @@

7/7

- 81.48% + 75.86% Lines - 22/27 + 22/29
-
+

-	
-	
-	
-	
-	
+	
+	
+	
+	
+	
-	
-	
+	
+	
@@ -84,6 +84,19 @@ 

+ + + + + + + + + + + + + @@ -103,7 +116,7 @@

diff --git a/coverage/lcov-report/lib/typedefs.js.html b/coverage/lcov-report/lib/typedefs.js.html index 7b2b278..75948b5 100644 --- a/coverage/lcov-report/lib/typedefs.js.html +++ b/coverage/lcov-report/lib/typedefs.js.html @@ -76,7 +76,7 @@

diff --git a/coverage/lcov.info b/coverage/lcov.info index 989d034..2782a21 100644 --- a/coverage/lcov.info +++ b/coverage/lcov.info @@ -64,11 +64,11 @@ TN: SF:/Users/emmanuelnyachoke/Code/Mekom/con-tainer2sul/lib/consul/index.js FN:7,(anonymous_1) FN:15,(anonymous_2) -FN:45,(anonymous_3) -FN:59,(anonymous_4) -FN:67,(anonymous_5) -FN:71,(anonymous_6) -FN:75,(anonymous_7) +FN:48,(anonymous_3) +FN:62,(anonymous_4) +FN:70,(anonymous_5) +FN:74,(anonymous_6) +FN:78,(anonymous_7) FNF:7 FNH:7 FNDA:6,(anonymous_1) @@ -93,19 +93,21 @@ DA:26,0 DA:27,0 DA:28,0 DA:30,0 -DA:34,0 -DA:39,2 -DA:40,1 +DA:31,0 +DA:33,0 +DA:37,0 DA:42,2 -DA:46,1 -DA:60,2 -DA:61,1 -DA:64,2 -DA:68,1 -DA:72,1 -DA:76,1 -DA:80,1 -LF:27 +DA:43,1 +DA:45,2 +DA:49,1 +DA:63,2 +DA:64,1 +DA:67,2 +DA:71,1 +DA:75,1 +DA:79,1 +DA:83,1 +LF:29 LH:22 BRDA:12,1,0,6 BRDA:12,1,1,6 @@ -113,25 +115,27 @@ BRDA:16,2,0,2 BRDA:16,2,1,0 BRDA:17,3,0,1 BRDA:17,3,1,1 -BRDA:39,4,0,1 -BRDA:39,4,1,1 -BRDA:60,5,0,1 -BRDA:60,5,1,1 -BRF:10 +BRDA:27,4,0,0 +BRDA:27,4,1,0 +BRDA:42,5,0,1 +BRDA:42,5,1,1 +BRDA:63,6,0,1 +BRDA:63,6,1,1 +BRF:12 BRH:9 end_of_record TN: SF:/Users/emmanuelnyachoke/Code/Mekom/con-tainer2sul/lib/container-to-consul.js -FN:10,(anonymous_1) -FN:20,(anonymous_2) -FN:41,(anonymous_3) -FN:85,(anonymous_4) -FN:94,(anonymous_5) -FN:127,(anonymous_6) -FN:156,(anonymous_7) -FN:174,(anonymous_8) -FN:240,(anonymous_9) -FN:265,(anonymous_10) +FN:11,(anonymous_1) +FN:21,(anonymous_2) +FN:42,(anonymous_3) +FN:86,(anonymous_4) +FN:95,(anonymous_5) +FN:128,(anonymous_6) +FN:157,(anonymous_7) +FN:175,(anonymous_8) +FN:247,(anonymous_9) +FN:272,(anonymous_10) FNF:10 FNH:10 FNDA:21,(anonymous_1) @@ -149,165 +153,226 @@ DA:4,22 DA:5,22 DA:6,22 DA:7,22 -DA:11,21 -DA:13,21 +DA:8,22 +DA:12,21 DA:14,21 DA:15,21 -DA:17,21 -DA:21,25 -DA:22,2 -DA:24,1 -DA:26,1 +DA:16,21 +DA:18,21 +DA:22,25 +DA:23,2 +DA:25,1 DA:27,1 -DA:30,25 -DA:31,2 -DA:33,1 -DA:35,1 +DA:28,1 +DA:31,25 +DA:32,2 +DA:34,1 DA:36,1 -DA:42,5 -DA:44,5 -DA:46,2 -DA:47,1 -DA:49,1 -DA:52,4 -DA:53,6 -DA:55,6 -DA:58,1 +DA:37,1 +DA:43,5 +DA:45,5 +DA:47,2 +DA:48,1 +DA:50,1 +DA:53,4 +DA:54,6 +DA:56,6 DA:59,1 -DA:63,5 -DA:64,4 -DA:66,1 +DA:60,1 +DA:64,5 +DA:65,4 DA:67,1 -DA:72,3 +DA:68,1 DA:73,3 -DA:75,2 +DA:74,3 DA:76,2 -DA:86,2 -DA:95,4 -DA:97,4 +DA:77,2 +DA:87,2 +DA:96,4 DA:98,4 -DA:101,2 -DA:102,1 +DA:99,4 +DA:102,2 DA:103,1 -DA:106,1 -DA:109,2 -DA:111,2 +DA:104,1 +DA:107,1 +DA:110,2 DA:112,2 -DA:113,1 -DA:115,1 +DA:113,2 +DA:114,1 DA:116,1 DA:117,1 -DA:128,2 -DA:133,2 +DA:118,1 +DA:129,2 DA:134,2 -DA:137,0 +DA:135,2 DA:138,0 DA:139,0 -DA:143,0 -DA:147,0 -DA:157,2 -DA:159,2 -DA:160,1 +DA:140,0 +DA:144,0 +DA:148,0 +DA:158,2 +DA:160,2 DA:161,1 -DA:163,1 +DA:162,1 DA:164,1 -DA:175,3 -DA:182,3 -DA:187,3 -DA:188,3 +DA:165,1 +DA:176,3 +DA:186,3 DA:191,3 -DA:193,3 -DA:194,0 -DA:196,3 +DA:192,3 +DA:195,3 DA:197,3 -DA:198,9 -DA:200,2 -DA:201,2 -DA:202,1 +DA:198,0 +DA:200,3 +DA:201,3 +DA:202,10 DA:204,2 -DA:206,2 -DA:207,2 +DA:205,2 +DA:206,1 DA:208,2 -DA:209,1 -DA:214,0 -DA:216,2 -DA:218,1 -DA:219,1 -DA:221,1 -DA:223,2 -DA:224,1 -DA:229,3 -DA:231,3 -DA:241,3 -DA:243,3 -DA:244,1 -DA:247,3 +DA:210,2 +DA:211,2 +DA:212,2 +DA:213,1 +DA:218,0 +DA:220,2 +DA:222,1 +DA:223,1 +DA:225,1 +DA:227,2 +DA:228,1 +DA:230,1 +DA:231,1 +DA:236,3 +DA:238,3 DA:248,3 -DA:249,1 -DA:251,3 -DA:252,2 +DA:250,3 +DA:251,1 DA:254,3 -DA:256,3 -DA:266,5 -DA:267,5 -DA:268,1 -DA:270,5 -DA:275,22 -LF:109 -LH:102 -BRDA:46,1,0,1 -BRDA:46,1,1,1 -BRDA:46,2,0,2 -BRDA:46,2,1,1 -BRDA:58,3,0,1 -BRDA:58,3,1,0 -BRDA:63,4,0,4 -BRDA:63,4,1,1 -BRDA:63,5,0,5 -BRDA:63,5,1,4 -BRDA:101,6,0,1 -BRDA:101,6,1,1 -BRDA:133,7,0,2 -BRDA:133,7,1,0 -BRDA:138,8,0,0 -BRDA:138,8,1,0 -BRDA:187,9,0,3 -BRDA:187,9,1,0 -BRDA:193,10,0,0 -BRDA:193,10,1,3 -BRDA:193,11,0,3 -BRDA:193,11,1,3 -BRDA:193,11,2,3 -BRDA:196,12,0,3 -BRDA:196,12,1,0 -BRDA:198,13,0,2 -BRDA:198,13,1,2 -BRDA:198,13,2,1 -BRDA:198,13,3,1 -BRDA:201,14,0,1 -BRDA:201,14,1,1 -BRDA:208,15,0,1 -BRDA:208,15,1,1 -BRDA:243,16,0,1 -BRDA:243,16,1,2 -BRDA:243,17,0,3 -BRDA:243,17,1,1 -BRDA:248,18,0,1 -BRDA:248,18,1,2 -BRDA:248,19,0,3 -BRDA:248,19,1,2 -BRDA:248,19,2,1 -BRDA:251,20,0,2 -BRDA:251,20,1,1 -BRDA:251,21,0,3 -BRDA:251,21,1,2 -BRDA:267,22,0,1 -BRDA:267,22,1,4 -BRDA:267,23,0,5 -BRDA:267,23,1,3 -BRDA:267,23,2,1 -BRF:51 -BRH:44 +DA:255,3 +DA:256,1 +DA:258,3 +DA:259,2 +DA:261,3 +DA:263,3 +DA:273,5 +DA:274,5 +DA:275,1 +DA:277,5 +DA:282,22 +LF:112 +LH:105 +BRDA:47,1,0,1 +BRDA:47,1,1,1 +BRDA:47,2,0,2 +BRDA:47,2,1,1 +BRDA:59,3,0,1 +BRDA:59,3,1,0 +BRDA:64,4,0,4 +BRDA:64,4,1,1 +BRDA:64,5,0,5 +BRDA:64,5,1,4 +BRDA:102,6,0,1 +BRDA:102,6,1,1 +BRDA:134,7,0,2 +BRDA:134,7,1,0 +BRDA:139,8,0,0 +BRDA:139,8,1,0 +BRDA:191,9,0,3 +BRDA:191,9,1,0 +BRDA:197,10,0,0 +BRDA:197,10,1,3 +BRDA:197,11,0,3 +BRDA:197,11,1,3 +BRDA:197,11,2,3 +BRDA:200,12,0,3 +BRDA:200,12,1,0 +BRDA:202,13,0,2 +BRDA:202,13,1,2 +BRDA:202,13,2,1 +BRDA:202,13,3,1 +BRDA:202,13,4,1 +BRDA:205,14,0,1 +BRDA:205,14,1,1 +BRDA:212,15,0,1 +BRDA:212,15,1,1 +BRDA:250,16,0,1 +BRDA:250,16,1,2 +BRDA:250,17,0,3 +BRDA:250,17,1,1 +BRDA:255,18,0,1 +BRDA:255,18,1,2 +BRDA:255,19,0,3 +BRDA:255,19,1,2 +BRDA:255,19,2,1 +BRDA:258,20,0,2 +BRDA:258,20,1,1 +BRDA:258,21,0,3 +BRDA:258,21,1,2 +BRDA:274,22,0,1 +BRDA:274,22,1,4 +BRDA:274,23,0,5 +BRDA:274,23,1,3 +BRDA:274,23,2,1 +BRF:52 +BRH:45 +end_of_record +TN: +SF:/Users/emmanuelnyachoke/Code/Mekom/con-tainer2sul/lib/parse-key-pair.js +FN:1,parser +FN:29,(anonymous_2) +FNF:2 +FNH:2 +FNDA:1,parser +FNDA:1,(anonymous_2) +DA:1,1 +DA:3,1 +DA:4,1 +DA:5,1 +DA:6,1 +DA:7,1 +DA:9,1 +DA:10,0 +DA:11,1 +DA:12,0 +DA:13,1 +DA:14,0 +DA:15,1 +DA:16,0 +DA:18,1 +DA:21,0 +DA:23,1 +DA:24,0 +DA:29,1 +DA:31,1 +DA:32,0 +DA:34,1 +DA:35,1 +DA:36,1 +LF:24 +LH:17 +BRDA:4,1,0,1 +BRDA:4,1,1,0 +BRDA:4,2,0,1 +BRDA:4,2,1,1 +BRDA:6,3,0,1 +BRDA:6,3,1,0 +BRDA:9,4,0,0 +BRDA:9,4,1,1 +BRDA:11,5,0,0 +BRDA:11,5,1,1 +BRDA:13,6,0,0 +BRDA:13,6,1,1 +BRDA:15,7,0,0 +BRDA:15,7,1,1 +BRDA:23,8,0,0 +BRDA:23,8,1,1 +BRDA:23,9,0,1 +BRDA:23,9,1,0 +BRDA:31,10,0,0 +BRDA:31,10,1,1 +BRF:20 +BRH:11 end_of_record TN: SF:/Users/emmanuelnyachoke/Code/Mekom/con-tainer2sul/lib/docker.js diff --git a/e2e/docker/test-compose.yaml b/e2e/docker/test-compose.yaml index 8a47eac..b294d22 100644 --- a/e2e/docker/test-compose.yaml +++ b/e2e/docker/test-compose.yaml @@ -8,6 +8,7 @@ services: - "consul.service=nginx-register" - "consul.ip=10.0.0.1" - "consul.register=true" + - "consul.meta=metrics_path='/metrics'" nginx2: image: nginx:1-alpine labels: @@ -15,5 +16,6 @@ services: - "consul.tags=nginx" - "consul.ip=10.0.0.1" - "consul.register=true" + - "consul.meta=metrics_path=/metrics" nginx-ignore: image: nginx:1-alpine \ No newline at end of file diff --git a/lib/consul/index.js b/lib/consul/index.js index eef1602..adad908 100644 --- a/lib/consul/index.js +++ b/lib/consul/index.js @@ -24,6 +24,9 @@ class Consul { transformResponse: [ (data) => { let resp; + if (!data) { + return {}; + } try { resp = JSON.parse(data); } catch (error) { diff --git a/lib/container-to-consul.js b/lib/container-to-consul.js index 8a6c8f7..ba533c7 100644 --- a/lib/container-to-consul.js +++ b/lib/container-to-consul.js @@ -5,6 +5,7 @@ const Consul = require('./consul'); const Docker = require('./docker'); const Promise = require('bluebird'); const SkipError = require('./errors/skipError'); +const parse = require('./parse-key-pair'); class ContainertoConsul { constructor(config) { @@ -43,7 +44,7 @@ class ContainertoConsul { // deregister containers that do not run .then(() => this.consul.kv.keys('docker/service-ids/') .catch(error => { - if (error.statusCode && error.statusCode === 404) { + if (error.response.status && error.response.status === 404) { return []; } throw error; @@ -73,7 +74,6 @@ class ContainertoConsul { .then(containers => this.registerContainers(containers)) .catch(error => { this.log.error(error); - throw error; }); } @@ -176,7 +176,10 @@ class ContainertoConsul { Node: this.containerServiceName(container), Address: this.docker.docker0, Service: { - Service: this.containerServiceName(container) + Service: this.containerServiceName(container), + Meta: { + redis_version: '4.0' + } } }; let containerIPAddress = container @@ -222,6 +225,9 @@ class ContainertoConsul { .split(',') .map(tag => tag.trim()); break; + case 'consul.meta': + service.Service.Meta = parse(lbls[label]); + break; } }); } diff --git a/lib/parse-key-pair.js b/lib/parse-key-pair.js new file mode 100644 index 0000000..e87c5df --- /dev/null +++ b/lib/parse-key-pair.js @@ -0,0 +1,38 @@ +function parser(string, results) { + 'use strict'; + const result = /((?:"[^"]+[^\\]")|(?:'[^']+[^\\]')|(?:[^=]+))\s*=\s*("(?:[\s\S]*?[^\\])"|'(?:[\s\S]*?[^\\])'|(?:.*?[^\\])|$)(?:;|$)(?:\s*(.*))?/m.exec(string); + if (result && result[1]) { + const key = result[1].trim().replace(/(^\s*["'])|(["']\s*$)/g, ''); + if (typeof result[2] === 'string') { + const val = result[2].replace(/(^\s*[\\]?["'])|([\\]?["']\s*$)/g, ''); + // const val = result[2]; + if (/^[0-9-.,]+$/.test(val)) { + results[key] = parseFloat(val); + } else if (val === '') { + results[key] = undefined; + } else if (val.toLowerCase() === 'true') { + results[key] = true; + } else if (val.toLowerCase() === 'false') { + results[key] = false; + } else { + results[key] = val; + } + } else { + results[result[1].trim()] = undefined; + } + if (result[3] && result[3].length > 1) { + parser(result[3], results); + } + } +} + +module.exports = function (string, object) { + 'use strict'; + if (object) { + parser(string, object); + } else { + object = {}; + parser(string, object); + return object; + } +}; \ No newline at end of file diff --git a/test/lib/container-to-consul.test.js b/test/lib/container-to-consul.test.js index f72136c..cba3ec3 100644 --- a/test/lib/container-to-consul.test.js +++ b/test/lib/container-to-consul.test.js @@ -420,6 +420,7 @@ describe('container-to-consul', () => { 'consul.port': '8888 consul port', 'consul.service': 'consul service', 'consul.tags': 'consul,tags', + 'consul.meta': 'key=value', 'consul.register': 'true' } }, @@ -436,6 +437,7 @@ describe('container-to-consul', () => { should(result.Service.Service).be.exactly('consul service'); should(result.Service.Port).be.exactly(8888); should(result.Service.Tags).match(['consul', 'tags']); + should(result.Service.Meta).match({key:'value'}); }); it('should not set the port if it does not manage to cast it to an int', () => {

1 2 @@ -122,7 +122,10 @@

77 78 79 -80

  +80 +81 +82 +83  @@ -152,6 +155,9 @@

      +  +  +        @@ -227,6 +233,9 @@

transformResponse: [ (data) => { let resp; + if (!data) { + return {}; + } try { resp = JSON.parse(data); } catch (error) { @@ -286,7 +295,7 @@

diff --git a/coverage/lcov-report/lib/consul/kv.js.html b/coverage/lcov-report/lib/consul/kv.js.html index 88aaf3b..6e1f1c7 100644 --- a/coverage/lcov-report/lib/consul/kv.js.html +++ b/coverage/lcov-report/lib/consul/kv.js.html @@ -139,7 +139,7 @@

diff --git a/coverage/lcov-report/lib/container-to-consul.js.html b/coverage/lcov-report/lib/container-to-consul.js.html index 1017754..1acc0e5 100644 --- a/coverage/lcov-report/lib/container-to-consul.js.html +++ b/coverage/lcov-report/lib/container-to-consul.js.html @@ -20,14 +20,14 @@

- 93.64% + 93.81% Statements - 103/110 + 106/113
- 86.27% + 86.54% Branches - 44/51 + 45/52
100% @@ -35,9 +35,9 @@

10/10

- 93.58% + 93.75% Lines - 102/109 + 105/112
@@ -318,13 +318,21 @@

273 274 275 -276

  +276 +277 +278 +279 +280 +281 +282 +283    22× 22× 22× 22× 22× +22×       @@ -499,6 +507,9 @@

      +  +  +      @@ -515,7 +526,7 @@

  - +10×   @@ -543,6 +554,9 @@

  + + +        @@ -600,6 +614,7 @@

const Docker = require('./docker'); const Promise = require('bluebird'); const SkipError = require('./errors/skipError'); +const parse = require('./parse-key-pair');   class ContainertoConsul { constructor(config) { @@ -771,7 +786,10 @@

Node: this.containerServiceName(container), Address: this.docker.docker0, Service: { - Service: this.containerServiceName(container) + Service: this.containerServiceName(container), + Meta: { + redis_version: '4.0' + } } }; let containerIPAddress = container @@ -817,6 +835,9 @@

.split(',') .map(tag => tag.trim()); break; + case 'consul.meta': + service.Service.Meta = parse(lbls[label]); + break; } }); } @@ -874,7 +895,7 @@

diff --git a/coverage/lcov-report/lib/docker.js.html b/coverage/lcov-report/lib/docker.js.html index 97e61f9..a67d4bf 100644 --- a/coverage/lcov-report/lib/docker.js.html +++ b/coverage/lcov-report/lib/docker.js.html @@ -214,7 +214,7 @@

diff --git a/coverage/lcov-report/lib/errors/index.html b/coverage/lcov-report/lib/errors/index.html index 2a0038d..3210d01 100644 --- a/coverage/lcov-report/lib/errors/index.html +++ b/coverage/lcov-report/lib/errors/index.html @@ -77,7 +77,7 @@

diff --git a/coverage/lcov-report/lib/errors/skipError.js.html b/coverage/lcov-report/lib/errors/skipError.js.html index 50dd2f3..70dbc6e 100644 --- a/coverage/lcov-report/lib/errors/skipError.js.html +++ b/coverage/lcov-report/lib/errors/skipError.js.html @@ -76,7 +76,7 @@

diff --git a/coverage/lcov-report/lib/index.html b/coverage/lcov-report/lib/index.html index 6afec62..75760c8 100644 --- a/coverage/lcov-report/lib/index.html +++ b/coverage/lcov-report/lib/index.html @@ -20,24 +20,24 @@

- 94.85% + 91.41% Statements - 129/136 + 149/163
- 86.79% + 78.38% Branches - 46/53 + 58/74
100% Functions - 13/13 + 15/15
- 94.78% + 91.3% Lines - 127/134 + 147/161
@@ -60,15 +60,15 @@

container-to-consul.js
93.64%103/11086.27%44/51
93.81%106/11386.54%45/52 100% 10/1093.58%102/10993.75%105/112
25/25
parse-key-pair.js
70.83%17/2455%11/20100%2/270.83%17/24
typedefs.js