@kapeta/local-cluster-service 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/package.json +1 -1
- package/src/instanceManager.js +7 -3
- package/src/utils/BlockInstanceRunner.js +15 -1
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
## [0.2.1](https://github.com/kapetacom/local-cluster-service/compare/v0.2.0...v0.2.1) (2023-05-07)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* Missing semantic ([7173501](https://github.com/kapetacom/local-cluster-service/commit/7173501faf2a15caa373ef2f89c6e718deaa06f1))
|
7
|
+
|
1
8
|
# [0.2.0](https://github.com/kapetacom/local-cluster-service/compare/v0.1.2...v0.2.0) (2023-05-07)
|
2
9
|
|
3
10
|
|
package/package.json
CHANGED
package/src/instanceManager.js
CHANGED
@@ -193,6 +193,7 @@ class InstanceManager {
|
|
193
193
|
if (instance) {
|
194
194
|
instance.status = STATUS_STARTING;
|
195
195
|
instance.pid = info.pid;
|
196
|
+
instance.address = address;
|
196
197
|
if (info.type) {
|
197
198
|
instance.type = info.type;
|
198
199
|
}
|
@@ -207,7 +208,8 @@ class InstanceManager {
|
|
207
208
|
status: STATUS_STARTING,
|
208
209
|
pid: info.pid,
|
209
210
|
type: info.type,
|
210
|
-
health: healthUrl
|
211
|
+
health: healthUrl,
|
212
|
+
address
|
211
213
|
};
|
212
214
|
|
213
215
|
this._instances.push(instance);
|
@@ -385,7 +387,8 @@ class InstanceManager {
|
|
385
387
|
await this.registerInstance(planRef, instanceId, {
|
386
388
|
type: process.type,
|
387
389
|
pid: process.pid,
|
388
|
-
health: null
|
390
|
+
health: null,
|
391
|
+
portType: process.portType,
|
389
392
|
});
|
390
393
|
|
391
394
|
return this._processes[planRef][instanceId] = process;
|
@@ -402,7 +405,8 @@ class InstanceManager {
|
|
402
405
|
await this.registerInstance(planRef, instanceId, {
|
403
406
|
type: 'local',
|
404
407
|
pid: null,
|
405
|
-
health: null
|
408
|
+
health: null,
|
409
|
+
portType: DEFAULT_HEALTH_PORT_TYPE,
|
406
410
|
});
|
407
411
|
|
408
412
|
this._emit(instanceId, EVENT_INSTANCE_LOG, logs[0]);
|
@@ -114,11 +114,19 @@ class BlockInstanceRunner {
|
|
114
114
|
if (provider.definition.kind === KIND_BLOCK_TYPE_OPERATOR) {
|
115
115
|
processDetails = await this._startOperatorProcess(blockInstance, blockUri, provider, env);
|
116
116
|
} else {
|
117
|
+
//We need a port type to know how to connect to the block consistently
|
118
|
+
const portTypes = definition.definition?.spec?.providers.map(provider => {
|
119
|
+
return provider.spec?.port?.type
|
120
|
+
}).filter(t => !!t) ?? [];
|
117
121
|
if (blockUri.version === 'local') {
|
118
122
|
processDetails = await this._startLocalProcess(blockInstance, blockUri, env);
|
119
123
|
} else {
|
120
124
|
processDetails = await this._startDockerProcess(blockInstance, blockUri, env);
|
121
125
|
}
|
126
|
+
|
127
|
+
if (portTypes.length > 0) {
|
128
|
+
processDetails.portType = portTypes[0];
|
129
|
+
}
|
122
130
|
}
|
123
131
|
|
124
132
|
return {
|
@@ -448,7 +456,13 @@ class BlockInstanceRunner {
|
|
448
456
|
}
|
449
457
|
}
|
450
458
|
|
451
|
-
|
459
|
+
const out = await this._handleContainer(container, logs, true);
|
460
|
+
const portTypes = spec.local.ports ? Object.keys(spec.local.ports) : [];
|
461
|
+
if (portTypes.length > 0) {
|
462
|
+
out.portType = portTypes[0];
|
463
|
+
}
|
464
|
+
|
465
|
+
return out;
|
452
466
|
}
|
453
467
|
}
|
454
468
|
|