@kapeta/local-cluster-service 0.42.0 → 0.43.0
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
CHANGED
@@ -1,3 +1,18 @@
|
|
1
|
+
# [0.43.0](https://github.com/kapetacom/local-cluster-service/compare/v0.42.1...v0.43.0) (2024-05-01)
|
2
|
+
|
3
|
+
|
4
|
+
### Features
|
5
|
+
|
6
|
+
* Add support for optional binds in local definitions ([#142](https://github.com/kapetacom/local-cluster-service/issues/142)) ([2406aac](https://github.com/kapetacom/local-cluster-service/commit/2406aac9d34d625e07dd98debb67cbcec642deeb))
|
7
|
+
|
8
|
+
## [0.42.1](https://github.com/kapetacom/local-cluster-service/compare/v0.42.0...v0.42.1) (2024-05-01)
|
9
|
+
|
10
|
+
|
11
|
+
### Bug Fixes
|
12
|
+
|
13
|
+
* Bump kaplang ([e6384f3](https://github.com/kapetacom/local-cluster-service/commit/e6384f3b0f3dad1332eb8e70561e33b06b5acdc1))
|
14
|
+
* Bump schemas ([935f48c](https://github.com/kapetacom/local-cluster-service/commit/935f48c9bb30291c84f2e12f5350005b6ff61f85))
|
15
|
+
|
1
16
|
# [0.42.0](https://github.com/kapetacom/local-cluster-service/compare/v0.41.1...v0.42.0) (2024-04-18)
|
2
17
|
|
3
18
|
|
@@ -252,15 +252,25 @@ class BlockInstanceRunner {
|
|
252
252
|
Binds: [
|
253
253
|
`${(0, containerManager_1.toLocalBindVolume)(local_cluster_config_1.default.getKapetaBasedir())}:${homeDir}/.kapeta`,
|
254
254
|
...Binds.map((bind) => {
|
255
|
-
let
|
255
|
+
let options = bind.split(':');
|
256
|
+
let host = options.shift();
|
257
|
+
let container = options.shift();
|
256
258
|
if (host.startsWith('~')) {
|
257
259
|
host = node_os_1.default.homedir() + host.substring(1);
|
258
260
|
}
|
259
261
|
if (container.startsWith('~')) {
|
260
262
|
container = homeDir + container.substring(1);
|
261
263
|
}
|
262
|
-
|
263
|
-
|
264
|
+
if (options.includes('optional')) {
|
265
|
+
// If the bind is optional, we skip it if the host path does not exist
|
266
|
+
options = options.filter((opt) => opt !== 'optional');
|
267
|
+
if (!fs_extra_1.default.existsSync(host)) {
|
268
|
+
console.log(`Skipping optional bind: ${bind} for block: ${blockInstance.id}`);
|
269
|
+
return '';
|
270
|
+
}
|
271
|
+
}
|
272
|
+
return `${(0, containerManager_1.toLocalBindVolume)(host)}:${container}${options.length > 0 ? ':' + options.join(':') : ''}`;
|
273
|
+
}).filter((bind) => Boolean(bind)),
|
264
274
|
],
|
265
275
|
PortBindings,
|
266
276
|
Mounts,
|
@@ -252,15 +252,25 @@ class BlockInstanceRunner {
|
|
252
252
|
Binds: [
|
253
253
|
`${(0, containerManager_1.toLocalBindVolume)(local_cluster_config_1.default.getKapetaBasedir())}:${homeDir}/.kapeta`,
|
254
254
|
...Binds.map((bind) => {
|
255
|
-
let
|
255
|
+
let options = bind.split(':');
|
256
|
+
let host = options.shift();
|
257
|
+
let container = options.shift();
|
256
258
|
if (host.startsWith('~')) {
|
257
259
|
host = node_os_1.default.homedir() + host.substring(1);
|
258
260
|
}
|
259
261
|
if (container.startsWith('~')) {
|
260
262
|
container = homeDir + container.substring(1);
|
261
263
|
}
|
262
|
-
|
263
|
-
|
264
|
+
if (options.includes('optional')) {
|
265
|
+
// If the bind is optional, we skip it if the host path does not exist
|
266
|
+
options = options.filter((opt) => opt !== 'optional');
|
267
|
+
if (!fs_extra_1.default.existsSync(host)) {
|
268
|
+
console.log(`Skipping optional bind: ${bind} for block: ${blockInstance.id}`);
|
269
|
+
return '';
|
270
|
+
}
|
271
|
+
}
|
272
|
+
return `${(0, containerManager_1.toLocalBindVolume)(host)}:${container}${options.length > 0 ? ':' + options.join(':') : ''}`;
|
273
|
+
}).filter((bind) => Boolean(bind)),
|
264
274
|
],
|
265
275
|
PortBindings,
|
266
276
|
Mounts,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@kapeta/local-cluster-service",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.43.0",
|
4
4
|
"description": "Manages configuration, ports and service discovery for locally running Kapeta systems",
|
5
5
|
"type": "commonjs",
|
6
6
|
"exports": {
|
@@ -55,7 +55,7 @@
|
|
55
55
|
"@kapeta/nodejs-process": "^1.2.0",
|
56
56
|
"@kapeta/nodejs-registry-utils": ">=0.11.1 <2",
|
57
57
|
"@kapeta/nodejs-utils": "<2",
|
58
|
-
"@kapeta/schemas": "^3.
|
58
|
+
"@kapeta/schemas": "^3.6.0",
|
59
59
|
"@kapeta/sdk-config": "^2.1.1",
|
60
60
|
"@kapeta/web-microfrontend": "^1.2.5",
|
61
61
|
"@sentry/node": "^7.94.1",
|
@@ -351,7 +351,10 @@ export class BlockInstanceRunner {
|
|
351
351
|
Binds: [
|
352
352
|
`${toLocalBindVolume(ClusterConfig.getKapetaBasedir())}:${homeDir}/.kapeta`,
|
353
353
|
...Binds.map((bind: string) => {
|
354
|
-
let
|
354
|
+
let options = bind.split(':');
|
355
|
+
let host = options.shift()!;
|
356
|
+
let container = options.shift()!;
|
357
|
+
|
355
358
|
if (host.startsWith('~')) {
|
356
359
|
host = OS.homedir() + host.substring(1);
|
357
360
|
}
|
@@ -360,8 +363,17 @@ export class BlockInstanceRunner {
|
|
360
363
|
container = homeDir + container.substring(1);
|
361
364
|
}
|
362
365
|
|
363
|
-
|
364
|
-
|
366
|
+
if (options.includes('optional')) {
|
367
|
+
// If the bind is optional, we skip it if the host path does not exist
|
368
|
+
options = options.filter((opt) => opt !== 'optional');
|
369
|
+
if (!FSExtra.existsSync(host)) {
|
370
|
+
console.log(`Skipping optional bind: ${bind} for block: ${blockInstance.id}`)
|
371
|
+
return '';
|
372
|
+
}
|
373
|
+
}
|
374
|
+
|
375
|
+
return `${toLocalBindVolume(host)}:${container}${options.length > 0 ? ':' + options.join(':') : ''}`;
|
376
|
+
}).filter((bind: string) => Boolean(bind)),
|
365
377
|
],
|
366
378
|
PortBindings,
|
367
379
|
Mounts,
|