Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

Commit

Permalink
Merge branch 'master' into update-to-lts-node-version
Browse files Browse the repository at this point in the history
  • Loading branch information
Fredrik Folkesson authored and Fredrik Folkesson committed Jun 25, 2018
2 parents 582f8e9 + 51e5c5d commit 66c9c49
Show file tree
Hide file tree
Showing 8 changed files with 2,371 additions and 1,799 deletions.
4,147 changes: 2,359 additions & 1,788 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -46,7 +46,7 @@
"cross-env": "5.2.0",
"dredd": "5.1.10",
"eslint": "5.0.0",
"eslint-config-airbnb-base": "12.1.0",
"eslint-config-airbnb-base": "13.0.0",
"eslint-plugin-import": "2.13.0",
"hooks": "0.3.2",
"mock-require": "3.0.2",
Expand Down
4 changes: 2 additions & 2 deletions src/Config.js
Expand Up @@ -30,8 +30,8 @@ class Config {
* @prop {string} discoveryLabel - Label used to discover Qlik Associative Engine instances.
* @static
*/
Config.discoveryLabel = process.env.MIRA_DISCOVERY_LABEL ?
process.env.MIRA_DISCOVERY_LABEL.trim() : defaultDiscoveryLabel;
Config.discoveryLabel = process.env.MIRA_DISCOVERY_LABEL
? process.env.MIRA_DISCOVERY_LABEL.trim() : defaultDiscoveryLabel;

/**
* @prop {number} defaultEngineAPIPort - The default port to use for communicating with the Qlik Associative Engine,
Expand Down
2 changes: 1 addition & 1 deletion src/Routes.js
@@ -1,7 +1,7 @@
const Router = require('koa-router');
const EngineDiscovery = require('./EngineDiscovery');
const getOrchestrationClient = require('./orchestration/getOrchestrationClient');
const Config = require('./Config');
const Router = require('koa-router');
const logger = require('./logger/Logger').get();


Expand Down
5 changes: 2 additions & 3 deletions src/index.js
Expand Up @@ -3,15 +3,14 @@ const swagger = require('swagger2');
const swagger2koa = require('swagger2-koa');
const Rollbar = require('rollbar');
const path = require('path');
const MetricsMiddleware = require('http-metrics-middleware');
const c2k = require('koa-connect');
const logger = require('./logger/Logger').get();
const version = require('../version');
const Config = require('./Config');

Config.init();

const MetricsMiddleware = require('http-metrics-middleware');
const c2k = require('koa-connect');

const metrics = new MetricsMiddleware({ timeBuckets: [0.01, 0.05, 0.1, 0.5, 1, 5] });
const router = require('./Routes');

Expand Down
6 changes: 4 additions & 2 deletions src/orchestration/SwarmDockerClient.js
Expand Up @@ -31,9 +31,11 @@ function findStatusIp(task, networks) {
if (!networks) {
logger.warn(`No network found for task: ${JSON.stringify(task)}`);
return undefined;
} else if (networks.length === 1) {
}
if (networks.length === 1) {
return networks[0].ip;
} else if (!Config.engineNetworks) {
}
if (!Config.engineNetworks) {
logger.warn(`Found multiple docker networks for task: ${JSON.stringify(task)}, but no network configured for environment variable MIRA_SWARM_ENGINE_NETWORKS`);
return undefined;
}
Expand Down
2 changes: 1 addition & 1 deletion test/component/kubernetes/component-kubernetes.spec.js
@@ -1,7 +1,7 @@
const nock = require('nock');
const request = require('supertest');
const specData = require('../../test-data/KubernetesClient.spec.data.json');
const sleep = require('../../test-utils/sleep');
const request = require('supertest');

process.env.MIRA_ENGINE_DISCOVERY_INTERVAL = 1000;
process.env.MIRA_ENGINE_UPDATE_INTERVAL = 1000;
Expand Down
2 changes: 1 addition & 1 deletion test/component/local/component-local-two-engines.spec.js
@@ -1,6 +1,6 @@
const nock = require('nock');
const specData = require('../../test-data/LocalDockerClient.spec.data.json');
const request = require('supertest');
const specData = require('../../test-data/LocalDockerClient.spec.data.json');
const sleep = require('../../test-utils/sleep');

process.env.DOCKER_HOST = 'http://localhost:8001';
Expand Down

0 comments on commit 66c9c49

Please sign in to comment.