@xemahq/xema 0.13.0 → 0.15.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/README.md +90 -21
- package/dist/assets/appliance-base/distribution.lock.json +5144 -0
- package/dist/assets/appliance-base/images.lock.json +1706 -0
- package/dist/assets/appliance-lean/distribution.lock.json +2888 -0
- package/dist/assets/appliance-lean/images.lock.json +1229 -0
- package/dist/assets/boot-graph.json +380 -28
- package/dist/assets/cloud/distribution.lock.json +5278 -0
- package/dist/assets/cloud/images.lock.json +1713 -0
- package/dist/assets/core/distribution.lock.json +2401 -354
- package/dist/assets/core/images.lock.json +1208 -268
- package/dist/assets/distribution-assets.manifest.json +147 -0
- package/dist/assets/keycloak/realm-xema.json +412 -0
- package/dist/assets/minimal/distribution.lock.json +2710 -0
- package/dist/assets/minimal/images.lock.json +1149 -0
- package/dist/assets/oss/distribution.lock.json +3742 -494
- package/dist/assets/oss/images.lock.json +1591 -472
- package/dist/assets/starter/distribution.lock.json +3422 -0
- package/dist/assets/starter/images.lock.json +1404 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +40 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/apply.d.ts.map +1 -1
- package/dist/commands/apply.js +2 -2
- package/dist/commands/apply.js.map +1 -1
- package/dist/commands/biome-dev.d.ts +3 -0
- package/dist/commands/biome-dev.d.ts.map +1 -0
- package/dist/commands/biome-dev.js +176 -0
- package/dist/commands/biome-dev.js.map +1 -0
- package/dist/commands/biome-validate.d.ts +10 -0
- package/dist/commands/biome-validate.d.ts.map +1 -0
- package/dist/commands/biome-validate.js +49 -0
- package/dist/commands/biome-validate.js.map +1 -0
- package/dist/commands/biome.d.ts.map +1 -1
- package/dist/commands/biome.js +437 -26
- package/dist/commands/biome.js.map +1 -1
- package/dist/commands/canopy.d.ts +3 -0
- package/dist/commands/canopy.d.ts.map +1 -0
- package/dist/commands/canopy.js +214 -0
- package/dist/commands/canopy.js.map +1 -0
- package/dist/commands/config.d.ts +3 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +78 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/dev.d.ts.map +1 -1
- package/dist/commands/dev.js +92 -20
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/dist.d.ts +13 -0
- package/dist/commands/dist.d.ts.map +1 -1
- package/dist/commands/dist.js +51 -11
- package/dist/commands/dist.js.map +1 -1
- package/dist/commands/doctor.d.ts +25 -0
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +422 -18
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/down.d.ts +10 -0
- package/dist/commands/down.d.ts.map +1 -1
- package/dist/commands/down.js +107 -33
- package/dist/commands/down.js.map +1 -1
- package/dist/commands/export.js +1 -1
- package/dist/commands/export.js.map +1 -1
- package/dist/commands/import.d.ts.map +1 -1
- package/dist/commands/import.js +2 -2
- package/dist/commands/import.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +56 -3
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/installation.d.ts +3 -0
- package/dist/commands/installation.d.ts.map +1 -0
- package/dist/commands/installation.js +258 -0
- package/dist/commands/installation.js.map +1 -0
- package/dist/commands/license.d.ts +3 -0
- package/dist/commands/license.d.ts.map +1 -0
- package/dist/commands/license.js +97 -0
- package/dist/commands/license.js.map +1 -0
- package/dist/commands/login.d.ts +4 -0
- package/dist/commands/login.d.ts.map +1 -0
- package/dist/commands/login.js +127 -0
- package/dist/commands/login.js.map +1 -0
- package/dist/commands/logs.d.ts +21 -0
- package/dist/commands/logs.d.ts.map +1 -1
- package/dist/commands/logs.js +133 -32
- package/dist/commands/logs.js.map +1 -1
- package/dist/commands/objects.d.ts.map +1 -1
- package/dist/commands/objects.js +85 -6
- package/dist/commands/objects.js.map +1 -1
- package/dist/commands/plan.d.ts.map +1 -1
- package/dist/commands/plan.js +2 -2
- package/dist/commands/plan.js.map +1 -1
- package/dist/commands/run.d.ts.map +1 -1
- package/dist/commands/run.js +61 -9
- package/dist/commands/run.js.map +1 -1
- package/dist/commands/serve.d.ts.map +1 -1
- package/dist/commands/serve.js +67 -14
- package/dist/commands/serve.js.map +1 -1
- package/dist/commands/shell.d.ts.map +1 -1
- package/dist/commands/shell.js +190 -6
- package/dist/commands/shell.js.map +1 -1
- package/dist/commands/source.d.ts +3 -0
- package/dist/commands/source.d.ts.map +1 -0
- package/dist/commands/source.js +120 -0
- package/dist/commands/source.js.map +1 -0
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +29 -3
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/up.d.ts.map +1 -1
- package/dist/commands/up.js +70 -5
- package/dist/commands/up.js.map +1 -1
- package/dist/dev/env-defaults.d.ts +1 -0
- package/dist/dev/env-defaults.d.ts.map +1 -1
- package/dist/dev/env-defaults.js +24 -12
- package/dist/dev/env-defaults.js.map +1 -1
- package/dist/dev/forked-worker-bootstrap-protocol.d.ts +17 -0
- package/dist/dev/forked-worker-bootstrap-protocol.d.ts.map +1 -0
- package/dist/dev/forked-worker-bootstrap-protocol.js +35 -0
- package/dist/dev/forked-worker-bootstrap-protocol.js.map +1 -0
- package/dist/dev/forked-worker-bootstrap.d.ts +18 -0
- package/dist/dev/forked-worker-bootstrap.d.ts.map +1 -0
- package/dist/dev/forked-worker-bootstrap.js +84 -0
- package/dist/dev/forked-worker-bootstrap.js.map +1 -0
- package/dist/dev/forked-worker.d.ts +29 -0
- package/dist/dev/forked-worker.d.ts.map +1 -1
- package/dist/dev/forked-worker.js +267 -42
- package/dist/dev/forked-worker.js.map +1 -1
- package/dist/dev/opa-policies.d.ts +3 -0
- package/dist/dev/opa-policies.d.ts.map +1 -0
- package/dist/dev/opa-policies.js +64 -0
- package/dist/dev/opa-policies.js.map +1 -0
- package/dist/lib/cli-errors.d.ts +7 -0
- package/dist/lib/cli-errors.d.ts.map +1 -0
- package/dist/lib/cli-errors.js +30 -0
- package/dist/lib/cli-errors.js.map +1 -0
- package/dist/lib/control-plane.d.ts +5 -1
- package/dist/lib/control-plane.d.ts.map +1 -1
- package/dist/lib/control-plane.js +61 -8
- package/dist/lib/control-plane.js.map +1 -1
- package/dist/lib/exit-codes.d.ts +3 -4
- package/dist/lib/exit-codes.d.ts.map +1 -1
- package/dist/lib/exit-codes.js +3 -4
- package/dist/lib/exit-codes.js.map +1 -1
- package/dist/lib/http-error.d.ts +2 -0
- package/dist/lib/http-error.d.ts.map +1 -0
- package/dist/lib/http-error.js +51 -0
- package/dist/lib/http-error.js.map +1 -0
- package/dist/lib/roster-profile.d.ts +10 -0
- package/dist/lib/roster-profile.d.ts.map +1 -0
- package/dist/lib/roster-profile.js +44 -0
- package/dist/lib/roster-profile.js.map +1 -0
- package/dist/runtime/asset-provenance.d.ts +17 -0
- package/dist/runtime/asset-provenance.d.ts.map +1 -0
- package/dist/runtime/asset-provenance.js +29 -0
- package/dist/runtime/asset-provenance.js.map +1 -0
- package/dist/runtime/auth/client-bootstrap.d.ts +11 -0
- package/dist/runtime/auth/client-bootstrap.d.ts.map +1 -0
- package/dist/runtime/auth/client-bootstrap.js +60 -0
- package/dist/runtime/auth/client-bootstrap.js.map +1 -0
- package/dist/runtime/auth/device-flow.d.ts +43 -0
- package/dist/runtime/auth/device-flow.d.ts.map +1 -0
- package/dist/runtime/auth/device-flow.js +201 -0
- package/dist/runtime/auth/device-flow.js.map +1 -0
- package/dist/runtime/auth/session-auth.d.ts +8 -0
- package/dist/runtime/auth/session-auth.d.ts.map +1 -0
- package/dist/runtime/auth/session-auth.js +43 -0
- package/dist/runtime/auth/session-auth.js.map +1 -0
- package/dist/runtime/auth/session-store.d.ts +19 -0
- package/dist/runtime/auth/session-store.d.ts.map +1 -0
- package/dist/runtime/auth/session-store.js +83 -0
- package/dist/runtime/auth/session-store.js.map +1 -0
- package/dist/runtime/auth/token-claims.d.ts +2 -0
- package/dist/runtime/auth/token-claims.d.ts.map +1 -0
- package/dist/runtime/auth/token-claims.js +45 -0
- package/dist/runtime/auth/token-claims.js.map +1 -0
- package/dist/runtime/biome-dev.d.ts +28 -0
- package/dist/runtime/biome-dev.d.ts.map +1 -0
- package/dist/runtime/biome-dev.js +131 -0
- package/dist/runtime/biome-dev.js.map +1 -0
- package/dist/runtime/biome-local-install.d.ts +29 -0
- package/dist/runtime/biome-local-install.d.ts.map +1 -0
- package/dist/runtime/biome-local-install.js +243 -0
- package/dist/runtime/biome-local-install.js.map +1 -0
- package/dist/runtime/biome-provenance.d.ts +26 -0
- package/dist/runtime/biome-provenance.d.ts.map +1 -0
- package/dist/runtime/biome-provenance.js +70 -0
- package/dist/runtime/biome-provenance.js.map +1 -0
- package/dist/runtime/biome-publish.d.ts +48 -0
- package/dist/runtime/biome-publish.d.ts.map +1 -0
- package/dist/runtime/biome-publish.js +278 -0
- package/dist/runtime/biome-publish.js.map +1 -0
- package/dist/runtime/biome-scaffold.d.ts +35 -0
- package/dist/runtime/biome-scaffold.d.ts.map +1 -0
- package/dist/runtime/biome-scaffold.js +151 -0
- package/dist/runtime/biome-scaffold.js.map +1 -0
- package/dist/runtime/biome-validate.d.ts +28 -0
- package/dist/runtime/biome-validate.d.ts.map +1 -0
- package/dist/runtime/biome-validate.js +452 -0
- package/dist/runtime/biome-validate.js.map +1 -0
- package/dist/runtime/boot-graph-loader.d.ts +1 -0
- package/dist/runtime/boot-graph-loader.d.ts.map +1 -1
- package/dist/runtime/boot-graph-loader.js +99 -7
- package/dist/runtime/boot-graph-loader.js.map +1 -1
- package/dist/runtime/canopy-refs.d.ts +8 -0
- package/dist/runtime/canopy-refs.d.ts.map +1 -0
- package/dist/runtime/canopy-refs.js +51 -0
- package/dist/runtime/canopy-refs.js.map +1 -0
- package/dist/runtime/canopy-replies.d.ts +14 -0
- package/dist/runtime/canopy-replies.d.ts.map +1 -0
- package/dist/runtime/canopy-replies.js +39 -0
- package/dist/runtime/canopy-replies.js.map +1 -0
- package/dist/runtime/capability-invoke.d.ts +35 -0
- package/dist/runtime/capability-invoke.d.ts.map +1 -0
- package/dist/runtime/capability-invoke.js +119 -0
- package/dist/runtime/capability-invoke.js.map +1 -0
- package/dist/runtime/cleanup.d.ts +10 -0
- package/dist/runtime/cleanup.d.ts.map +1 -0
- package/dist/runtime/cleanup.js +35 -0
- package/dist/runtime/cleanup.js.map +1 -0
- package/dist/runtime/config/dev-mode.d.ts +8 -0
- package/dist/runtime/config/dev-mode.d.ts.map +1 -0
- package/dist/runtime/config/dev-mode.js +84 -0
- package/dist/runtime/config/dev-mode.js.map +1 -0
- package/dist/runtime/config/init-presets.d.ts +1 -1
- package/dist/runtime/config/init-presets.d.ts.map +1 -1
- package/dist/runtime/config/init-presets.js +68 -13
- package/dist/runtime/config/init-presets.js.map +1 -1
- package/dist/runtime/config/loader.d.ts +1 -0
- package/dist/runtime/config/loader.d.ts.map +1 -1
- package/dist/runtime/config/loader.js +41 -5
- package/dist/runtime/config/loader.js.map +1 -1
- package/dist/runtime/config/schema.d.ts +27 -12
- package/dist/runtime/config/schema.d.ts.map +1 -1
- package/dist/runtime/config/schema.js +113 -8
- package/dist/runtime/config/schema.js.map +1 -1
- package/dist/runtime/config/sources-config.d.ts +14 -0
- package/dist/runtime/config/sources-config.d.ts.map +1 -0
- package/dist/runtime/config/sources-config.js +79 -0
- package/dist/runtime/config/sources-config.js.map +1 -0
- package/dist/runtime/distribution/available-biome.d.ts.map +1 -1
- package/dist/runtime/distribution/available-biome.js +2 -0
- package/dist/runtime/distribution/available-biome.js.map +1 -1
- package/dist/runtime/distribution/compose.d.ts +2 -1
- package/dist/runtime/distribution/compose.d.ts.map +1 -1
- package/dist/runtime/distribution/compose.js +4 -1
- package/dist/runtime/distribution/compose.js.map +1 -1
- package/dist/runtime/env-seeder.d.ts +5 -0
- package/dist/runtime/env-seeder.d.ts.map +1 -1
- package/dist/runtime/env-seeder.js +152 -19
- package/dist/runtime/env-seeder.js.map +1 -1
- package/dist/runtime/foreground.d.ts +9 -0
- package/dist/runtime/foreground.d.ts.map +1 -1
- package/dist/runtime/foreground.js +37 -3
- package/dist/runtime/foreground.js.map +1 -1
- package/dist/runtime/infra/infra-catalog.d.ts +34 -1
- package/dist/runtime/infra/infra-catalog.d.ts.map +1 -1
- package/dist/runtime/infra/infra-catalog.js +202 -10
- package/dist/runtime/infra/infra-catalog.js.map +1 -1
- package/dist/runtime/infra/infra-environment.d.ts +10 -0
- package/dist/runtime/infra/infra-environment.d.ts.map +1 -0
- package/dist/runtime/infra/infra-environment.js +76 -0
- package/dist/runtime/infra/infra-environment.js.map +1 -0
- package/dist/runtime/infra/infra-plan.d.ts +2 -1
- package/dist/runtime/infra/infra-plan.d.ts.map +1 -1
- package/dist/runtime/infra/infra-plan.js +10 -0
- package/dist/runtime/infra/infra-plan.js.map +1 -1
- package/dist/runtime/infra/infra-runner.d.ts +16 -1
- package/dist/runtime/infra/infra-runner.d.ts.map +1 -1
- package/dist/runtime/infra/infra-runner.js +245 -55
- package/dist/runtime/infra/infra-runner.js.map +1 -1
- package/dist/runtime/infra/keycloak-realm.d.ts +25 -0
- package/dist/runtime/infra/keycloak-realm.d.ts.map +1 -0
- package/dist/runtime/infra/keycloak-realm.js +116 -0
- package/dist/runtime/infra/keycloak-realm.js.map +1 -0
- package/dist/runtime/infra/postgres-endpoint.d.ts +8 -0
- package/dist/runtime/infra/postgres-endpoint.d.ts.map +1 -0
- package/dist/runtime/infra/postgres-endpoint.js +21 -0
- package/dist/runtime/infra/postgres-endpoint.js.map +1 -0
- package/dist/runtime/installation/compiler.d.ts +114 -0
- package/dist/runtime/installation/compiler.d.ts.map +1 -0
- package/dist/runtime/installation/compiler.js +456 -0
- package/dist/runtime/installation/compiler.js.map +1 -0
- package/dist/runtime/installation/contract.d.ts +296 -0
- package/dist/runtime/installation/contract.d.ts.map +1 -0
- package/dist/runtime/installation/contract.js +504 -0
- package/dist/runtime/installation/contract.js.map +1 -0
- package/dist/runtime/installation/current-launcher-renderer.d.ts +12 -0
- package/dist/runtime/installation/current-launcher-renderer.d.ts.map +1 -0
- package/dist/runtime/installation/current-launcher-renderer.js +123 -0
- package/dist/runtime/installation/current-launcher-renderer.js.map +1 -0
- package/dist/runtime/installation/diagnostics.d.ts +16 -0
- package/dist/runtime/installation/diagnostics.d.ts.map +1 -0
- package/dist/runtime/installation/diagnostics.js +21 -0
- package/dist/runtime/installation/diagnostics.js.map +1 -0
- package/dist/runtime/installation/diff.d.ts +32 -0
- package/dist/runtime/installation/diff.d.ts.map +1 -0
- package/dist/runtime/installation/diff.js +136 -0
- package/dist/runtime/installation/diff.js.map +1 -0
- package/dist/runtime/installation/format.d.ts +3 -0
- package/dist/runtime/installation/format.d.ts.map +1 -0
- package/dist/runtime/installation/format.js +22 -0
- package/dist/runtime/installation/format.js.map +1 -0
- package/dist/runtime/installation/from-current-config.d.ts +9 -0
- package/dist/runtime/installation/from-current-config.d.ts.map +1 -0
- package/dist/runtime/installation/from-current-config.js +245 -0
- package/dist/runtime/installation/from-current-config.js.map +1 -0
- package/dist/runtime/installation/helm-release-readiness.d.ts +9 -0
- package/dist/runtime/installation/helm-release-readiness.d.ts.map +1 -0
- package/dist/runtime/installation/helm-release-readiness.js +97 -0
- package/dist/runtime/installation/helm-release-readiness.js.map +1 -0
- package/dist/runtime/installation/helm-release.d.ts +24 -0
- package/dist/runtime/installation/helm-release.d.ts.map +1 -0
- package/dist/runtime/installation/helm-release.js +96 -0
- package/dist/runtime/installation/helm-release.js.map +1 -0
- package/dist/runtime/installation/index.d.ts +22 -0
- package/dist/runtime/installation/index.d.ts.map +1 -0
- package/dist/runtime/installation/index.js +38 -0
- package/dist/runtime/installation/index.js.map +1 -0
- package/dist/runtime/installation/json-schema.d.ts +4 -0
- package/dist/runtime/installation/json-schema.d.ts.map +1 -0
- package/dist/runtime/installation/json-schema.js +16 -0
- package/dist/runtime/installation/json-schema.js.map +1 -0
- package/dist/runtime/installation/kubernetes-readiness.d.ts +60 -0
- package/dist/runtime/installation/kubernetes-readiness.d.ts.map +1 -0
- package/dist/runtime/installation/kubernetes-readiness.js +384 -0
- package/dist/runtime/installation/kubernetes-readiness.js.map +1 -0
- package/dist/runtime/installation/lifecycle.d.ts +25 -0
- package/dist/runtime/installation/lifecycle.d.ts.map +1 -0
- package/dist/runtime/installation/lifecycle.js +157 -0
- package/dist/runtime/installation/lifecycle.js.map +1 -0
- package/dist/runtime/installation/readiness-proof.d.ts +72 -0
- package/dist/runtime/installation/readiness-proof.d.ts.map +1 -0
- package/dist/runtime/installation/readiness-proof.js +142 -0
- package/dist/runtime/installation/readiness-proof.js.map +1 -0
- package/dist/runtime/installation/readiness.d.ts +21 -0
- package/dist/runtime/installation/readiness.d.ts.map +1 -0
- package/dist/runtime/installation/readiness.js +418 -0
- package/dist/runtime/installation/readiness.js.map +1 -0
- package/dist/runtime/installation/serialization.d.ts +3 -0
- package/dist/runtime/installation/serialization.d.ts.map +1 -0
- package/dist/runtime/installation/serialization.js +39 -0
- package/dist/runtime/installation/serialization.js.map +1 -0
- package/dist/runtime/installation/setup-profile.d.ts +8 -0
- package/dist/runtime/installation/setup-profile.d.ts.map +1 -0
- package/dist/runtime/installation/setup-profile.js +41 -0
- package/dist/runtime/installation/setup-profile.js.map +1 -0
- package/dist/runtime/installation/setup-renderer.d.ts +31 -0
- package/dist/runtime/installation/setup-renderer.d.ts.map +1 -0
- package/dist/runtime/installation/setup-renderer.js +238 -0
- package/dist/runtime/installation/setup-renderer.js.map +1 -0
- package/dist/runtime/installation/state-store.d.ts +28 -0
- package/dist/runtime/installation/state-store.d.ts.map +1 -0
- package/dist/runtime/installation/state-store.js +377 -0
- package/dist/runtime/installation/state-store.js.map +1 -0
- package/dist/runtime/installation/status.d.ts +24 -0
- package/dist/runtime/installation/status.d.ts.map +1 -0
- package/dist/runtime/installation/status.js +52 -0
- package/dist/runtime/installation/status.js.map +1 -0
- package/dist/runtime/installation/support-bundle.d.ts +30 -0
- package/dist/runtime/installation/support-bundle.d.ts.map +1 -0
- package/dist/runtime/installation/support-bundle.js +145 -0
- package/dist/runtime/installation/support-bundle.js.map +1 -0
- package/dist/runtime/installation/to-current-config.d.ts +4 -0
- package/dist/runtime/installation/to-current-config.d.ts.map +1 -0
- package/dist/runtime/installation/to-current-config.js +171 -0
- package/dist/runtime/installation/to-current-config.js.map +1 -0
- package/dist/runtime/installation/validation.d.ts +8 -0
- package/dist/runtime/installation/validation.d.ts.map +1 -0
- package/dist/runtime/installation/validation.js +117 -0
- package/dist/runtime/installation/validation.js.map +1 -0
- package/dist/runtime/installation/validators/common.d.ts +4 -0
- package/dist/runtime/installation/validators/common.d.ts.map +1 -0
- package/dist/runtime/installation/validators/common.js +32 -0
- package/dist/runtime/installation/validators/common.js.map +1 -0
- package/dist/runtime/installation/validators/infrastructure.d.ts +4 -0
- package/dist/runtime/installation/validators/infrastructure.d.ts.map +1 -0
- package/dist/runtime/installation/validators/infrastructure.js +96 -0
- package/dist/runtime/installation/validators/infrastructure.js.map +1 -0
- package/dist/runtime/installation/validators/operational.d.ts +4 -0
- package/dist/runtime/installation/validators/operational.d.ts.map +1 -0
- package/dist/runtime/installation/validators/operational.js +68 -0
- package/dist/runtime/installation/validators/operational.js.map +1 -0
- package/dist/runtime/installation/validators/profile.d.ts +4 -0
- package/dist/runtime/installation/validators/profile.d.ts.map +1 -0
- package/dist/runtime/installation/validators/profile.js +80 -0
- package/dist/runtime/installation/validators/profile.js.map +1 -0
- package/dist/runtime/installation/validators/secrets.d.ts +4 -0
- package/dist/runtime/installation/validators/secrets.d.ts.map +1 -0
- package/dist/runtime/installation/validators/secrets.js +85 -0
- package/dist/runtime/installation/validators/secrets.js.map +1 -0
- package/dist/runtime/launch-plan-format.d.ts +3 -0
- package/dist/runtime/launch-plan-format.d.ts.map +1 -0
- package/dist/runtime/launch-plan-format.js +57 -0
- package/dist/runtime/launch-plan-format.js.map +1 -0
- package/dist/runtime/launch.d.ts +35 -3
- package/dist/runtime/launch.d.ts.map +1 -1
- package/dist/runtime/launch.js +382 -37
- package/dist/runtime/launch.js.map +1 -1
- package/dist/runtime/license/license-clock.d.ts +12 -0
- package/dist/runtime/license/license-clock.d.ts.map +1 -0
- package/dist/runtime/license/license-clock.js +57 -0
- package/dist/runtime/license/license-clock.js.map +1 -0
- package/dist/runtime/license/license-report.d.ts +19 -0
- package/dist/runtime/license/license-report.d.ts.map +1 -0
- package/dist/runtime/license/license-report.js +105 -0
- package/dist/runtime/license/license-report.js.map +1 -0
- package/dist/runtime/license/license-store.d.ts +5 -0
- package/dist/runtime/license/license-store.d.ts.map +1 -0
- package/dist/runtime/license/license-store.js +11 -0
- package/dist/runtime/license/license-store.js.map +1 -0
- package/dist/runtime/license/registry-credential.d.ts +26 -0
- package/dist/runtime/license/registry-credential.d.ts.map +1 -0
- package/dist/runtime/license/registry-credential.js +94 -0
- package/dist/runtime/license/registry-credential.js.map +1 -0
- package/dist/runtime/license/resolve-license.d.ts +30 -0
- package/dist/runtime/license/resolve-license.d.ts.map +1 -0
- package/dist/runtime/license/resolve-license.js +73 -0
- package/dist/runtime/license/resolve-license.js.map +1 -0
- package/dist/runtime/license/store-license.d.ts +18 -0
- package/dist/runtime/license/store-license.d.ts.map +1 -0
- package/dist/runtime/license/store-license.js +26 -0
- package/dist/runtime/license/store-license.js.map +1 -0
- package/dist/runtime/lock-loader.d.ts +3 -6
- package/dist/runtime/lock-loader.d.ts.map +1 -1
- package/dist/runtime/lock-loader.js +26 -20
- package/dist/runtime/lock-loader.js.map +1 -1
- package/dist/runtime/native-process-group.d.ts +46 -0
- package/dist/runtime/native-process-group.d.ts.map +1 -0
- package/dist/runtime/native-process-group.js +390 -0
- package/dist/runtime/native-process-group.js.map +1 -0
- package/dist/runtime/object-registry-client.d.ts +31 -0
- package/dist/runtime/object-registry-client.d.ts.map +1 -0
- package/dist/runtime/object-registry-client.js +54 -0
- package/dist/runtime/object-registry-client.js.map +1 -0
- package/dist/runtime/paths.d.ts +2 -0
- package/dist/runtime/paths.d.ts.map +1 -1
- package/dist/runtime/paths.js +3 -0
- package/dist/runtime/paths.js.map +1 -1
- package/dist/runtime/roster.d.ts +12 -5
- package/dist/runtime/roster.d.ts.map +1 -1
- package/dist/runtime/roster.js +89 -11
- package/dist/runtime/roster.js.map +1 -1
- package/dist/runtime/run-manifest.d.ts +52 -0
- package/dist/runtime/run-manifest.d.ts.map +1 -0
- package/dist/runtime/run-manifest.js +587 -0
- package/dist/runtime/run-manifest.js.map +1 -0
- package/dist/runtime/runner/container-preflight.d.ts +77 -0
- package/dist/runtime/runner/container-preflight.d.ts.map +1 -0
- package/dist/runtime/runner/container-preflight.js +360 -0
- package/dist/runtime/runner/container-preflight.js.map +1 -0
- package/dist/runtime/runner/container-runner.d.ts +14 -0
- package/dist/runtime/runner/container-runner.d.ts.map +1 -1
- package/dist/runtime/runner/container-runner.js +110 -14
- package/dist/runtime/runner/container-runner.js.map +1 -1
- package/dist/runtime/runner/docker-cli.d.ts +35 -2
- package/dist/runtime/runner/docker-cli.d.ts.map +1 -1
- package/dist/runtime/runner/docker-cli.js +314 -9
- package/dist/runtime/runner/docker-cli.js.map +1 -1
- package/dist/runtime/runner/health-probe.d.ts +1 -0
- package/dist/runtime/runner/health-probe.d.ts.map +1 -1
- package/dist/runtime/runner/health-probe.js +3 -2
- package/dist/runtime/runner/health-probe.js.map +1 -1
- package/dist/runtime/runner/helm-cli.d.ts +19 -1
- package/dist/runtime/runner/helm-cli.d.ts.map +1 -1
- package/dist/runtime/runner/helm-cli.js +76 -8
- package/dist/runtime/runner/helm-cli.js.map +1 -1
- package/dist/runtime/runner/helm-runner.d.ts +3 -0
- package/dist/runtime/runner/helm-runner.d.ts.map +1 -1
- package/dist/runtime/runner/helm-runner.js +23 -7
- package/dist/runtime/runner/helm-runner.js.map +1 -1
- package/dist/runtime/runner/host-platform.d.ts +39 -0
- package/dist/runtime/runner/host-platform.d.ts.map +1 -0
- package/dist/runtime/runner/host-platform.js +136 -0
- package/dist/runtime/runner/host-platform.js.map +1 -0
- package/dist/runtime/runner/kube-cli.d.ts +23 -0
- package/dist/runtime/runner/kube-cli.d.ts.map +1 -0
- package/dist/runtime/runner/kube-cli.js +112 -0
- package/dist/runtime/runner/kube-cli.js.map +1 -0
- package/dist/runtime/runner/native-runner.d.ts.map +1 -1
- package/dist/runtime/runner/native-runner.js +46 -15
- package/dist/runtime/runner/native-runner.js.map +1 -1
- package/dist/runtime/runner/service-runner.d.ts +5 -0
- package/dist/runtime/runner/service-runner.d.ts.map +1 -1
- package/dist/runtime/runner/service-runner.js.map +1 -1
- package/dist/runtime/runner/stream-outcome.d.ts +7 -0
- package/dist/runtime/runner/stream-outcome.d.ts.map +1 -0
- package/dist/runtime/runner/stream-outcome.js +13 -0
- package/dist/runtime/runner/stream-outcome.js.map +1 -0
- package/dist/runtime/secrets/managed-local-cipher.d.ts +18 -0
- package/dist/runtime/secrets/managed-local-cipher.d.ts.map +1 -0
- package/dist/runtime/secrets/managed-local-cipher.js +110 -0
- package/dist/runtime/secrets/managed-local-cipher.js.map +1 -0
- package/dist/runtime/secrets/managed-local-files.d.ts +4 -0
- package/dist/runtime/secrets/managed-local-files.d.ts.map +1 -0
- package/dist/runtime/secrets/managed-local-files.js +132 -0
- package/dist/runtime/secrets/managed-local-files.js.map +1 -0
- package/dist/runtime/secrets/managed-local-key-provider.d.ts +27 -0
- package/dist/runtime/secrets/managed-local-key-provider.d.ts.map +1 -0
- package/dist/runtime/secrets/managed-local-key-provider.js +144 -0
- package/dist/runtime/secrets/managed-local-key-provider.js.map +1 -0
- package/dist/runtime/secrets/managed-local-secret-store.d.ts +18 -0
- package/dist/runtime/secrets/managed-local-secret-store.d.ts.map +1 -0
- package/dist/runtime/secrets/managed-local-secret-store.js +82 -0
- package/dist/runtime/secrets/managed-local-secret-store.js.map +1 -0
- package/dist/runtime/secrets/managed-local-store.d.ts +33 -0
- package/dist/runtime/secrets/managed-local-store.d.ts.map +1 -0
- package/dist/runtime/secrets/managed-local-store.js +121 -0
- package/dist/runtime/secrets/managed-local-store.js.map +1 -0
- package/dist/runtime/secrets/resolver.d.ts +23 -0
- package/dist/runtime/secrets/resolver.d.ts.map +1 -0
- package/dist/runtime/secrets/resolver.js +265 -0
- package/dist/runtime/secrets/resolver.js.map +1 -0
- package/dist/runtime/secrets/url-security.d.ts +3 -0
- package/dist/runtime/secrets/url-security.d.ts.map +1 -0
- package/dist/runtime/secrets/url-security.js +13 -0
- package/dist/runtime/secrets/url-security.js.map +1 -0
- package/dist/runtime/sources/credentials.d.ts +2 -0
- package/dist/runtime/sources/credentials.d.ts.map +1 -1
- package/dist/runtime/sources/credentials.js +51 -1
- package/dist/runtime/sources/credentials.js.map +1 -1
- package/dist/runtime/sources/kinds/distribution.js +3 -3
- package/dist/runtime/sources/kinds/distribution.js.map +1 -1
- package/dist/runtime/sources/kinds/git.d.ts +6 -3
- package/dist/runtime/sources/kinds/git.d.ts.map +1 -1
- package/dist/runtime/sources/kinds/git.js +99 -22
- package/dist/runtime/sources/kinds/git.js.map +1 -1
- package/dist/runtime/sources/manifest-walk.d.ts +1 -0
- package/dist/runtime/sources/manifest-walk.d.ts.map +1 -1
- package/dist/runtime/sources/manifest-walk.js +16 -11
- package/dist/runtime/sources/manifest-walk.js.map +1 -1
- package/dist/runtime/sources/resolve-context.d.ts +7 -0
- package/dist/runtime/sources/resolve-context.d.ts.map +1 -0
- package/dist/runtime/sources/resolve-context.js +3 -0
- package/dist/runtime/sources/resolve-context.js.map +1 -0
- package/dist/runtime/sources/resolver.d.ts +2 -2
- package/dist/runtime/sources/resolver.d.ts.map +1 -1
- package/dist/runtime/sources/resolver.js +11 -5
- package/dist/runtime/sources/resolver.js.map +1 -1
- package/dist/runtime/sources/schema.d.ts.map +1 -1
- package/dist/runtime/sources/schema.js +51 -3
- package/dist/runtime/sources/schema.js.map +1 -1
- package/dist/runtime/store-client.d.ts +59 -0
- package/dist/runtime/store-client.d.ts.map +1 -0
- package/dist/runtime/store-client.js +72 -0
- package/dist/runtime/store-client.js.map +1 -0
- package/dist/runtime/store-submit.d.ts +31 -0
- package/dist/runtime/store-submit.d.ts.map +1 -0
- package/dist/runtime/store-submit.js +77 -0
- package/dist/runtime/store-submit.js.map +1 -0
- package/dist/runtime/supervisor.d.ts +18 -0
- package/dist/runtime/supervisor.d.ts.map +1 -1
- package/dist/runtime/supervisor.js +162 -15
- package/dist/runtime/supervisor.js.map +1 -1
- package/dist/runtime/waves.d.ts +1 -1
- package/dist/runtime/waves.d.ts.map +1 -1
- package/dist/runtime/waves.js +86 -19
- package/dist/runtime/waves.js.map +1 -1
- package/examples/01-local-native.yaml +4 -1
- package/examples/03-byo-infra.yaml +17 -7
- package/examples/05-appliance-helm.yaml +1 -1
- package/examples/06-biome-sources.yaml +4 -1
- package/package.json +20 -28
- package/xema.config.example.yaml +22 -18
- package/LICENSE +0 -176
- package/dist/lib/command-registry.d.ts +0 -5
- package/dist/lib/command-registry.d.ts.map +0 -1
- package/dist/lib/command-registry.js +0 -17
- package/dist/lib/command-registry.js.map +0 -1
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KubernetesWorkloadKind = void 0;
|
|
4
|
+
exports.proveKubernetesInstallationReadiness = proveKubernetesInstallationReadiness;
|
|
5
|
+
exports.kubernetesServiceExpectationsFromLaunchPlan = kubernetesServiceExpectationsFromLaunchPlan;
|
|
6
|
+
exports.evaluateKubernetesReadiness = evaluateKubernetesReadiness;
|
|
7
|
+
const schema_1 = require("../config/schema");
|
|
8
|
+
const unit_type_1 = require("../unit-type");
|
|
9
|
+
const readiness_1 = require("./readiness");
|
|
10
|
+
var KubernetesWorkloadKind;
|
|
11
|
+
(function (KubernetesWorkloadKind) {
|
|
12
|
+
KubernetesWorkloadKind["Deployment"] = "Deployment";
|
|
13
|
+
KubernetesWorkloadKind["StatefulSet"] = "StatefulSet";
|
|
14
|
+
KubernetesWorkloadKind["Job"] = "Job";
|
|
15
|
+
})(KubernetesWorkloadKind || (exports.KubernetesWorkloadKind = KubernetesWorkloadKind = {}));
|
|
16
|
+
async function proveKubernetesInstallationReadiness(expectation, source) {
|
|
17
|
+
return evaluateKubernetesReadiness(expectation, await source.observe(expectation));
|
|
18
|
+
}
|
|
19
|
+
function kubernetesServiceExpectationsFromLaunchPlan(plan, rolloutIdentities) {
|
|
20
|
+
if (plan.substrate !== schema_1.Substrate.Helm) {
|
|
21
|
+
throw new Error('Kubernetes service expectations require a Helm launch plan.');
|
|
22
|
+
}
|
|
23
|
+
return plan.roster.map((entry) => {
|
|
24
|
+
if (entry.unitType !== unit_type_1.RuntimeUnitType.Service &&
|
|
25
|
+
entry.unitType !== unit_type_1.RuntimeUnitType.Web) {
|
|
26
|
+
throw new Error(`Distribution-lock workload ${entry.name} has unsupported Kubernetes unit type ${entry.unitType}.`);
|
|
27
|
+
}
|
|
28
|
+
const rolloutIdentity = rolloutIdentities.get(entry.name);
|
|
29
|
+
if (rolloutIdentity === undefined || rolloutIdentity.length === 0) {
|
|
30
|
+
throw new Error(`Kubernetes executor supplied no artifact-derived rollout identity for ${entry.name}.`);
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
kind: KubernetesWorkloadKind.Deployment,
|
|
34
|
+
name: entry.name,
|
|
35
|
+
serviceName: entry.name,
|
|
36
|
+
replicas: 1,
|
|
37
|
+
rolloutIdentity,
|
|
38
|
+
};
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function evaluateKubernetesReadiness(expectation, observation) {
|
|
42
|
+
assertUniqueExpectedIdentities(expectation);
|
|
43
|
+
assertValidObservation(observation);
|
|
44
|
+
const expectedByIdentity = new Map(expectation.workloads.map((workload) => [
|
|
45
|
+
workloadIdentity(workload.kind, workload.name),
|
|
46
|
+
workload,
|
|
47
|
+
]));
|
|
48
|
+
const observedByIdentity = new Map(observation.workloads.map((workload) => [
|
|
49
|
+
workloadIdentity(workload.kind, workload.name),
|
|
50
|
+
workload,
|
|
51
|
+
]));
|
|
52
|
+
if (observedByIdentity.size !== observation.workloads.length) {
|
|
53
|
+
throw new Error('Kubernetes readiness observation contains duplicate workload identities.');
|
|
54
|
+
}
|
|
55
|
+
const services = new Set(observation.services);
|
|
56
|
+
const markers = new Set(observation.bootstrapMarkers);
|
|
57
|
+
const workloads = [];
|
|
58
|
+
const issues = [];
|
|
59
|
+
if (observation.namespace !== expectation.namespace ||
|
|
60
|
+
observation.installationId !== expectation.installationId) {
|
|
61
|
+
issues.push({
|
|
62
|
+
code: readiness_1.InstallationReadinessIssueCode.PlanIdentityMismatch,
|
|
63
|
+
message: `Observed Kubernetes scope ${observation.namespace}/${observation.installationId} does not match ${expectation.namespace}/${expectation.installationId}.`,
|
|
64
|
+
remediation: 'Query only resources carrying the exact namespace and installation ownership labels.',
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
if (observation.effectivePlanHash !== expectation.effectivePlanHash) {
|
|
68
|
+
issues.push({
|
|
69
|
+
code: readiness_1.InstallationReadinessIssueCode.PlanIdentityMismatch,
|
|
70
|
+
message: `Observed Kubernetes plan identity ${observation.effectivePlanHash} does not match ${expectation.effectivePlanHash}.`,
|
|
71
|
+
remediation: 'Reconcile the current setup artifacts and wait for their durable plan marker before committing state.',
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
for (const expected of expectation.workloads) {
|
|
75
|
+
const identity = workloadIdentity(expected.kind, expected.name);
|
|
76
|
+
const observed = observedByIdentity.get(identity);
|
|
77
|
+
if (observed === undefined) {
|
|
78
|
+
issues.push({
|
|
79
|
+
code: readiness_1.InstallationReadinessIssueCode.MissingWorkload,
|
|
80
|
+
workload: identity,
|
|
81
|
+
message: `Expected Kubernetes ${identity} is missing.`,
|
|
82
|
+
remediation: 'Inspect the matching Helm release and Kubernetes events, then reconcile the setup artifacts.',
|
|
83
|
+
});
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
const currentGeneration = observed.kind === KubernetesWorkloadKind.Job ||
|
|
87
|
+
observed.observedGeneration === observed.generation;
|
|
88
|
+
const resourceReady = kubernetesResourceReady(expected, observed);
|
|
89
|
+
workloads.push({
|
|
90
|
+
name: identity,
|
|
91
|
+
state: currentGeneration && resourceReady ? 'ready' : 'unhealthy',
|
|
92
|
+
expected: true,
|
|
93
|
+
checks: {
|
|
94
|
+
generation: observed.generation,
|
|
95
|
+
...(observed.observedGeneration === undefined
|
|
96
|
+
? {}
|
|
97
|
+
: { observedGeneration: observed.observedGeneration }),
|
|
98
|
+
...(observed.rolloutIdentity === undefined
|
|
99
|
+
? {}
|
|
100
|
+
: { rolloutIdentity: observed.rolloutIdentity }),
|
|
101
|
+
...(observed.artifactIdentity === undefined
|
|
102
|
+
? {}
|
|
103
|
+
: { artifactIdentity: observed.artifactIdentity }),
|
|
104
|
+
resourceReady,
|
|
105
|
+
},
|
|
106
|
+
});
|
|
107
|
+
if (!currentGeneration) {
|
|
108
|
+
issues.push({
|
|
109
|
+
code: readiness_1.InstallationReadinessIssueCode.GenerationNotObserved,
|
|
110
|
+
workload: identity,
|
|
111
|
+
message: `${identity} has not observed generation ${String(observed.generation)}.`,
|
|
112
|
+
remediation: 'Inspect controller events and wait for the current rollout to be observed before committing applied state.',
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
appendResourceIssues(expected, observed, issues);
|
|
116
|
+
if (expected.serviceName !== undefined) {
|
|
117
|
+
if (!services.has(expected.serviceName)) {
|
|
118
|
+
issues.push({
|
|
119
|
+
code: readiness_1.InstallationReadinessIssueCode.ServiceMissing,
|
|
120
|
+
workload: identity,
|
|
121
|
+
message: `Service ${expected.serviceName} for ${identity} is missing.`,
|
|
122
|
+
remediation: 'Reconcile the workload artifact that declares the Kubernetes Service.',
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
if ((observation.endpointReadyAddresses[expected.serviceName] ?? 0) < 1) {
|
|
126
|
+
issues.push({
|
|
127
|
+
code: readiness_1.InstallationReadinessIssueCode.EndpointsMissing,
|
|
128
|
+
workload: identity,
|
|
129
|
+
message: `Service ${expected.serviceName} has no ready endpoint addresses.`,
|
|
130
|
+
remediation: 'Inspect pod readiness, Service selectors, and EndpointSlice state.',
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
for (const observed of observation.workloads) {
|
|
136
|
+
const identity = workloadIdentity(observed.kind, observed.name);
|
|
137
|
+
if (!expectedByIdentity.has(identity)) {
|
|
138
|
+
workloads.push({
|
|
139
|
+
name: identity,
|
|
140
|
+
state: 'unexpected',
|
|
141
|
+
expected: false,
|
|
142
|
+
checks: {
|
|
143
|
+
generation: observed.generation,
|
|
144
|
+
...(observed.observedGeneration === undefined
|
|
145
|
+
? {}
|
|
146
|
+
: { observedGeneration: observed.observedGeneration }),
|
|
147
|
+
},
|
|
148
|
+
});
|
|
149
|
+
issues.push({
|
|
150
|
+
code: readiness_1.InstallationReadinessIssueCode.UnexpectedWorkload,
|
|
151
|
+
workload: identity,
|
|
152
|
+
message: `Managed Kubernetes ${identity} is not declared by the distribution roster or setup artifacts.`,
|
|
153
|
+
remediation: 'Review the selected distribution and rendered setup artifacts, then remove stale managed resources.',
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
const expectedServices = new Set(expectation.workloads.flatMap((workload) => workload.serviceName === undefined ? [] : [workload.serviceName]));
|
|
158
|
+
for (const service of services) {
|
|
159
|
+
if (!expectedServices.has(service)) {
|
|
160
|
+
issues.push({
|
|
161
|
+
code: readiness_1.InstallationReadinessIssueCode.UnexpectedWorkload,
|
|
162
|
+
workload: `Service/${service}`,
|
|
163
|
+
message: `Managed Kubernetes Service/${service} is not declared by the readiness expectation.`,
|
|
164
|
+
remediation: 'Remove the stale managed Service or restore it to the artifact-derived expectation.',
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
for (const endpointName of Object.keys(observation.endpointReadyAddresses)) {
|
|
169
|
+
if (!expectedServices.has(endpointName)) {
|
|
170
|
+
issues.push({
|
|
171
|
+
code: readiness_1.InstallationReadinessIssueCode.UnexpectedWorkload,
|
|
172
|
+
workload: `Endpoints/${endpointName}`,
|
|
173
|
+
message: `Managed Kubernetes Endpoints/${endpointName} is not declared by the readiness expectation.`,
|
|
174
|
+
remediation: 'Remove stale endpoint resources after reconciling their owning Service.',
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
for (const marker of expectation.bootstrapMarkers) {
|
|
179
|
+
if (!markers.has(marker)) {
|
|
180
|
+
issues.push({
|
|
181
|
+
code: readiness_1.InstallationReadinessIssueCode.BootstrapMarkerMissing,
|
|
182
|
+
message: `Bootstrap marker ${marker} is missing.`,
|
|
183
|
+
remediation: 'Inspect the bootstrap Job and do not commit applied state until its durable marker exists.',
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
appendNamedCheckIssues(expectation.smokeChecks, observation.smokeChecks, readiness_1.InstallationReadinessIssueCode.SmokeCheckFailed, 'smoke check', issues);
|
|
188
|
+
appendNamedCheckIssues(expectation.backupPrerequisites, observation.backupPrerequisites, readiness_1.InstallationReadinessIssueCode.BackupPrerequisiteMissing, 'backup prerequisite', issues);
|
|
189
|
+
return {
|
|
190
|
+
substrate: schema_1.Substrate.Helm,
|
|
191
|
+
effectivePlanHash: observation.effectivePlanHash,
|
|
192
|
+
expectedWorkloads: expectation.workloads.map((workload) => workloadIdentity(workload.kind, workload.name)),
|
|
193
|
+
ready: issues.length === 0,
|
|
194
|
+
workloads,
|
|
195
|
+
issues,
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
function assertValidObservation(observation) {
|
|
199
|
+
if (observation.namespace.length === 0 ||
|
|
200
|
+
observation.installationId.length === 0 ||
|
|
201
|
+
observation.effectivePlanHash.length === 0) {
|
|
202
|
+
throw new Error('Kubernetes readiness observation is missing namespace, installation, or plan scope.');
|
|
203
|
+
}
|
|
204
|
+
for (const workload of observation.workloads) {
|
|
205
|
+
const counters = [
|
|
206
|
+
['generation', workload.generation],
|
|
207
|
+
['observedGeneration', workload.observedGeneration],
|
|
208
|
+
['desiredReplicas', workload.desiredReplicas],
|
|
209
|
+
['readyReplicas', workload.readyReplicas],
|
|
210
|
+
['updatedReplicas', workload.updatedReplicas],
|
|
211
|
+
['availableReplicas', workload.availableReplicas],
|
|
212
|
+
['succeeded', workload.succeeded],
|
|
213
|
+
['failed', workload.failed],
|
|
214
|
+
];
|
|
215
|
+
for (const [field, value] of counters) {
|
|
216
|
+
if (value !== undefined &&
|
|
217
|
+
(!Number.isSafeInteger(value) || value < 0)) {
|
|
218
|
+
throw new Error(`Kubernetes readiness observation has invalid ${field} for ${workloadIdentity(workload.kind, workload.name)}.`);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
if (workload.kind !== KubernetesWorkloadKind.Job &&
|
|
222
|
+
workload.observedGeneration === undefined) {
|
|
223
|
+
throw new Error(`Kubernetes readiness observation has no observedGeneration for ${workloadIdentity(workload.kind, workload.name)}.`);
|
|
224
|
+
}
|
|
225
|
+
if (workload.kind === KubernetesWorkloadKind.Job &&
|
|
226
|
+
(workload.artifactIdentity === undefined ||
|
|
227
|
+
workload.artifactIdentity.length === 0)) {
|
|
228
|
+
throw new Error(`Kubernetes readiness observation has no artifact identity for ${workloadIdentity(workload.kind, workload.name)}.`);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
for (const [name, count] of Object.entries(observation.endpointReadyAddresses)) {
|
|
232
|
+
if (!Number.isSafeInteger(count) || count < 0) {
|
|
233
|
+
throw new Error(`Kubernetes readiness observation has invalid ready endpoint count for ${name}.`);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
function kubernetesResourceReady(expected, workload) {
|
|
238
|
+
switch (workload.kind) {
|
|
239
|
+
case KubernetesWorkloadKind.Deployment:
|
|
240
|
+
return (expected.replicas !== undefined &&
|
|
241
|
+
expected.replicas > 0 &&
|
|
242
|
+
workload.desiredReplicas === expected.replicas &&
|
|
243
|
+
workload.updatedReplicas === expected.replicas &&
|
|
244
|
+
workload.readyReplicas === expected.replicas &&
|
|
245
|
+
workload.availableReplicas === expected.replicas &&
|
|
246
|
+
workload.rolloutIdentity === expected.rolloutIdentity);
|
|
247
|
+
case KubernetesWorkloadKind.StatefulSet:
|
|
248
|
+
return (expected.replicas !== undefined &&
|
|
249
|
+
expected.replicas > 0 &&
|
|
250
|
+
workload.desiredReplicas === expected.replicas &&
|
|
251
|
+
workload.updatedReplicas === expected.replicas &&
|
|
252
|
+
workload.readyReplicas === expected.replicas &&
|
|
253
|
+
workload.availableReplicas === expected.replicas &&
|
|
254
|
+
workload.rolloutIdentity === expected.rolloutIdentity &&
|
|
255
|
+
workload.currentRevision === expected.controllerRevision &&
|
|
256
|
+
workload.updateRevision === expected.controllerRevision);
|
|
257
|
+
case KubernetesWorkloadKind.Job:
|
|
258
|
+
return ((workload.failed ?? 0) === 0 &&
|
|
259
|
+
(workload.succeeded ?? 0) >=
|
|
260
|
+
(expected.successfulCompletions ?? 1) &&
|
|
261
|
+
workload.artifactIdentity === expected.artifactIdentity);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
function appendResourceIssues(expected, workload, issues) {
|
|
265
|
+
const identity = workloadIdentity(workload.kind, workload.name);
|
|
266
|
+
switch (workload.kind) {
|
|
267
|
+
case KubernetesWorkloadKind.Deployment:
|
|
268
|
+
case KubernetesWorkloadKind.StatefulSet:
|
|
269
|
+
if (expected.replicas === undefined ||
|
|
270
|
+
expected.replicas < 1 ||
|
|
271
|
+
workload.desiredReplicas !== expected.replicas ||
|
|
272
|
+
workload.updatedReplicas !== expected.replicas ||
|
|
273
|
+
workload.readyReplicas !== expected.replicas ||
|
|
274
|
+
workload.availableReplicas !== expected.replicas) {
|
|
275
|
+
issues.push({
|
|
276
|
+
code: readiness_1.InstallationReadinessIssueCode.ReplicasNotReady,
|
|
277
|
+
workload: identity,
|
|
278
|
+
message: `${identity} has desired=${String(workload.desiredReplicas ?? 0)}, updated=${String(workload.updatedReplicas ?? 0)}, ready=${String(workload.readyReplicas ?? 0)}, available=${String(workload.availableReplicas ?? 0)}; expected exactly ${String(expected.replicas ?? 0)}.`,
|
|
279
|
+
remediation: 'Inspect pod status, readiness probes, scheduling, and rollout events.',
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
if (workload.rolloutIdentity !== expected.rolloutIdentity ||
|
|
283
|
+
(workload.kind === KubernetesWorkloadKind.StatefulSet &&
|
|
284
|
+
(workload.currentRevision !== expected.controllerRevision ||
|
|
285
|
+
workload.updateRevision !== expected.controllerRevision))) {
|
|
286
|
+
issues.push({
|
|
287
|
+
code: readiness_1.InstallationReadinessIssueCode.PlanIdentityMismatch,
|
|
288
|
+
workload: identity,
|
|
289
|
+
message: `${identity} is serving an old pod-template/controller revision.`,
|
|
290
|
+
remediation: 'Wait for every updated replica and controller revision to match the artifact-derived rollout identity.',
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
return;
|
|
294
|
+
case KubernetesWorkloadKind.Job:
|
|
295
|
+
if (workload.artifactIdentity !== expected.artifactIdentity) {
|
|
296
|
+
issues.push({
|
|
297
|
+
code: readiness_1.InstallationReadinessIssueCode.PlanIdentityMismatch,
|
|
298
|
+
workload: identity,
|
|
299
|
+
message: `${identity} completed for a different rendered artifact identity.`,
|
|
300
|
+
remediation: 'Recreate the Job from the current plan-bound artifact and require that exact identity before accepting completion.',
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
if ((workload.failed ?? 0) > 0) {
|
|
304
|
+
issues.push({
|
|
305
|
+
code: readiness_1.InstallationReadinessIssueCode.JobFailed,
|
|
306
|
+
workload: identity,
|
|
307
|
+
message: `${identity} reports ${String(workload.failed)} failed execution(s).`,
|
|
308
|
+
remediation: 'Inspect the Job logs and failure condition before retrying bootstrap.',
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
else if ((workload.succeeded ?? 0) <
|
|
312
|
+
(expected.successfulCompletions ?? 1)) {
|
|
313
|
+
issues.push({
|
|
314
|
+
code: readiness_1.InstallationReadinessIssueCode.JobNotComplete,
|
|
315
|
+
workload: identity,
|
|
316
|
+
message: `${identity} has not completed successfully.`,
|
|
317
|
+
remediation: 'Wait for the Job completion condition and inspect its events if it remains pending.',
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
function appendNamedCheckIssues(expected, observed, code, label, issues) {
|
|
323
|
+
for (const name of expected) {
|
|
324
|
+
if (observed[name] !== true) {
|
|
325
|
+
issues.push({
|
|
326
|
+
code,
|
|
327
|
+
message: `Required ${label} ${name} did not pass.`,
|
|
328
|
+
remediation: `Resolve ${label} ${name} and rerun readiness proof before committing applied state.`,
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
function assertUniqueExpectedIdentities(expectation) {
|
|
334
|
+
if (expectation.namespace.length === 0 ||
|
|
335
|
+
expectation.installationId.length === 0 ||
|
|
336
|
+
expectation.effectivePlanHash.length === 0) {
|
|
337
|
+
throw new Error('Kubernetes readiness expectation is missing namespace, installation, or plan scope.');
|
|
338
|
+
}
|
|
339
|
+
if (expectation.workloads.length === 0) {
|
|
340
|
+
throw new Error('Kubernetes readiness expectation must declare at least one workload.');
|
|
341
|
+
}
|
|
342
|
+
const identities = expectation.workloads.map((workload) => workloadIdentity(workload.kind, workload.name));
|
|
343
|
+
if (new Set(identities).size !== identities.length) {
|
|
344
|
+
throw new Error('Kubernetes readiness expectation contains duplicate workload identities.');
|
|
345
|
+
}
|
|
346
|
+
for (const workload of expectation.workloads) {
|
|
347
|
+
if (workload.kind === KubernetesWorkloadKind.Job
|
|
348
|
+
? workload.successfulCompletions === undefined ||
|
|
349
|
+
workload.successfulCompletions < 1 ||
|
|
350
|
+
workload.replicas !== undefined ||
|
|
351
|
+
workload.rolloutIdentity !== undefined ||
|
|
352
|
+
workload.controllerRevision !== undefined ||
|
|
353
|
+
workload.artifactIdentity === undefined ||
|
|
354
|
+
workload.artifactIdentity.length === 0
|
|
355
|
+
: workload.replicas === undefined ||
|
|
356
|
+
workload.replicas < 1 ||
|
|
357
|
+
workload.successfulCompletions !== undefined ||
|
|
358
|
+
workload.artifactIdentity !== undefined ||
|
|
359
|
+
workload.rolloutIdentity === undefined ||
|
|
360
|
+
workload.rolloutIdentity.length === 0 ||
|
|
361
|
+
(workload.kind === KubernetesWorkloadKind.StatefulSet
|
|
362
|
+
? workload.controllerRevision === undefined ||
|
|
363
|
+
workload.controllerRevision.length === 0
|
|
364
|
+
: workload.controllerRevision !== undefined)) {
|
|
365
|
+
throw new Error(`Kubernetes readiness expectation has invalid scale/completion evidence for ${workloadIdentity(workload.kind, workload.name)}.`);
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
for (const [label, values] of [
|
|
369
|
+
['bootstrap marker', expectation.bootstrapMarkers],
|
|
370
|
+
['smoke check', expectation.smokeChecks],
|
|
371
|
+
['backup prerequisite', expectation.backupPrerequisites],
|
|
372
|
+
]) {
|
|
373
|
+
if (values.length === 0) {
|
|
374
|
+
throw new Error(`Kubernetes readiness expectation must declare at least one ${label}.`);
|
|
375
|
+
}
|
|
376
|
+
if (new Set(values).size !== values.length) {
|
|
377
|
+
throw new Error(`Kubernetes readiness expectation contains duplicate ${label} identities.`);
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
function workloadIdentity(kind, name) {
|
|
382
|
+
return `${kind}/${name}`;
|
|
383
|
+
}
|
|
384
|
+
//# sourceMappingURL=kubernetes-readiness.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kubernetes-readiness.js","sourceRoot":"","sources":["../../../src/runtime/installation/kubernetes-readiness.ts"],"names":[],"mappings":";;;AAkFA,oFAQC;AAOD,kGAgCC;AAED,kEA6MC;AAhVD,6CAA6C;AAC7C,4CAA+C;AAC/C,2CAKqB;AAIrB,IAAY,sBAIX;AAJD,WAAY,sBAAsB;IAChC,mDAAyB,CAAA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AAM,KAAK,CAAC,EAAE,CAAC;YACxB,MAAM,IAAI,KAAK,CACb,8DAA8D,KAAK,GAAG,CACvE,CAAC;QACJ,CAAC;QACD,IAAI,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,MAAM,EAAE,CAAC;YAC3C,MAAM,IAAI,KAAK,CACb,uDAAuD,KAAK,cAAc,CAC3E,CAAC;QACJ,CAAC;IACH,CAAC;AACH,CAAC;AAED,SAAS,gBAAgB,CACvB,IAA4B,EAC5B,IAAY;IAEZ,OAAO,GAAG,IAAI,IAAI,IAAI,EAAE,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type CompiledXemaInstallation } from './compiler';
|
|
2
|
+
import { type InstallationPlanDiff, type InstallationRenderAcknowledgement } from './diff';
|
|
3
|
+
import { type CurrentConfigInstallationContext } from './from-current-config';
|
|
4
|
+
import { type InstallationReadinessProof } from './readiness';
|
|
5
|
+
import { type XemaConfig } from '../config/schema';
|
|
6
|
+
import type { InstallationStateStore } from './state-store';
|
|
7
|
+
export interface InstallationPlanResult {
|
|
8
|
+
readonly desired: CompiledXemaInstallation;
|
|
9
|
+
readonly applied?: CompiledXemaInstallation;
|
|
10
|
+
readonly diff: InstallationPlanDiff;
|
|
11
|
+
}
|
|
12
|
+
export interface InstallationApplyOptions {
|
|
13
|
+
readonly allowDestructive?: boolean;
|
|
14
|
+
readonly forceExecution?: boolean;
|
|
15
|
+
readonly renderedArtifacts: readonly InstallationRenderAcknowledgement[];
|
|
16
|
+
}
|
|
17
|
+
export interface InstallationApplyResult extends InstallationPlanResult {
|
|
18
|
+
readonly executed: boolean;
|
|
19
|
+
}
|
|
20
|
+
export type InstallationExecutor = (onReady: (proof: InstallationReadinessProof) => Promise<void>) => Promise<void>;
|
|
21
|
+
export declare function installationContext(installationIdentity: string): CurrentConfigInstallationContext;
|
|
22
|
+
export declare function compileCurrentInstallation(config: XemaConfig, installationIdentity: string): CompiledXemaInstallation;
|
|
23
|
+
export declare function planInstallation(desired: CompiledXemaInstallation, store: InstallationStateStore): InstallationPlanResult;
|
|
24
|
+
export declare function applyInstallation(desired: CompiledXemaInstallation, store: InstallationStateStore, executor: InstallationExecutor, opts: InstallationApplyOptions): Promise<InstallationApplyResult>;
|
|
25
|
+
//# sourceMappingURL=lifecycle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../../../src/runtime/installation/lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,wBAAwB,EAC9B,MAAM,YAAY,CAAC;AAEpB,OAAO,EAIL,KAAK,oBAAoB,EACzB,KAAK,iCAAiC,EACvC,MAAM,QAAQ,CAAC;AAChB,OAAO,EAEL,KAAK,gCAAgC,EACtC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAEL,KAAK,0BAA0B,EAChC,MAAM,aAAa,CAAC;AAErB,OAAO,EAAa,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAE5D,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,OAAO,EAAE,wBAAwB,CAAC;IAC3C,QAAQ,CAAC,OAAO,CAAC,EAAE,wBAAwB,CAAC;IAC5C,QAAQ,CAAC,IAAI,EAAE,oBAAoB,CAAC;CACrC;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IACpC,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAClC,QAAQ,CAAC,iBAAiB,EAAE,SAAS,iCAAiC,EAAE,CAAC;CAC1E;AAED,MAAM,WAAW,uBAAwB,SAAQ,sBAAsB;IACrE,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,MAAM,oBAAoB,GAAG,CACjC,OAAO,EAAE,CAAC,KAAK,EAAE,0BAA0B,KAAK,OAAO,CAAC,IAAI,CAAC,KAC1D,OAAO,CAAC,IAAI,CAAC,CAAC;AAEnB,wBAAgB,mBAAmB,CACjC,oBAAoB,EAAE,MAAM,GAC3B,gCAAgC,CAIlC;AAED,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,UAAU,EAClB,oBAAoB,EAAE,MAAM,GAC3B,wBAAwB,CAO1B;AAED,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,wBAAwB,EACjC,KAAK,EAAE,sBAAsB,GAC5B,sBAAsB,CA2BxB;AAED,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,wBAAwB,EACjC,KAAK,EAAE,sBAAsB,EAC7B,QAAQ,EAAE,oBAAoB,EAC9B,IAAI,EAAE,wBAAwB,GAC7B,OAAO,CAAC,uBAAuB,CAAC,CAqDlC"}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.installationContext = installationContext;
|
|
4
|
+
exports.compileCurrentInstallation = compileCurrentInstallation;
|
|
5
|
+
exports.planInstallation = planInstallation;
|
|
6
|
+
exports.applyInstallation = applyInstallation;
|
|
7
|
+
const compiler_1 = require("./compiler");
|
|
8
|
+
const contract_1 = require("./contract");
|
|
9
|
+
const diff_1 = require("./diff");
|
|
10
|
+
const from_current_config_1 = require("./from-current-config");
|
|
11
|
+
const readiness_1 = require("./readiness");
|
|
12
|
+
const serialization_1 = require("./serialization");
|
|
13
|
+
const schema_1 = require("../config/schema");
|
|
14
|
+
function installationContext(installationIdentity) {
|
|
15
|
+
return {
|
|
16
|
+
installationId: `local-${(0, serialization_1.hashInstallation)(installationIdentity).slice(0, 20)}`,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function compileCurrentInstallation(config, installationIdentity) {
|
|
20
|
+
return (0, compiler_1.compileXemaInstallation)((0, from_current_config_1.installationFromCurrentConfig)(config, installationContext(installationIdentity)));
|
|
21
|
+
}
|
|
22
|
+
function planInstallation(desired, store) {
|
|
23
|
+
const appliedState = store.read(desired.metadata.name);
|
|
24
|
+
const applied = appliedState?.plan;
|
|
25
|
+
return {
|
|
26
|
+
desired,
|
|
27
|
+
...(applied === undefined ? {} : { applied }),
|
|
28
|
+
diff: applied === undefined
|
|
29
|
+
? {
|
|
30
|
+
classification: diff_1.InstallationChangeClass.RequiresRollout,
|
|
31
|
+
renderObligations: [
|
|
32
|
+
diff_1.InstallationRenderObligation.RuntimeReconfigure,
|
|
33
|
+
diff_1.InstallationRenderObligation.WorkloadRollout,
|
|
34
|
+
diff_1.InstallationRenderObligation.InfrastructureReconcile,
|
|
35
|
+
diff_1.InstallationRenderObligation.DataAndRecoveryReconcile,
|
|
36
|
+
],
|
|
37
|
+
changes: [
|
|
38
|
+
{
|
|
39
|
+
path: '<installation>',
|
|
40
|
+
classification: diff_1.InstallationChangeClass.RequiresRollout,
|
|
41
|
+
renderObligation: diff_1.InstallationRenderObligation.InfrastructureReconcile,
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
}
|
|
45
|
+
: (0, diff_1.diffInstallationPlans)(applied, desired),
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
async function applyInstallation(desired, store, executor, opts) {
|
|
49
|
+
assertApplyProfileSupported(desired.spec.profile);
|
|
50
|
+
const releaseLocalRuntime = store.acquireLocalRuntimeLock();
|
|
51
|
+
let release;
|
|
52
|
+
let ready = false;
|
|
53
|
+
try {
|
|
54
|
+
release = store.acquireApplyLock(desired.metadata.name);
|
|
55
|
+
const planned = planInstallation(desired, store);
|
|
56
|
+
assertChangeAuthorized(planned.diff, opts);
|
|
57
|
+
assertRenderAcknowledged(planned.diff, desired, opts.renderedArtifacts);
|
|
58
|
+
if (planned.diff.changes.length === 0 && opts.forceExecution !== true) {
|
|
59
|
+
return { ...planned, executed: false };
|
|
60
|
+
}
|
|
61
|
+
if (desired.spec.profile === contract_1.InstallationProfile.Starter) {
|
|
62
|
+
store.claimLocalRuntimeOwner(desired.metadata.name);
|
|
63
|
+
}
|
|
64
|
+
await executor(async (proof) => {
|
|
65
|
+
if (ready) {
|
|
66
|
+
throw new Error('Installation executor reported readiness more than once.');
|
|
67
|
+
}
|
|
68
|
+
if (proof.substrate !== substrateForProfile(desired.spec.profile)) {
|
|
69
|
+
throw new Error(`Installation readiness proof used substrate ${proof.substrate}, expected ${substrateForProfile(desired.spec.profile)} for profile ${desired.spec.profile}.`);
|
|
70
|
+
}
|
|
71
|
+
(0, readiness_1.assertInstallationReady)(proof);
|
|
72
|
+
if (proof.effectivePlanHash !== desired.effectivePlanHash) {
|
|
73
|
+
throw new Error('Installation readiness proof is bound to a different effective plan.');
|
|
74
|
+
}
|
|
75
|
+
store.write(desired, opts.renderedArtifacts);
|
|
76
|
+
ready = true;
|
|
77
|
+
});
|
|
78
|
+
if (!ready) {
|
|
79
|
+
throw new Error('Installation executor completed without reporting a ready installation.');
|
|
80
|
+
}
|
|
81
|
+
return { ...planned, executed: true };
|
|
82
|
+
}
|
|
83
|
+
finally {
|
|
84
|
+
try {
|
|
85
|
+
release?.();
|
|
86
|
+
}
|
|
87
|
+
finally {
|
|
88
|
+
releaseLocalRuntime();
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
function assertApplyProfileSupported(profile) {
|
|
93
|
+
switch (profile) {
|
|
94
|
+
case contract_1.InstallationProfile.Developer:
|
|
95
|
+
case contract_1.InstallationProfile.Starter:
|
|
96
|
+
case contract_1.InstallationProfile.SingleNodeProduction:
|
|
97
|
+
return;
|
|
98
|
+
case contract_1.InstallationProfile.BusinessHa:
|
|
99
|
+
case contract_1.InstallationProfile.EnterpriseRegulated:
|
|
100
|
+
case contract_1.InstallationProfile.HostedCell:
|
|
101
|
+
throw new Error(`Installation apply does not support profile ${profile}; its dedicated renderer and executor are unavailable.`);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
function substrateForProfile(profile) {
|
|
105
|
+
switch (profile) {
|
|
106
|
+
case contract_1.InstallationProfile.Developer:
|
|
107
|
+
return schema_1.Substrate.Native;
|
|
108
|
+
case contract_1.InstallationProfile.Starter:
|
|
109
|
+
return schema_1.Substrate.Container;
|
|
110
|
+
case contract_1.InstallationProfile.SingleNodeProduction:
|
|
111
|
+
case contract_1.InstallationProfile.BusinessHa:
|
|
112
|
+
case contract_1.InstallationProfile.EnterpriseRegulated:
|
|
113
|
+
case contract_1.InstallationProfile.HostedCell:
|
|
114
|
+
return schema_1.Substrate.Helm;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
function assertRenderAcknowledged(diff, desired, acknowledgements) {
|
|
118
|
+
const byObligation = new Map();
|
|
119
|
+
for (const acknowledgement of acknowledgements) {
|
|
120
|
+
if (byObligation.has(acknowledgement.obligation)) {
|
|
121
|
+
throw new Error(`Installation renderer acknowledged ${acknowledgement.obligation} more than once.`);
|
|
122
|
+
}
|
|
123
|
+
if (acknowledgement.effectivePlanHash !== desired.effectivePlanHash) {
|
|
124
|
+
throw new Error(`Installation renderer acknowledgement for ${acknowledgement.obligation} is bound to a different effective plan.`);
|
|
125
|
+
}
|
|
126
|
+
if (!/^sha256:[a-f0-9]{64}$/.test(acknowledgement.artifactDigest)) {
|
|
127
|
+
throw new Error(`Installation renderer acknowledgement for ${acknowledgement.obligation} has an invalid artifact digest.`);
|
|
128
|
+
}
|
|
129
|
+
if (acknowledgement.rendererId.length === 0) {
|
|
130
|
+
throw new Error('Installation renderer id must not be empty.');
|
|
131
|
+
}
|
|
132
|
+
byObligation.set(acknowledgement.obligation, acknowledgement);
|
|
133
|
+
}
|
|
134
|
+
const materialObligations = [
|
|
135
|
+
...new Set([
|
|
136
|
+
diff_1.InstallationRenderObligation.RuntimeReconfigure,
|
|
137
|
+
diff_1.InstallationRenderObligation.WorkloadRollout,
|
|
138
|
+
diff_1.InstallationRenderObligation.InfrastructureReconcile,
|
|
139
|
+
diff_1.InstallationRenderObligation.DataAndRecoveryReconcile,
|
|
140
|
+
...diff.renderObligations,
|
|
141
|
+
]),
|
|
142
|
+
];
|
|
143
|
+
const missing = materialObligations.filter((obligation) => !byObligation.has(obligation));
|
|
144
|
+
if (missing.length > 0) {
|
|
145
|
+
throw new Error(`Installation renderer did not fulfill material obligations: ${missing.join(', ')}.`);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
function assertChangeAuthorized(diff, opts) {
|
|
149
|
+
if (diff.classification === diff_1.InstallationChangeClass.Rejected) {
|
|
150
|
+
throw new Error('Installation apply rejected this identity/schema transition. Create a distinct installation or restore the previous desired state.');
|
|
151
|
+
}
|
|
152
|
+
if (diff.classification === diff_1.InstallationChangeClass.Destructive &&
|
|
153
|
+
opts.allowDestructive !== true) {
|
|
154
|
+
throw new Error('Installation plan contains destructive changes. Re-run with --allow-destructive after reviewing the plan.');
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
//# sourceMappingURL=lifecycle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifecycle.js","sourceRoot":"","sources":["../../../src/runtime/installation/lifecycle.ts"],"names":[],"mappings":";;AA6CA,kDAMC;AAED,gEAUC;AAED,4CA8BC;AAED,8CA0DC;AA3JD,yCAGoB;AACpB,yCAAiD;AACjD,iCAMgB;AAChB,+DAG+B;AAC/B,2CAGqB;AACrB,mDAAmD;AACnD,6CAA8D;AAwB9D,SAAgB,mBAAmB,CACjC,oBAA4B;IAE5B,OAAO;QACL,cAAc,EAAE,SAAS,IAAA,gCAAgB,EAAC,oBAAoB,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE;KAC/E,CAAC;AACJ,CAAC;AAED,SAAgB,0BAA0B,CACxC,MAAkB,EAClB,oBAA4B;IAE5B,OAAO,IAAA,kCAAuB,EAC5B,IAAA,mDAA6B,EAC3B,MAAM,EACN,mBAAmB,CAAC,oBAAoB,CAAC,CAC1C,CACF,CAAC;AACJ,CAAC;AAED,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