Skip to content

Commit

Permalink
Fix service ids to include container UUIDs
Browse files Browse the repository at this point in the history
  • Loading branch information
chaseajen committed Dec 17, 2015
1 parent 398b012 commit 41c76c6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/consulWriter.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ function registerServices(consulHost, consulPort, services) {
var consul = require('consul')({ host: consulHost, port: consulPort });

// Enumerate the services
services.forEach(function (service) {// Register the service
services.forEach(function (service) {
// Register the service
consul.agent.service.register({
name: service.name,
id: service.id,
Expand Down
3 changes: 2 additions & 1 deletion src/tutumReader.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ function processResponseBody(body, callback) {
// Get both the private IP and the public DNS
var privateIp = container.private_ip;
var publicDns = container.public_dns;
var uuid = container.uuid;

// Enumerate the ports
var ports = container.container_ports;
Expand All @@ -48,7 +49,7 @@ function processResponseBody(body, callback) {

// Create the service object
var service = {
id: containerName + "-" + serviceName,
id: containerName + "-" + serviceName + "-" + uuid,
name: serviceName,
container: containerName,
published: published
Expand Down

0 comments on commit 41c76c6

Please sign in to comment.