From 280fa27bda1ab8e457a0fac4ce7260120a3af581 Mon Sep 17 00:00:00 2001 From: J H Date: Mon, 11 Nov 2024 14:40:37 -0700 Subject: [PATCH] fix: Dependency --- .../Systems/SystemForEmbassy/index.ts | 44 ++++++++++++------- 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/container-runtime/src/Adapters/Systems/SystemForEmbassy/index.ts b/container-runtime/src/Adapters/Systems/SystemForEmbassy/index.ts index 4bcd3d5946..9885075fa2 100644 --- a/container-runtime/src/Adapters/Systems/SystemForEmbassy/index.ts +++ b/container-runtime/src/Adapters/Systems/SystemForEmbassy/index.ts @@ -682,22 +682,34 @@ export class SystemForEmbassy implements System { dependsOn: { [x: string]: readonly string[] }, ) { await effects.setDependencies({ - dependencies: Object.entries(dependsOn).flatMap(([key, value]) => { - const dependency = this.manifest.dependencies?.[key] - if (!dependency) return [] - const versionRange = dependency.version - const registryUrl = DEFAULT_REGISTRY - const kind = "running" - return [ - { - id: key, - versionRange, - registryUrl, - kind, - healthChecks: [...value], - }, - ] - }), + dependencies: Object.entries(dependsOn).flatMap( + ([key, value]): T.Dependencies => { + const dependency = this.manifest.dependencies?.[key] + if (!dependency) return [] + if (dependency.requirement.type === "required") { + const versionRange = dependency.version + const kind = "running" + return [ + { + id: key, + versionRange, + kind, + healthChecks: [...value], + }, + ] + } + + const versionRange = dependency.version + const kind = "exists" + return [ + { + id: key, + versionRange, + kind, + }, + ] + }, + ), }) }