diff --git a/src/apps.js b/src/apps.js index 133b79932..f2e80199e 100644 --- a/src/apps.js +++ b/src/apps.js @@ -428,10 +428,10 @@ function getByIpAddress(ip, callback) { assert.strictEqual(typeof ip, 'string'); assert.strictEqual(typeof callback, 'function'); - docker.getAppIdByContainerIp(ip, function (error, appId) { + docker.getContainerIdByIp(ip, function (error, containerId) { if (error) return callback(new AppsError(AppsError.INTERNAL_ERROR, error)); - appdb.get(appId, function (error, app) { + appdb.getByContainerId(containerId, function (error, app) { if (error && error.reason === DatabaseError.NOT_FOUND) return callback(new AppsError(AppsError.NOT_FOUND, 'No such app')); if (error) return callback(new AppsError(AppsError.INTERNAL_ERROR, error)); diff --git a/src/docker.js b/src/docker.js index bd21d7baf..118ffe234 100644 --- a/src/docker.js +++ b/src/docker.js @@ -14,7 +14,6 @@ exports = module.exports = { deleteContainers: deleteContainers, createSubcontainer: createSubcontainer, getContainerIdByIp: getContainerIdByIp, - getAppIdByContainerIp: getAppIdByContainerIp, inspect: inspect, inspectByName: inspect, execContainer: execContainer @@ -385,24 +384,6 @@ function getContainerIdByIp(ip, callback) { }); } -function getAppIdByContainerIp(ip, callback) { - assert.strictEqual(typeof ip, 'string'); - assert.strictEqual(typeof callback, 'function'); - - getContainerIdByIp(ip, function (error, containerId) { - if (error) return callback(error); - - inspect(containerId, function (error, result) { - if (error) return callback(error); - - var appId = result.Config.Labels.appId; - if (!appId) return callback(new Error('No app associated with this ip')); - - callback(null, appId); - }); - }); -} - function inspect(containerId, callback) { assert.strictEqual(typeof containerId, 'string'); assert.strictEqual(typeof callback, 'function'); diff --git a/src/dockerproxy.js b/src/dockerproxy.js index 69aa8362e..0838d8529 100644 --- a/src/dockerproxy.js +++ b/src/dockerproxy.js @@ -27,7 +27,6 @@ function authorizeApp(req, res, next) { // - block apps not using the docker addon // - block calls regarding platform containers // - only allow managing and inspection of containers belonging to the app - // - allow docker to be called from child containers spun of from an authorized app // make the tests pass for now if (config.TEST) {