Rework instance assigment process

Under the current system there's no distinction made on the slave side
between instance config files that are present in the filesystem and
instances actually assigned to the slave.  Which could lead to problems
with determing if an instance is actually assigned to the slave.

Resolve this issue by separating discovered instances with assigned
instances.  Upon startup discovered instances are put into the
discoveredInstanceInfos mapping on the Slave object and all of these are
sent to the master server.  The master server in turn sends assignment
requests for all the instances which are assigned to the slave.  These
are put into the instanceInfos mapping of the Slave object which can
then be relied up to include only assigned instances.
This commit is contained in:
Hornwitser committed 2020-11-17 04:34:49 +01:00
1 parent c78bf02ce4
commit 9d2ac2b81f
5 files changed
+142 -79

No files matched your search

+1 -2
View File
@@ -152,8 +152,7 @@ describe("Slave testing", function() {
it("should discover test instance", async function() {
let logger = { log: () => {}, error: () => {} };
let instancePath = path.join("test", "file", "instances");
let instanceInfos = new Map();
await slave._discoverInstances(instanceInfos, instancePath, logger);
let instanceInfos = await slave._discoverInstances(instancePath, logger);
let referenceConfig = new libConfig.InstanceConfig();
await referenceConfig.init();