@tdk-landscape/tdk-cli-core 1.3.157 → 1.3.159
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/cli/dist/commands/doctor.js +13 -5
- package/cli/dist/commands/down.js +1 -1
- package/cli/dist/commands/up.js +2 -15
- package/cli/dist/utils/doctor-fix.js +168 -9
- package/cli/dist/utils/down-cleanup.js +26 -0
- package/cli/dist/utils/tilt-port-owner.js +14 -0
- package/cli/dist/utils/tilt.js +3 -3
- package/cli/dist-bundle/chunk-NYJ4DFC2.js +377 -0
- package/cli/dist-bundle/cli.js +206 -206
- package/cli/dist-bundle/{cold-preflight-OQUN7OFG.js → cold-preflight-V77OAM2K.js} +1 -1
- package/cli/package.json +1 -1
- package/engine/topologies/tilt/resources/orchestrator/apply.star +3 -4
- package/engine/topologies/tilt/resources/orchestrator/apply_compose_resource_registration.star +12 -2
- package/package.json +1 -1
- package/cli/dist-bundle/chunk-O2SVXNG5.js +0 -377
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{createRequire as __tdkRequire}from'node:module';const require=__tdkRequire(import.meta.url);
|
|
2
|
-
import{
|
|
2
|
+
import{Mb as a,Nb as b,Ob as c,Pb as d,Qb as e}from"./chunk-NYJ4DFC2.js";import"./chunk-42IVF3YT.js";import"./chunk-6EA4DGCY.js";export{e as assertMachineReadyOrExit,d as formatColdPreflight,a as nodeTooOld,b as requireVerifiedDockerVersions,c as runColdPreflight};
|
package/cli/package.json
CHANGED
|
@@ -11,7 +11,7 @@ load('../databases.star', 'Database')
|
|
|
11
11
|
load('./apply_runtime_flags.star', 'RuntimeFlags')
|
|
12
12
|
load('./apply_resource_validation.star', 'ResourceValidation')
|
|
13
13
|
load('./apply_manifest_orchestration.star', 'ManifestOrchestration')
|
|
14
|
-
load('./apply_compose_resource_registration.star', 'ComposeResourceRegistration')
|
|
14
|
+
load('./apply_compose_resource_registration.star', 'ComposeResourceRegistration', 'resource_needs_database')
|
|
15
15
|
load('./apply_migrator_orchestration.star', 'MigratorOrchestration')
|
|
16
16
|
|
|
17
17
|
|
|
@@ -53,11 +53,10 @@ def apply_app_service(resource_config, ctx):
|
|
|
53
53
|
|
|
54
54
|
ResourceValidation.validate(resource_config)
|
|
55
55
|
|
|
56
|
-
#
|
|
56
|
+
# Provision the database when a resource receives DATABASE_URL (backend or bring-your-own), not for frontends only.
|
|
57
57
|
has_backend = False
|
|
58
58
|
for resource in resource_config.get('resources', []):
|
|
59
|
-
|
|
60
|
-
if manifest.get('appType') == 'backend':
|
|
59
|
+
if resource_needs_database(resource.get('_manifest', {})):
|
|
61
60
|
has_backend = True
|
|
62
61
|
break
|
|
63
62
|
|
package/engine/topologies/tilt/resources/orchestrator/apply_compose_resource_registration.star
CHANGED
|
@@ -562,11 +562,21 @@ def _register_dc_resources(resource_configs, resource_path, compose_project_name
|
|
|
562
562
|
_register_single_resource(config, resource_path, compose_project_name, auto_init_apps)
|
|
563
563
|
|
|
564
564
|
|
|
565
|
+
# appTypes whose containers get DATABASE_URL and therefore need their logical database provisioned. Bring-your-own
|
|
566
|
+
# containers receive DATABASE_URL too (docs/byo.md), so without provisioning they point at a database that never exists.
|
|
567
|
+
DATABASE_APP_TYPES = ['backend', 'bring-your-own']
|
|
568
|
+
|
|
569
|
+
|
|
570
|
+
def resource_needs_database(manifest):
|
|
571
|
+
"""True when a resource of this manifest receives DATABASE_URL and needs its database provisioned."""
|
|
572
|
+
return (manifest or {}).get('appType') in DATABASE_APP_TYPES
|
|
573
|
+
|
|
574
|
+
|
|
565
575
|
def _has_backend_resource(resource_config, resource_manifests):
|
|
566
|
-
"""Check if service has a backend
|
|
576
|
+
"""Check if service has a resource that needs the provisioned database (backend or bring-your-own)."""
|
|
567
577
|
for resource in resource_config.get('resources', []):
|
|
568
578
|
manifest = resource_manifests.get(resource['name'], {})
|
|
569
|
-
if manifest
|
|
579
|
+
if resource_needs_database(manifest):
|
|
570
580
|
return True
|
|
571
581
|
return False
|
|
572
582
|
|