Make the ldap test work

This commit is contained in:
Girish Ramakrishnan
2019-08-20 11:45:00 -07:00
parent 969cee7c90
commit 2a1b61107f
2 changed files with 14 additions and 2 deletions

View File

@@ -52,7 +52,8 @@ exports = module.exports = {
// exported for testing
_validatePortBindings: validatePortBindings,
_validateAccessRestriction: validateAccessRestriction,
_translatePortBindings: translatePortBindings
_translatePortBindings: translatePortBindings,
_MOCK_GET_BY_IP_APP_ID: ''
};
var appdb = require('./appdb.js'),
@@ -488,6 +489,8 @@ function getByIpAddress(ip, callback) {
assert.strictEqual(typeof ip, 'string');
assert.strictEqual(typeof callback, 'function');
if (constants.TEST) return get(exports._MOCK_GET_BY_IP_APP_ID, callback);
docker.getContainerIdByIp(ip, function (error, containerId) {
if (error) return callback(new AppsError(AppsError.INTERNAL_ERROR, error));