@intentius/chant-lexicon-k8s 0.124.97 → 0.124.99
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/dist/actions/apps.d.ts +0 -1
- package/dist/actions/batch.d.ts +0 -1
- package/dist/actions/core.d.ts +0 -1
- package/dist/actions/index.d.ts +0 -1
- package/dist/actions/networking.d.ts +0 -1
- package/dist/actions/rbac.d.ts +0 -1
- package/dist/api/classify.d.ts +0 -1
- package/dist/api/connect.d.ts +0 -1
- package/dist/api/fake-cluster.d.ts +0 -1
- package/dist/api/operation-surface.d.ts +0 -1
- package/dist/api/owner-chain.d.ts +0 -1
- package/dist/api/sweep-types.d.ts +0 -1
- package/dist/application-paths.d.ts +3 -0
- package/dist/application-paths.js +95 -0
- package/dist/application-set.d.ts +45 -0
- package/dist/application-set.js +303 -0
- package/dist/behaviour-kinds.d.ts +0 -1
- package/dist/cluster-secret.d.ts +35 -0
- package/dist/cluster-secret.js +55 -0
- package/dist/codegen/docs-cli.d.ts +0 -1
- package/dist/codegen/docs.d.ts +0 -1
- package/dist/codegen/generate-cli.d.ts +0 -1
- package/dist/codegen/generate-lexicon.d.ts +7 -1
- package/dist/codegen/generate-lexicon.js +2 -0
- package/dist/codegen/generate-list-map-keys.d.ts +0 -1
- package/dist/codegen/generate-operations.d.ts +0 -1
- package/dist/codegen/generate-typescript.d.ts +0 -1
- package/dist/codegen/generate.d.ts +0 -1
- package/dist/codegen/naming.d.ts +0 -1
- package/dist/codegen/package.d.ts +0 -1
- package/dist/codegen/patches.d.ts +0 -1
- package/dist/codegen/typecheck.d.ts +0 -1
- package/dist/codegen/versions.d.ts +0 -1
- package/dist/components/argo-app.d.ts +0 -1
- package/dist/components/builders.d.ts +0 -1
- package/dist/components/capability-plugin.d.ts +0 -1
- package/dist/components/flux-reconcile.d.ts +0 -1
- package/dist/components/index.d.ts +0 -1
- package/dist/components/kubectl-apply.d.ts +0 -1
- package/dist/components/kustomize-apply.d.ts +6 -1
- package/dist/components/kustomize-apply.js +1 -1
- package/dist/composites/adot-collector.d.ts +0 -1
- package/dist/composites/agic-ingress.d.ts +0 -1
- package/dist/composites/aks-external-dns-agent.d.ts +0 -1
- package/dist/composites/alb-ingress.d.ts +0 -1
- package/dist/composites/argo-app.d.ts +0 -1
- package/dist/composites/autoscaled-service.d.ts +0 -1
- package/dist/composites/azure-disk-storage-class.d.ts +0 -1
- package/dist/composites/azure-file-storage-class.d.ts +0 -1
- package/dist/composites/azure-monitor-collector.d.ts +0 -1
- package/dist/composites/batch-job.d.ts +0 -1
- package/dist/composites/catalog.d.ts +0 -1
- package/dist/composites/cockroachdb-cluster.d.ts +0 -1
- package/dist/composites/cockroachdb-region-stack.d.ts +0 -1
- package/dist/composites/config-connector-context.d.ts +0 -1
- package/dist/composites/configured-app.d.ts +0 -1
- package/dist/composites/cron-schedule.d.ts +0 -1
- package/dist/composites/cron-workload.d.ts +0 -1
- package/dist/composites/ebs-storage-class.d.ts +0 -1
- package/dist/composites/efs-storage-class.d.ts +0 -1
- package/dist/composites/external-dns-agent.d.ts +0 -1
- package/dist/composites/filestore-storage-class.d.ts +0 -1
- package/dist/composites/fluent-bit-agent.d.ts +0 -1
- package/dist/composites/flux-app.d.ts +0 -1
- package/dist/composites/gce-ingress.d.ts +0 -1
- package/dist/composites/gce-pd-storage-class.d.ts +0 -1
- package/dist/composites/gke-external-dns-agent.d.ts +0 -1
- package/dist/composites/gke-fluent-bit-agent.d.ts +0 -1
- package/dist/composites/gke-gateway.d.ts +0 -1
- package/dist/composites/gke-otel-collector.d.ts +0 -1
- package/dist/composites/index.d.ts +0 -1
- package/dist/composites/inference-service.d.ts +0 -1
- package/dist/composites/irsa-service-account.d.ts +0 -1
- package/dist/composites/member-defaults.d.ts +0 -1
- package/dist/composites/metrics-server.d.ts +0 -1
- package/dist/composites/model.d.ts +0 -1
- package/dist/composites/monitored-service.d.ts +0 -1
- package/dist/composites/namespace-env.d.ts +0 -1
- package/dist/composites/network-isolated-app.d.ts +0 -1
- package/dist/composites/node-agent.d.ts +0 -1
- package/dist/composites/operator-stack.d.ts +0 -1
- package/dist/composites/otel-collector-agent.d.ts +0 -1
- package/dist/composites/otel-collector-gateway.d.ts +0 -1
- package/dist/composites/otel-collector-node.d.ts +0 -1
- package/dist/composites/otel-collector-rbac.d.ts +0 -1
- package/dist/composites/otel-collector-shape.d.ts +0 -1
- package/dist/composites/otel-collector.d.ts +0 -1
- package/dist/composites/otel-operator-collector.d.ts +0 -1
- package/dist/composites/ray-cluster.d.ts +0 -1
- package/dist/composites/ray-job.d.ts +0 -1
- package/dist/composites/ray-service.d.ts +0 -1
- package/dist/composites/secure-ingress.d.ts +0 -1
- package/dist/composites/security-context.d.ts +0 -1
- package/dist/composites/sidecar-app.d.ts +0 -1
- package/dist/composites/stateful-app.d.ts +0 -1
- package/dist/composites/vllm-serving-runtime.d.ts +0 -1
- package/dist/composites/web-app.d.ts +0 -1
- package/dist/composites/worker-pool.d.ts +0 -1
- package/dist/composites/workload-identity-sa.d.ts +0 -1
- package/dist/composites/workload-identity-service-account.d.ts +0 -1
- package/dist/config-schema.d.ts +8 -1
- package/dist/config-schema.js +6 -2
- package/dist/config.d.ts +26 -4
- package/dist/coverage.d.ts +0 -1
- package/dist/crd/crd-sources.d.ts +0 -1
- package/dist/crd/loader.d.ts +0 -1
- package/dist/crd/oci-chart.d.ts +0 -1
- package/dist/crd/parser.d.ts +0 -1
- package/dist/crd/parser.js +3 -0
- package/dist/crd/project-codegen.d.ts +0 -1
- package/dist/crd/types.d.ts +0 -1
- package/dist/deep-observe-hooks.d.ts +0 -1
- package/dist/deep-observe.d.ts +0 -1
- package/dist/default-labels.d.ts +0 -1
- package/dist/describe-resources.d.ts +0 -1
- package/dist/describe-stack-status.d.ts +0 -1
- package/dist/detect.d.ts +0 -1
- package/dist/effect-receipt-row.d.ts +0 -1
- package/dist/export-resources.d.ts +0 -1
- package/dist/generated/index.d.ts +0 -1
- package/{src → dist}/generated/lexicon-k8s.json +1984 -155
- package/dist/generated/runtime.d.ts +0 -1
- package/dist/group-namespace.d.ts +0 -1
- package/dist/helm-references.d.ts +112 -0
- package/dist/helm-references.js +389 -0
- package/dist/import/directory.d.ts +7 -0
- package/dist/import/directory.js +103 -0
- package/dist/import/embedded.d.ts +3 -1
- package/dist/import/embedded.js +34 -0
- package/dist/import/generator.d.ts +13 -5
- package/dist/import/generator.js +43 -57
- package/dist/import/live-export.d.ts +0 -1
- package/dist/import/parser.d.ts +0 -1
- package/dist/import/parser.js +62 -6
- package/dist/import/testdata/embedded/fixtures.d.ts +0 -1
- package/dist/import/typed-classes.d.ts +76 -0
- package/dist/import/typed-classes.js +164 -0
- package/dist/include/entity.d.ts +0 -1
- package/dist/include/resolve.d.ts +0 -1
- package/dist/index-identity.d.ts +0 -1
- package/dist/index-import.d.ts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/integrity.json +44 -42
- package/dist/kube/apply.d.ts +0 -1
- package/dist/kube/connect.d.ts +0 -1
- package/dist/kube/delete.d.ts +0 -1
- package/dist/kube/describe.d.ts +0 -1
- package/dist/kube/events.d.ts +0 -1
- package/dist/kube/flags.d.ts +0 -1
- package/dist/kube/get.d.ts +0 -1
- package/dist/kube/group.d.ts +0 -1
- package/dist/kube/logs.d.ts +0 -1
- package/dist/kube/project.d.ts +0 -1
- package/dist/kube/render.d.ts +0 -1
- package/dist/kube/source.d.ts +0 -1
- package/dist/kube/target.d.ts +0 -1
- package/dist/kube/testing.d.ts +0 -1
- package/dist/kube/top.d.ts +0 -1
- package/dist/kube/verdict.d.ts +0 -1
- package/dist/kube/wait.d.ts +0 -1
- package/dist/kustomize/render.d.ts +41 -3
- package/dist/kustomize/render.js +114 -7
- package/dist/kustomize/rendered-entity.d.ts +0 -1
- package/dist/kustomize/root.d.ts +3 -4
- package/dist/kustomize/root.js +6 -1
- package/dist/lint/audit-catalog.d.ts +0 -1
- package/dist/lint/audit-catalog.js +1 -0
- package/dist/lint/audit-lineage.d.ts +0 -1
- package/dist/lint/post-synth/argo-helpers.d.ts +3 -1
- package/dist/lint/post-synth/argo-helpers.js +8 -2
- package/dist/lint/post-synth/argo002.d.ts +0 -1
- package/dist/lint/post-synth/argo002.js +2 -1
- package/dist/lint/post-synth/argo003.d.ts +0 -1
- package/dist/lint/post-synth/argo003.js +2 -1
- package/dist/lint/post-synth/argo005.d.ts +0 -1
- package/dist/lint/post-synth/argo005.js +36 -9
- package/dist/lint/post-synth/crd-schema-helpers.d.ts +1 -2
- package/dist/lint/post-synth/crd-schema-helpers.js +3 -3
- package/dist/lint/post-synth/flux002.d.ts +0 -1
- package/dist/lint/post-synth/flux002.js +2 -1
- package/dist/lint/post-synth/flux003.d.ts +0 -1
- package/dist/lint/post-synth/flux003.js +2 -1
- package/dist/lint/post-synth/index.d.ts +0 -1
- package/dist/lint/post-synth/index.js +2 -0
- package/dist/lint/post-synth/k8s-helpers.d.ts +32 -1
- package/dist/lint/post-synth/k8s-helpers.js +57 -10
- package/dist/lint/post-synth/monitoring-selection-helpers.d.ts +0 -1
- package/dist/lint/post-synth/otel-placement-helpers.d.ts +0 -1
- package/dist/lint/post-synth/sops-helpers.d.ts +0 -1
- package/dist/lint/post-synth/top-level-fields-helpers.d.ts +16 -0
- package/dist/lint/post-synth/top-level-fields-helpers.js +45 -0
- package/dist/lint/post-synth/wk8005.d.ts +9 -1
- package/dist/lint/post-synth/wk8005.js +53 -3
- package/dist/lint/post-synth/wk8006.d.ts +0 -1
- package/dist/lint/post-synth/wk8006.js +4 -2
- package/dist/lint/post-synth/wk8041.d.ts +0 -1
- package/dist/lint/post-synth/wk8041.js +3 -2
- package/dist/lint/post-synth/wk8042.d.ts +0 -1
- package/dist/lint/post-synth/wk8042.js +2 -2
- package/dist/lint/post-synth/wk8101.d.ts +0 -1
- package/dist/lint/post-synth/wk8101.js +2 -2
- package/dist/lint/post-synth/wk8102.d.ts +0 -1
- package/dist/lint/post-synth/wk8102.js +7 -3
- package/dist/lint/post-synth/wk8103.d.ts +0 -1
- package/dist/lint/post-synth/wk8103.js +3 -2
- package/dist/lint/post-synth/wk8104.d.ts +0 -1
- package/dist/lint/post-synth/wk8104.js +3 -2
- package/dist/lint/post-synth/wk8105.d.ts +0 -1
- package/dist/lint/post-synth/wk8105.js +3 -2
- package/dist/lint/post-synth/wk8201.d.ts +0 -1
- package/dist/lint/post-synth/wk8201.js +3 -2
- package/dist/lint/post-synth/wk8202.d.ts +0 -1
- package/dist/lint/post-synth/wk8202.js +3 -2
- package/dist/lint/post-synth/wk8203.d.ts +0 -1
- package/dist/lint/post-synth/wk8203.js +3 -2
- package/dist/lint/post-synth/wk8204.d.ts +0 -1
- package/dist/lint/post-synth/wk8204.js +5 -2
- package/dist/lint/post-synth/wk8205.d.ts +0 -1
- package/dist/lint/post-synth/wk8205.js +3 -2
- package/dist/lint/post-synth/wk8207.d.ts +0 -1
- package/dist/lint/post-synth/wk8207.js +2 -2
- package/dist/lint/post-synth/wk8208.d.ts +0 -1
- package/dist/lint/post-synth/wk8208.js +2 -2
- package/dist/lint/post-synth/wk8209.d.ts +0 -1
- package/dist/lint/post-synth/wk8209.js +2 -2
- package/dist/lint/post-synth/wk8301.d.ts +0 -1
- package/dist/lint/post-synth/wk8301.js +3 -2
- package/dist/lint/post-synth/wk8302.d.ts +0 -1
- package/dist/lint/post-synth/wk8302.js +2 -2
- package/dist/lint/post-synth/wk8303.d.ts +0 -1
- package/dist/lint/post-synth/wk8303.js +2 -2
- package/dist/lint/post-synth/wk8304.d.ts +0 -1
- package/dist/lint/post-synth/wk8304.js +2 -2
- package/dist/lint/post-synth/wk8305.d.ts +0 -1
- package/dist/lint/post-synth/wk8305.js +2 -2
- package/dist/lint/post-synth/wk8306.d.ts +0 -1
- package/dist/lint/post-synth/wk8306.js +3 -2
- package/dist/lint/post-synth/wk8401.d.ts +0 -1
- package/dist/lint/post-synth/wk8401.js +2 -2
- package/dist/lint/post-synth/wk8402.d.ts +0 -1
- package/dist/lint/post-synth/wk8402.js +2 -2
- package/dist/lint/post-synth/wk8403.d.ts +0 -1
- package/dist/lint/post-synth/wk8403.js +2 -2
- package/dist/lint/post-synth/wk8404.d.ts +0 -1
- package/dist/lint/post-synth/wk8404.js +2 -2
- package/dist/lint/post-synth/wk8405.d.ts +0 -1
- package/dist/lint/post-synth/wk8405.js +2 -2
- package/dist/lint/post-synth/wk8406.d.ts +0 -1
- package/dist/lint/post-synth/wk8406.js +3 -2
- package/dist/lint/post-synth/wk8407.d.ts +0 -1
- package/dist/lint/post-synth/wk8407.js +2 -2
- package/dist/lint/post-synth/wk8501.d.ts +0 -1
- package/dist/lint/post-synth/wk8502.d.ts +0 -1
- package/dist/lint/post-synth/wk8503.d.ts +0 -1
- package/dist/lint/post-synth/wk8503.js +2 -2
- package/dist/lint/post-synth/wk8504.d.ts +0 -1
- package/dist/lint/post-synth/wk8505.d.ts +0 -1
- package/dist/lint/post-synth/wk8506.d.ts +14 -0
- package/dist/lint/post-synth/wk8506.js +38 -0
- package/dist/lint/post-synth/wk8601.d.ts +0 -1
- package/dist/lint/post-synth/wk8602.d.ts +0 -1
- package/dist/lint/post-synth/wk8603.d.ts +0 -1
- package/dist/lint/post-synth/wk8604.d.ts +0 -1
- package/dist/lint/post-synth/wk8605.d.ts +0 -1
- package/dist/lint/post-synth/wk8606.d.ts +0 -1
- package/dist/lint/post-synth/wk8701.d.ts +0 -1
- package/dist/lint/post-synth/wk8702.d.ts +0 -1
- package/dist/lint/post-synth/wk8703.d.ts +0 -1
- package/dist/lint/post-synth/wk8704.d.ts +0 -1
- package/dist/lint/post-synth/wk8705.d.ts +0 -1
- package/dist/lint/rules/argo-appset-single-project.d.ts +0 -1
- package/dist/lint/rules/argo-ast.d.ts +0 -1
- package/dist/lint/rules/argo-automated-prune.d.ts +0 -1
- package/dist/lint/rules/flux-source-ref-pin.d.ts +0 -1
- package/dist/lint/rules/hardcoded-namespace.d.ts +0 -1
- package/dist/lint/rules/latest-image-tag.d.ts +0 -1
- package/dist/lint/rules/missing-resource-limits.d.ts +0 -1
- package/dist/listed-types.d.ts +0 -1
- package/dist/lsp/completions.d.ts +0 -1
- package/dist/lsp/hover.d.ts +0 -1
- package/dist/manifest-entity.d.ts +0 -1
- package/dist/manifest-files.d.ts +16 -0
- package/dist/manifest-files.js +24 -0
- package/dist/manifest.json +1 -1
- package/dist/meta.json +1984 -155
- package/dist/micro-time.d.ts +0 -1
- package/dist/okf/index.md +1 -0
- package/dist/okf/rules/WK8506.md +11 -0
- package/dist/op/activities/apply-diff.d.ts +0 -1
- package/dist/op/activities/argo.d.ts +0 -1
- package/dist/op/activities/ensure-secret.d.ts +0 -1
- package/dist/op/activities/index.d.ts +0 -1
- package/dist/op/activities/kubectl.d.ts +0 -1
- package/dist/op/activities/wait-for-ready.d.ts +0 -1
- package/dist/op/builders.d.ts +0 -1
- package/dist/package-cli.d.ts +0 -1
- package/dist/patch/json-patch.d.ts +0 -1
- package/dist/patch/rendered-patch.d.ts +0 -1
- package/dist/plugin.d.ts +0 -1
- package/dist/plugin.js +2 -0
- package/dist/project-kinds.d.ts +0 -1
- package/dist/receipt-store.d.ts +0 -1
- package/dist/reference-catalog.d.ts +3 -2
- package/dist/reference-catalog.js +283 -15
- package/dist/rules/argo-helpers.ts +9 -2
- package/dist/rules/argo002.ts +2 -1
- package/dist/rules/argo003.ts +2 -1
- package/dist/rules/argo005.ts +36 -10
- package/dist/rules/crd-schema-helpers.ts +3 -3
- package/dist/rules/flux002.ts +2 -1
- package/dist/rules/flux003.ts +2 -1
- package/dist/rules/k8s-helpers.ts +56 -11
- package/dist/rules/top-level-fields-helpers.ts +54 -0
- package/dist/rules/wk8005.ts +56 -3
- package/dist/rules/wk8006.ts +4 -2
- package/dist/rules/wk8041.ts +3 -2
- package/dist/rules/wk8042.ts +2 -2
- package/dist/rules/wk8101.ts +2 -2
- package/dist/rules/wk8102.ts +7 -3
- package/dist/rules/wk8103.ts +3 -2
- package/dist/rules/wk8104.ts +3 -2
- package/dist/rules/wk8105.ts +3 -2
- package/dist/rules/wk8201.ts +3 -2
- package/dist/rules/wk8202.ts +3 -2
- package/dist/rules/wk8203.ts +3 -2
- package/dist/rules/wk8204.ts +5 -2
- package/dist/rules/wk8205.ts +3 -2
- package/dist/rules/wk8207.ts +2 -2
- package/dist/rules/wk8208.ts +2 -2
- package/dist/rules/wk8209.ts +2 -2
- package/dist/rules/wk8301.ts +3 -2
- package/dist/rules/wk8302.ts +2 -2
- package/dist/rules/wk8303.ts +2 -2
- package/dist/rules/wk8304.ts +2 -2
- package/dist/rules/wk8305.ts +2 -2
- package/dist/rules/wk8306.ts +3 -2
- package/dist/rules/wk8401.ts +2 -2
- package/dist/rules/wk8402.ts +2 -2
- package/dist/rules/wk8403.ts +2 -2
- package/dist/rules/wk8404.ts +2 -1
- package/dist/rules/wk8405.ts +2 -2
- package/dist/rules/wk8406.ts +3 -2
- package/dist/rules/wk8407.ts +2 -2
- package/dist/rules/wk8503.ts +2 -2
- package/dist/rules/wk8506.ts +43 -0
- package/dist/secret-labels.d.ts +0 -1
- package/dist/secret-store.d.ts +0 -1
- package/dist/serializer.d.ts +0 -1
- package/dist/sops/encrypted-secret-file.d.ts +0 -1
- package/dist/sops/entity.d.ts +0 -1
- package/dist/spec/fetch.d.ts +0 -1
- package/dist/spec/parse.d.ts +6 -1
- package/dist/spec/parse.js +1 -0
- package/dist/subscribe-changes.d.ts +0 -1
- package/dist/teardown.d.ts +0 -1
- package/dist/telemetry-release.d.ts +0 -1
- package/dist/top-level-fields.d.ts +24 -0
- package/dist/top-level-fields.js +35 -0
- package/dist/validate-cli.d.ts +0 -1
- package/dist/validate.d.ts +0 -1
- package/dist/variables.d.ts +0 -1
- package/dist/whoami.d.ts +0 -1
- package/dist/workspace-member.d.ts +15 -4
- package/dist/workspace-member.js +143 -21
- package/package.json +6 -7
- package/workspace-kinds.json +45 -6
- package/dist/actions/apps.d.ts.map +0 -1
- package/dist/actions/batch.d.ts.map +0 -1
- package/dist/actions/core.d.ts.map +0 -1
- package/dist/actions/index.d.ts.map +0 -1
- package/dist/actions/networking.d.ts.map +0 -1
- package/dist/actions/rbac.d.ts.map +0 -1
- package/dist/api/classify.d.ts.map +0 -1
- package/dist/api/connect.d.ts.map +0 -1
- package/dist/api/fake-cluster.d.ts.map +0 -1
- package/dist/api/operation-surface.d.ts.map +0 -1
- package/dist/api/owner-chain.d.ts.map +0 -1
- package/dist/api/sweep-types.d.ts.map +0 -1
- package/dist/behaviour-kinds.d.ts.map +0 -1
- package/dist/codegen/docs-cli.d.ts.map +0 -1
- package/dist/codegen/docs.d.ts.map +0 -1
- package/dist/codegen/generate-cli.d.ts.map +0 -1
- package/dist/codegen/generate-lexicon.d.ts.map +0 -1
- package/dist/codegen/generate-list-map-keys.d.ts.map +0 -1
- package/dist/codegen/generate-operations.d.ts.map +0 -1
- package/dist/codegen/generate-typescript.d.ts.map +0 -1
- package/dist/codegen/generate.d.ts.map +0 -1
- package/dist/codegen/naming.d.ts.map +0 -1
- package/dist/codegen/package.d.ts.map +0 -1
- package/dist/codegen/patches.d.ts.map +0 -1
- package/dist/codegen/typecheck.d.ts.map +0 -1
- package/dist/codegen/versions.d.ts.map +0 -1
- package/dist/components/argo-app.d.ts.map +0 -1
- package/dist/components/builders.d.ts.map +0 -1
- package/dist/components/capability-plugin.d.ts.map +0 -1
- package/dist/components/flux-reconcile.d.ts.map +0 -1
- package/dist/components/index.d.ts.map +0 -1
- package/dist/components/kubectl-apply.d.ts.map +0 -1
- package/dist/components/kustomize-apply.d.ts.map +0 -1
- package/dist/composites/adot-collector.d.ts.map +0 -1
- package/dist/composites/agic-ingress.d.ts.map +0 -1
- package/dist/composites/aks-external-dns-agent.d.ts.map +0 -1
- package/dist/composites/alb-ingress.d.ts.map +0 -1
- package/dist/composites/argo-app.d.ts.map +0 -1
- package/dist/composites/autoscaled-service.d.ts.map +0 -1
- package/dist/composites/azure-disk-storage-class.d.ts.map +0 -1
- package/dist/composites/azure-file-storage-class.d.ts.map +0 -1
- package/dist/composites/azure-monitor-collector.d.ts.map +0 -1
- package/dist/composites/batch-job.d.ts.map +0 -1
- package/dist/composites/catalog.d.ts.map +0 -1
- package/dist/composites/cockroachdb-cluster.d.ts.map +0 -1
- package/dist/composites/cockroachdb-region-stack.d.ts.map +0 -1
- package/dist/composites/config-connector-context.d.ts.map +0 -1
- package/dist/composites/configured-app.d.ts.map +0 -1
- package/dist/composites/cron-schedule.d.ts.map +0 -1
- package/dist/composites/cron-workload.d.ts.map +0 -1
- package/dist/composites/ebs-storage-class.d.ts.map +0 -1
- package/dist/composites/efs-storage-class.d.ts.map +0 -1
- package/dist/composites/external-dns-agent.d.ts.map +0 -1
- package/dist/composites/filestore-storage-class.d.ts.map +0 -1
- package/dist/composites/fluent-bit-agent.d.ts.map +0 -1
- package/dist/composites/flux-app.d.ts.map +0 -1
- package/dist/composites/gce-ingress.d.ts.map +0 -1
- package/dist/composites/gce-pd-storage-class.d.ts.map +0 -1
- package/dist/composites/gke-external-dns-agent.d.ts.map +0 -1
- package/dist/composites/gke-fluent-bit-agent.d.ts.map +0 -1
- package/dist/composites/gke-gateway.d.ts.map +0 -1
- package/dist/composites/gke-otel-collector.d.ts.map +0 -1
- package/dist/composites/index.d.ts.map +0 -1
- package/dist/composites/inference-service.d.ts.map +0 -1
- package/dist/composites/irsa-service-account.d.ts.map +0 -1
- package/dist/composites/member-defaults.d.ts.map +0 -1
- package/dist/composites/metrics-server.d.ts.map +0 -1
- package/dist/composites/model.d.ts.map +0 -1
- package/dist/composites/monitored-service.d.ts.map +0 -1
- package/dist/composites/namespace-env.d.ts.map +0 -1
- package/dist/composites/network-isolated-app.d.ts.map +0 -1
- package/dist/composites/node-agent.d.ts.map +0 -1
- package/dist/composites/operator-stack.d.ts.map +0 -1
- package/dist/composites/otel-collector-agent.d.ts.map +0 -1
- package/dist/composites/otel-collector-gateway.d.ts.map +0 -1
- package/dist/composites/otel-collector-node.d.ts.map +0 -1
- package/dist/composites/otel-collector-rbac.d.ts.map +0 -1
- package/dist/composites/otel-collector-shape.d.ts.map +0 -1
- package/dist/composites/otel-collector.d.ts.map +0 -1
- package/dist/composites/otel-operator-collector.d.ts.map +0 -1
- package/dist/composites/ray-cluster.d.ts.map +0 -1
- package/dist/composites/ray-job.d.ts.map +0 -1
- package/dist/composites/ray-service.d.ts.map +0 -1
- package/dist/composites/secure-ingress.d.ts.map +0 -1
- package/dist/composites/security-context.d.ts.map +0 -1
- package/dist/composites/sidecar-app.d.ts.map +0 -1
- package/dist/composites/stateful-app.d.ts.map +0 -1
- package/dist/composites/vllm-serving-runtime.d.ts.map +0 -1
- package/dist/composites/web-app.d.ts.map +0 -1
- package/dist/composites/worker-pool.d.ts.map +0 -1
- package/dist/composites/workload-identity-sa.d.ts.map +0 -1
- package/dist/composites/workload-identity-service-account.d.ts.map +0 -1
- package/dist/config-schema.d.ts.map +0 -1
- package/dist/config.d.ts.map +0 -1
- package/dist/coverage.d.ts.map +0 -1
- package/dist/crd/crd-sources.d.ts.map +0 -1
- package/dist/crd/loader.d.ts.map +0 -1
- package/dist/crd/oci-chart.d.ts.map +0 -1
- package/dist/crd/parser.d.ts.map +0 -1
- package/dist/crd/project-codegen.d.ts.map +0 -1
- package/dist/crd/types.d.ts.map +0 -1
- package/dist/deep-observe-hooks.d.ts.map +0 -1
- package/dist/deep-observe.d.ts.map +0 -1
- package/dist/default-labels.d.ts.map +0 -1
- package/dist/describe-resources.d.ts.map +0 -1
- package/dist/describe-stack-status.d.ts.map +0 -1
- package/dist/detect.d.ts.map +0 -1
- package/dist/effect-receipt-row.d.ts.map +0 -1
- package/dist/export-resources.d.ts.map +0 -1
- package/dist/generated/index.d.ts.map +0 -1
- package/dist/generated/runtime.d.ts.map +0 -1
- package/dist/group-namespace.d.ts.map +0 -1
- package/dist/import/embedded.d.ts.map +0 -1
- package/dist/import/generator.d.ts.map +0 -1
- package/dist/import/live-export.d.ts.map +0 -1
- package/dist/import/parser.d.ts.map +0 -1
- package/dist/import/testdata/embedded/fixtures.d.ts.map +0 -1
- package/dist/include/entity.d.ts.map +0 -1
- package/dist/include/resolve.d.ts.map +0 -1
- package/dist/index-identity.d.ts.map +0 -1
- package/dist/index-import.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/kube/apply.d.ts.map +0 -1
- package/dist/kube/connect.d.ts.map +0 -1
- package/dist/kube/delete.d.ts.map +0 -1
- package/dist/kube/describe.d.ts.map +0 -1
- package/dist/kube/events.d.ts.map +0 -1
- package/dist/kube/flags.d.ts.map +0 -1
- package/dist/kube/get.d.ts.map +0 -1
- package/dist/kube/group.d.ts.map +0 -1
- package/dist/kube/logs.d.ts.map +0 -1
- package/dist/kube/project.d.ts.map +0 -1
- package/dist/kube/render.d.ts.map +0 -1
- package/dist/kube/source.d.ts.map +0 -1
- package/dist/kube/target.d.ts.map +0 -1
- package/dist/kube/testing.d.ts.map +0 -1
- package/dist/kube/top.d.ts.map +0 -1
- package/dist/kube/verdict.d.ts.map +0 -1
- package/dist/kube/wait.d.ts.map +0 -1
- package/dist/kustomize/render.d.ts.map +0 -1
- package/dist/kustomize/rendered-entity.d.ts.map +0 -1
- package/dist/kustomize/root.d.ts.map +0 -1
- package/dist/lint/audit-catalog.d.ts.map +0 -1
- package/dist/lint/audit-lineage.d.ts.map +0 -1
- package/dist/lint/post-synth/argo-helpers.d.ts.map +0 -1
- package/dist/lint/post-synth/argo002.d.ts.map +0 -1
- package/dist/lint/post-synth/argo003.d.ts.map +0 -1
- package/dist/lint/post-synth/argo005.d.ts.map +0 -1
- package/dist/lint/post-synth/crd-schema-helpers.d.ts.map +0 -1
- package/dist/lint/post-synth/flux002.d.ts.map +0 -1
- package/dist/lint/post-synth/flux003.d.ts.map +0 -1
- package/dist/lint/post-synth/index.d.ts.map +0 -1
- package/dist/lint/post-synth/k8s-helpers.d.ts.map +0 -1
- package/dist/lint/post-synth/monitoring-selection-helpers.d.ts.map +0 -1
- package/dist/lint/post-synth/otel-placement-helpers.d.ts.map +0 -1
- package/dist/lint/post-synth/sops-helpers.d.ts.map +0 -1
- package/dist/lint/post-synth/wk8005.d.ts.map +0 -1
- package/dist/lint/post-synth/wk8006.d.ts.map +0 -1
- package/dist/lint/post-synth/wk8041.d.ts.map +0 -1
- package/dist/lint/post-synth/wk8042.d.ts.map +0 -1
- package/dist/lint/post-synth/wk8101.d.ts.map +0 -1
- package/dist/lint/post-synth/wk8102.d.ts.map +0 -1
- package/dist/lint/post-synth/wk8103.d.ts.map +0 -1
- package/dist/lint/post-synth/wk8104.d.ts.map +0 -1
- package/dist/lint/post-synth/wk8105.d.ts.map +0 -1
- package/dist/lint/post-synth/wk8201.d.ts.map +0 -1
- package/dist/lint/post-synth/wk8202.d.ts.map +0 -1
- package/dist/lint/post-synth/wk8203.d.ts.map +0 -1
- package/dist/lint/post-synth/wk8204.d.ts.map +0 -1
- package/dist/lint/post-synth/wk8205.d.ts.map +0 -1
- package/dist/lint/post-synth/wk8207.d.ts.map +0 -1
- package/dist/lint/post-synth/wk8208.d.ts.map +0 -1
- package/dist/lint/post-synth/wk8209.d.ts.map +0 -1
- package/dist/lint/post-synth/wk8301.d.ts.map +0 -1
- package/dist/lint/post-synth/wk8302.d.ts.map +0 -1
- package/dist/lint/post-synth/wk8303.d.ts.map +0 -1
- package/dist/lint/post-synth/wk8304.d.ts.map +0 -1
- package/dist/lint/post-synth/wk8305.d.ts.map +0 -1
- package/dist/lint/post-synth/wk8306.d.ts.map +0 -1
- package/dist/lint/post-synth/wk8401.d.ts.map +0 -1
- package/dist/lint/post-synth/wk8402.d.ts.map +0 -1
- package/dist/lint/post-synth/wk8403.d.ts.map +0 -1
- package/dist/lint/post-synth/wk8404.d.ts.map +0 -1
- package/dist/lint/post-synth/wk8405.d.ts.map +0 -1
- package/dist/lint/post-synth/wk8406.d.ts.map +0 -1
- package/dist/lint/post-synth/wk8407.d.ts.map +0 -1
- package/dist/lint/post-synth/wk8501.d.ts.map +0 -1
- package/dist/lint/post-synth/wk8502.d.ts.map +0 -1
- package/dist/lint/post-synth/wk8503.d.ts.map +0 -1
- package/dist/lint/post-synth/wk8504.d.ts.map +0 -1
- package/dist/lint/post-synth/wk8505.d.ts.map +0 -1
- package/dist/lint/post-synth/wk8601.d.ts.map +0 -1
- package/dist/lint/post-synth/wk8602.d.ts.map +0 -1
- package/dist/lint/post-synth/wk8603.d.ts.map +0 -1
- package/dist/lint/post-synth/wk8604.d.ts.map +0 -1
- package/dist/lint/post-synth/wk8605.d.ts.map +0 -1
- package/dist/lint/post-synth/wk8606.d.ts.map +0 -1
- package/dist/lint/post-synth/wk8701.d.ts.map +0 -1
- package/dist/lint/post-synth/wk8702.d.ts.map +0 -1
- package/dist/lint/post-synth/wk8703.d.ts.map +0 -1
- package/dist/lint/post-synth/wk8704.d.ts.map +0 -1
- package/dist/lint/post-synth/wk8705.d.ts.map +0 -1
- package/dist/lint/rules/argo-appset-single-project.d.ts.map +0 -1
- package/dist/lint/rules/argo-ast.d.ts.map +0 -1
- package/dist/lint/rules/argo-automated-prune.d.ts.map +0 -1
- package/dist/lint/rules/flux-source-ref-pin.d.ts.map +0 -1
- package/dist/lint/rules/hardcoded-namespace.d.ts.map +0 -1
- package/dist/lint/rules/latest-image-tag.d.ts.map +0 -1
- package/dist/lint/rules/missing-resource-limits.d.ts.map +0 -1
- package/dist/listed-types.d.ts.map +0 -1
- package/dist/lsp/completions.d.ts.map +0 -1
- package/dist/lsp/hover.d.ts.map +0 -1
- package/dist/manifest-entity.d.ts.map +0 -1
- package/dist/micro-time.d.ts.map +0 -1
- package/dist/op/activities/apply-diff.d.ts.map +0 -1
- package/dist/op/activities/argo.d.ts.map +0 -1
- package/dist/op/activities/ensure-secret.d.ts.map +0 -1
- package/dist/op/activities/index.d.ts.map +0 -1
- package/dist/op/activities/kubectl.d.ts.map +0 -1
- package/dist/op/activities/wait-for-ready.d.ts.map +0 -1
- package/dist/op/builders.d.ts.map +0 -1
- package/dist/package-cli.d.ts.map +0 -1
- package/dist/patch/json-patch.d.ts.map +0 -1
- package/dist/patch/rendered-patch.d.ts.map +0 -1
- package/dist/plugin.d.ts.map +0 -1
- package/dist/project-kinds.d.ts.map +0 -1
- package/dist/receipt-store.d.ts.map +0 -1
- package/dist/reference-catalog.d.ts.map +0 -1
- package/dist/secret-labels.d.ts.map +0 -1
- package/dist/secret-store.d.ts.map +0 -1
- package/dist/serializer.d.ts.map +0 -1
- package/dist/sops/encrypted-secret-file.d.ts.map +0 -1
- package/dist/sops/entity.d.ts.map +0 -1
- package/dist/spec/fetch.d.ts.map +0 -1
- package/dist/spec/parse.d.ts.map +0 -1
- package/dist/subscribe-changes.d.ts.map +0 -1
- package/dist/teardown.d.ts.map +0 -1
- package/dist/telemetry-release.d.ts.map +0 -1
- package/dist/validate-cli.d.ts.map +0 -1
- package/dist/validate.d.ts.map +0 -1
- package/dist/variables.d.ts.map +0 -1
- package/dist/whoami.d.ts.map +0 -1
- package/dist/workspace-member.d.ts.map +0 -1
- package/src/actions/actions.test.ts +0 -83
- package/src/actions/apps.ts +0 -23
- package/src/actions/batch.ts +0 -9
- package/src/actions/core.ts +0 -62
- package/src/actions/index.ts +0 -50
- package/src/actions/networking.ts +0 -15
- package/src/actions/rbac.ts +0 -13
- package/src/api/classify.test.ts +0 -170
- package/src/api/classify.ts +0 -154
- package/src/api/connect.ts +0 -104
- package/src/api/fake-cluster.ts +0 -231
- package/src/api/operation-surface.test.ts +0 -116
- package/src/api/operation-surface.ts +0 -130
- package/src/api/owner-chain.test.ts +0 -171
- package/src/api/owner-chain.ts +0 -144
- package/src/api/sweep-types.ts +0 -35
- package/src/behaviour-kinds.ts +0 -88
- package/src/codegen/declarations.test.ts +0 -118
- package/src/codegen/docs-cli.ts +0 -3
- package/src/codegen/docs.ts +0 -156
- package/src/codegen/generate-cli.ts +0 -41
- package/src/codegen/generate-crd-sources.test.ts +0 -49
- package/src/codegen/generate-lexicon.ts +0 -105
- package/src/codegen/generate-list-map-keys.test.ts +0 -112
- package/src/codegen/generate-list-map-keys.ts +0 -99
- package/src/codegen/generate-operations.ts +0 -56
- package/src/codegen/generate-typescript.ts +0 -162
- package/src/codegen/generate.ts +0 -231
- package/src/codegen/naming.test.ts +0 -63
- package/src/codegen/naming.ts +0 -201
- package/src/codegen/package.ts +0 -53
- package/src/codegen/patches.ts +0 -108
- package/src/codegen/snapshot.test.ts +0 -115
- package/src/codegen/typecheck.test.ts +0 -24
- package/src/codegen/typecheck.ts +0 -4
- package/src/codegen/versions.ts +0 -50
- package/src/components/argo-app.test.ts +0 -137
- package/src/components/argo-app.ts +0 -163
- package/src/components/builders.ts +0 -30
- package/src/components/capability-plugin.test.ts +0 -20
- package/src/components/capability-plugin.ts +0 -44
- package/src/components/flux-reconcile.test.ts +0 -145
- package/src/components/flux-reconcile.ts +0 -159
- package/src/components/index.ts +0 -44
- package/src/components/kubectl-apply-plan.k3d.e2e.test.ts +0 -127
- package/src/components/kubectl-apply.test.ts +0 -465
- package/src/components/kubectl-apply.ts +0 -570
- package/src/components/kustomize-apply.test.ts +0 -98
- package/src/components/kustomize-apply.ts +0 -104
- package/src/composites/__snapshots__/gke-otel-collector.snapshot.test.ts.snap +0 -335
- package/src/composites/adot-collector.ts +0 -258
- package/src/composites/agic-ingress.ts +0 -157
- package/src/composites/aks-external-dns-agent.ts +0 -211
- package/src/composites/alb-ingress.ts +0 -161
- package/src/composites/argo-app.ts +0 -381
- package/src/composites/autoscaled-service.ts +0 -293
- package/src/composites/azure-disk-storage-class.ts +0 -91
- package/src/composites/azure-file-storage-class.ts +0 -86
- package/src/composites/azure-monitor-collector.ts +0 -245
- package/src/composites/batch-job.ts +0 -230
- package/src/composites/catalog.test.ts +0 -39
- package/src/composites/catalog.ts +0 -4115
- package/src/composites/cockroachdb-cluster.ts +0 -528
- package/src/composites/cockroachdb-region-stack.ts +0 -553
- package/src/composites/composites.test.ts +0 -4291
- package/src/composites/config-connector-context.ts +0 -69
- package/src/composites/configured-app.ts +0 -231
- package/src/composites/cron-schedule.ts +0 -47
- package/src/composites/cron-workload.ts +0 -182
- package/src/composites/ebs-storage-class.ts +0 -105
- package/src/composites/efs-storage-class.ts +0 -86
- package/src/composites/external-dns-agent.ts +0 -181
- package/src/composites/filestore-storage-class.ts +0 -88
- package/src/composites/fluent-bit-agent.ts +0 -227
- package/src/composites/flux-app.ts +0 -298
- package/src/composites/gce-ingress.ts +0 -152
- package/src/composites/gce-pd-storage-class.ts +0 -94
- package/src/composites/gke-external-dns-agent.ts +0 -189
- package/src/composites/gke-fluent-bit-agent.ts +0 -232
- package/src/composites/gke-gateway.ts +0 -150
- package/src/composites/gke-otel-collector.snapshot.test.ts +0 -53
- package/src/composites/gke-otel-collector.ts +0 -156
- package/src/composites/index.ts +0 -133
- package/src/composites/inference-service.ts +0 -141
- package/src/composites/irsa-service-account.ts +0 -123
- package/src/composites/member-defaults.test.ts +0 -63
- package/src/composites/member-defaults.ts +0 -29
- package/src/composites/metrics-server.ts +0 -240
- package/src/composites/model.ts +0 -151
- package/src/composites/monitored-service.ts +0 -252
- package/src/composites/namespace-env.ts +0 -173
- package/src/composites/network-isolated-app.ts +0 -208
- package/src/composites/node-agent.ts +0 -242
- package/src/composites/operator-stack.ts +0 -387
- package/src/composites/otel-collector-agent.ts +0 -230
- package/src/composites/otel-collector-gateway.test.ts +0 -380
- package/src/composites/otel-collector-gateway.ts +0 -404
- package/src/composites/otel-collector-node.test.ts +0 -193
- package/src/composites/otel-collector-node.ts +0 -211
- package/src/composites/otel-collector-rbac.test.ts +0 -125
- package/src/composites/otel-collector-rbac.ts +0 -146
- package/src/composites/otel-collector-shape.ts +0 -163
- package/src/composites/otel-collector.ts +0 -209
- package/src/composites/otel-operator-collector.test.ts +0 -267
- package/src/composites/otel-operator-collector.ts +0 -221
- package/src/composites/ray-cluster.ts +0 -591
- package/src/composites/ray-job.ts +0 -236
- package/src/composites/ray-service.ts +0 -272
- package/src/composites/secure-ingress.ts +0 -160
- package/src/composites/security-context.ts +0 -10
- package/src/composites/sidecar-app.ts +0 -213
- package/src/composites/stateful-app.ts +0 -196
- package/src/composites/vllm-serving-runtime.test.ts +0 -167
- package/src/composites/vllm-serving-runtime.ts +0 -197
- package/src/composites/web-app.ts +0 -254
- package/src/composites/worker-pool.ts +0 -279
- package/src/composites/workload-identity-sa.ts +0 -127
- package/src/composites/workload-identity-service-account.ts +0 -123
- package/src/config-augmentation.test.ts +0 -100
- package/src/config-schema.ts +0 -109
- package/src/config.ts +0 -215
- package/src/coverage.test.ts +0 -27
- package/src/coverage.ts +0 -35
- package/src/crd/clickhouse-operators.test.ts +0 -105
- package/src/crd/cnpg.test.ts +0 -191
- package/src/crd/crd-sources.ts +0 -688
- package/src/crd/infisical.test.ts +0 -100
- package/src/crd/loader.test.ts +0 -90
- package/src/crd/loader.ts +0 -214
- package/src/crd/oci-chart.test.ts +0 -149
- package/src/crd/oci-chart.ts +0 -178
- package/src/crd/parser.test.ts +0 -585
- package/src/crd/parser.ts +0 -437
- package/src/crd/project-codegen.e2e.test.ts +0 -239
- package/src/crd/project-codegen.ts +0 -327
- package/src/crd/traefik.test.ts +0 -108
- package/src/crd/types.ts +0 -92
- package/src/deep-observe-hooks.ts +0 -361
- package/src/deep-observe.test.ts +0 -1160
- package/src/deep-observe.ts +0 -290
- package/src/default-labels.test.ts +0 -111
- package/src/default-labels.ts +0 -122
- package/src/describe-resources.test.ts +0 -1873
- package/src/describe-resources.ts +0 -839
- package/src/describe-stack-status.test.ts +0 -169
- package/src/describe-stack-status.ts +0 -143
- package/src/detect.ts +0 -9
- package/src/effect-receipt-row.test.ts +0 -285
- package/src/effect-receipt-row.ts +0 -268
- package/src/export-resources-io.test.ts +0 -97
- package/src/export-resources.ts +0 -72
- package/src/generated/index.d.ts +0 -8909
- package/src/generated/index.ts +0 -1153
- package/src/generated/runtime.ts +0 -4
- package/src/group-namespace.test.ts +0 -99
- package/src/group-namespace.ts +0 -103
- package/src/import/embedded-live.test.ts +0 -180
- package/src/import/embedded-roundtrip.test.ts +0 -298
- package/src/import/embedded-types.e2e.test.ts +0 -45
- package/src/import/embedded.test.ts +0 -189
- package/src/import/embedded.ts +0 -208
- package/src/import/generator.test.ts +0 -140
- package/src/import/generator.ts +0 -374
- package/src/import/live-export.test.ts +0 -114
- package/src/import/live-export.ts +0 -97
- package/src/import/operator-alerting-roundtrip.test.ts +0 -158
- package/src/import/operator-collector-roundtrip.test.ts +0 -105
- package/src/import/parser.test.ts +0 -174
- package/src/import/parser.ts +0 -230
- package/src/import/roundtrip-build.test.ts +0 -133
- package/src/import/roundtrip.test.ts +0 -86
- package/src/import/testdata/embedded/README.md +0 -14
- package/src/import/testdata/embedded/agent-observability.yaml +0 -2905
- package/src/import/testdata/embedded/alertmanager-configmap.yaml +0 -91
- package/src/import/testdata/embedded/fixtures.ts +0 -71
- package/src/import/testdata/embedded/grafana-dashboard-configmap.yaml +0 -364
- package/src/import/testdata/embedded/grafana-operator-dashboard.yaml +0 -363
- package/src/import/testdata/embedded/grafana-v2-dashboard-configmap.yaml +0 -851
- package/src/import/testdata/embedded/node-exporter-prometheusrule.yaml +0 -425
- package/src/import/testdata/embedded/otel-collector-daemonset.yaml +0 -225
- package/src/include/entity.ts +0 -119
- package/src/include/include.test.ts +0 -345
- package/src/include/resolve.ts +0 -204
- package/src/index-identity.ts +0 -119
- package/src/index-import.test.ts +0 -244
- package/src/index-import.ts +0 -181
- package/src/index.ts +0 -172
- package/src/kube/apply.test.ts +0 -105
- package/src/kube/apply.ts +0 -106
- package/src/kube/connect.ts +0 -55
- package/src/kube/delete.test.ts +0 -123
- package/src/kube/delete.ts +0 -174
- package/src/kube/describe.test.ts +0 -106
- package/src/kube/describe.ts +0 -195
- package/src/kube/events.test.ts +0 -115
- package/src/kube/events.ts +0 -160
- package/src/kube/flags.test.ts +0 -65
- package/src/kube/flags.ts +0 -114
- package/src/kube/get.test.ts +0 -195
- package/src/kube/get.ts +0 -190
- package/src/kube/group.test.ts +0 -33
- package/src/kube/group.ts +0 -125
- package/src/kube/logs.test.ts +0 -126
- package/src/kube/logs.ts +0 -96
- package/src/kube/project.test.ts +0 -57
- package/src/kube/project.ts +0 -106
- package/src/kube/render.test.ts +0 -142
- package/src/kube/render.ts +0 -252
- package/src/kube/source.test.ts +0 -138
- package/src/kube/source.ts +0 -139
- package/src/kube/target.test.ts +0 -67
- package/src/kube/target.ts +0 -89
- package/src/kube/testing.ts +0 -42
- package/src/kube/top.test.ts +0 -149
- package/src/kube/top.ts +0 -120
- package/src/kube/verdict.test.ts +0 -48
- package/src/kube/verdict.ts +0 -77
- package/src/kube/wait.test.ts +0 -125
- package/src/kube/wait.ts +0 -160
- package/src/kustomize/render.ts +0 -96
- package/src/kustomize/rendered-entity.ts +0 -82
- package/src/kustomize/root.test.ts +0 -309
- package/src/kustomize/root.ts +0 -95
- package/src/kustomize/search.test.ts +0 -101
- package/src/lifecycle-integration.test.ts +0 -325
- package/src/lint/audit-catalog.ts +0 -63
- package/src/lint/audit-lineage.ts +0 -127
- package/src/lint/post-synth/argo-helpers.ts +0 -47
- package/src/lint/post-synth/argo002.ts +0 -47
- package/src/lint/post-synth/argo003.ts +0 -80
- package/src/lint/post-synth/argo005.ts +0 -59
- package/src/lint/post-synth/crd-schema-helpers.ts +0 -235
- package/src/lint/post-synth/flux002.ts +0 -77
- package/src/lint/post-synth/flux003.ts +0 -75
- package/src/lint/post-synth/index.ts +0 -107
- package/src/lint/post-synth/k8s-helpers.test.ts +0 -236
- package/src/lint/post-synth/k8s-helpers.ts +0 -251
- package/src/lint/post-synth/monitoring-selection-helpers.ts +0 -185
- package/src/lint/post-synth/monitoring-selection.test.ts +0 -316
- package/src/lint/post-synth/otel-placement-helpers.ts +0 -333
- package/src/lint/post-synth/otel-placement.test.ts +0 -450
- package/src/lint/post-synth/post-synth.test.ts +0 -2798
- package/src/lint/post-synth/sops-helpers.ts +0 -76
- package/src/lint/post-synth/wk8005.ts +0 -54
- package/src/lint/post-synth/wk8006.ts +0 -63
- package/src/lint/post-synth/wk8041.ts +0 -68
- package/src/lint/post-synth/wk8042.ts +0 -43
- package/src/lint/post-synth/wk8101.ts +0 -60
- package/src/lint/post-synth/wk8102.ts +0 -37
- package/src/lint/post-synth/wk8103.ts +0 -40
- package/src/lint/post-synth/wk8104.ts +0 -64
- package/src/lint/post-synth/wk8105.ts +0 -40
- package/src/lint/post-synth/wk8201.ts +0 -50
- package/src/lint/post-synth/wk8202.ts +0 -41
- package/src/lint/post-synth/wk8203.ts +0 -41
- package/src/lint/post-synth/wk8204.ts +0 -81
- package/src/lint/post-synth/wk8205.ts +0 -51
- package/src/lint/post-synth/wk8207.ts +0 -40
- package/src/lint/post-synth/wk8208.ts +0 -40
- package/src/lint/post-synth/wk8209.ts +0 -40
- package/src/lint/post-synth/wk8301.ts +0 -54
- package/src/lint/post-synth/wk8302.ts +0 -41
- package/src/lint/post-synth/wk8303.ts +0 -93
- package/src/lint/post-synth/wk8304.ts +0 -65
- package/src/lint/post-synth/wk8305.ts +0 -112
- package/src/lint/post-synth/wk8306.ts +0 -45
- package/src/lint/post-synth/wk8401.ts +0 -93
- package/src/lint/post-synth/wk8402.ts +0 -38
- package/src/lint/post-synth/wk8403.ts +0 -55
- package/src/lint/post-synth/wk8404.ts +0 -49
- package/src/lint/post-synth/wk8405.ts +0 -85
- package/src/lint/post-synth/wk8406.ts +0 -55
- package/src/lint/post-synth/wk8407.ts +0 -66
- package/src/lint/post-synth/wk8501.ts +0 -40
- package/src/lint/post-synth/wk8502.ts +0 -39
- package/src/lint/post-synth/wk8503.ts +0 -220
- package/src/lint/post-synth/wk8504.ts +0 -51
- package/src/lint/post-synth/wk8505.ts +0 -65
- package/src/lint/post-synth/wk8601.ts +0 -44
- package/src/lint/post-synth/wk8602.ts +0 -133
- package/src/lint/post-synth/wk8603.ts +0 -66
- package/src/lint/post-synth/wk8604.ts +0 -36
- package/src/lint/post-synth/wk8605.test.ts +0 -153
- package/src/lint/post-synth/wk8605.ts +0 -133
- package/src/lint/post-synth/wk8606.ts +0 -27
- package/src/lint/post-synth/wk8701.ts +0 -37
- package/src/lint/post-synth/wk8702.ts +0 -43
- package/src/lint/post-synth/wk8703.ts +0 -37
- package/src/lint/post-synth/wk8704.ts +0 -134
- package/src/lint/post-synth/wk8705.ts +0 -45
- package/src/lint/rules/argo-appset-single-project.ts +0 -66
- package/src/lint/rules/argo-ast.ts +0 -121
- package/src/lint/rules/argo-automated-prune.ts +0 -75
- package/src/lint/rules/flux-source-ref-pin.ts +0 -52
- package/src/lint/rules/hardcoded-namespace.ts +0 -71
- package/src/lint/rules/latest-image-tag.ts +0 -121
- package/src/lint/rules/missing-resource-limits.ts +0 -111
- package/src/lint/rules/rules.test.ts +0 -421
- package/src/list-map-key-table.test.ts +0 -83
- package/src/list-map-order-key.test.ts +0 -119
- package/src/listed-types.test.ts +0 -76
- package/src/listed-types.ts +0 -70
- package/src/lsp/completions.test.ts +0 -64
- package/src/lsp/completions.ts +0 -21
- package/src/lsp/hover.test.ts +0 -69
- package/src/lsp/hover.ts +0 -69
- package/src/manifest-entity.test.ts +0 -78
- package/src/manifest-entity.ts +0 -82
- package/src/micro-time.test.ts +0 -48
- package/src/micro-time.ts +0 -51
- package/src/op/activities/apply-diff.ts +0 -87
- package/src/op/activities/argo.test.ts +0 -79
- package/src/op/activities/argo.ts +0 -163
- package/src/op/activities/ensure-secret.ts +0 -71
- package/src/op/activities/index.ts +0 -79
- package/src/op/activities/kubectl-plan.test.ts +0 -224
- package/src/op/activities/kubectl.test.ts +0 -662
- package/src/op/activities/kubectl.ts +0 -723
- package/src/op/activities/wait-for-ready.test.ts +0 -260
- package/src/op/activities/wait-for-ready.ts +0 -371
- package/src/op/builders.test.ts +0 -82
- package/src/op/builders.ts +0 -95
- package/src/package-cli.ts +0 -28
- package/src/patch/json-patch.test.ts +0 -91
- package/src/patch/json-patch.ts +0 -189
- package/src/patch/rendered-patch.test.ts +0 -143
- package/src/patch/rendered-patch.ts +0 -180
- package/src/plugin.test.ts +0 -273
- package/src/plugin.ts +0 -827
- package/src/project-kinds.ts +0 -75
- package/src/prometheus-rule-groups.test.ts +0 -135
- package/src/receipt-store.test.ts +0 -380
- package/src/receipt-store.ts +0 -290
- package/src/reference-catalog.test.ts +0 -173
- package/src/reference-catalog.ts +0 -157
- package/src/secret-labels.ts +0 -36
- package/src/secret-store.test.ts +0 -184
- package/src/secret-store.ts +0 -165
- package/src/serializer-ownership.test.ts +0 -44
- package/src/serializer-telemetry.test.ts +0 -146
- package/src/serializer.test.ts +0 -640
- package/src/serializer.ts +0 -655
- package/src/skills/chant-k8s-aks.md +0 -146
- package/src/skills/chant-k8s-argo.md +0 -190
- package/src/skills/chant-k8s-deployment-strategies.md +0 -183
- package/src/skills/chant-k8s-eks.md +0 -171
- package/src/skills/chant-k8s-flux.md +0 -162
- package/src/skills/chant-k8s-gke.md +0 -246
- package/src/skills/chant-k8s-patterns.md +0 -245
- package/src/skills/chant-k8s-ray.md +0 -252
- package/src/skills/chant-k8s-security.md +0 -237
- package/src/skills/chant-k8s.md +0 -307
- package/src/sops/encrypted-secret-file.test.ts +0 -333
- package/src/sops/encrypted-secret-file.ts +0 -264
- package/src/sops/entity.ts +0 -53
- package/src/spec/fetch.test.ts +0 -24
- package/src/spec/fetch.ts +0 -68
- package/src/spec/parse.test.ts +0 -262
- package/src/spec/parse.ts +0 -864
- package/src/subscribe-changes.test.ts +0 -368
- package/src/subscribe-changes.ts +0 -210
- package/src/teardown.test.ts +0 -240
- package/src/teardown.ts +0 -239
- package/src/telemetry-build.test.ts +0 -79
- package/src/telemetry-release.ts +0 -93
- package/src/testdata/include/bundle.yaml +0 -45
- package/src/testdata/indexed/listing.json +0 -67
- package/src/testdata/kustomize-root/base/deployment.yaml +0 -17
- package/src/testdata/kustomize-root/base/kustomization.yaml +0 -3
- package/src/testdata/kustomize-root/base/service.yaml +0 -9
- package/src/testdata/kustomize-root/overlays/prod/kustomization.yaml +0 -6
- package/src/testdata/manifests/configmap.yaml +0 -7
- package/src/testdata/manifests/deployment.yaml +0 -22
- package/src/testdata/manifests/full-app.yaml +0 -61
- package/src/testdata/manifests/secret.yaml +0 -7
- package/src/testdata/manifests/service.yaml +0 -15
- package/src/testdata/sops/db-credentials.sops.yaml +0 -23
- package/src/testdata/workspace-members/argo/guestbook.yaml +0 -28
- package/src/testdata/workspace-members/argo/namespace.yaml +0 -4
- package/src/testdata/workspace-members/flux/apps.yaml +0 -12
- package/src/testdata/workspace-members/flux/kustomization.yaml +0 -4
- package/src/validate-cli.ts +0 -21
- package/src/validate.test.ts +0 -29
- package/src/validate.ts +0 -53
- package/src/variables.ts +0 -36
- package/src/whoami.test.ts +0 -203
- package/src/whoami.ts +0 -122
- package/src/workspace-kinds.test.ts +0 -35
- package/src/workspace-member.test.ts +0 -154
- package/src/workspace-member.ts +0 -128
- /package/{src → dist}/generated/list-map-keys.json +0 -0
- /package/{src → dist}/generated/operations.json +0 -0
package/src/include/entity.ts
DELETED
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `k8sInclude`: bring a plain multi-document YAML file or pinned URL into a
|
|
3
|
-
* build as it is (#3566 item 4).
|
|
4
|
-
*
|
|
5
|
-
* Before this, the way to ship a vendored manifest bundle (an operator's
|
|
6
|
-
* install.yaml, a CRD bundle) through chant was a kustomization directory
|
|
7
|
-
* listing it as its only resource. `k8sInclude` declares the file or URL
|
|
8
|
-
* directly. Its documents become the same verbatim manifest entities a
|
|
9
|
-
* kustomize build root produces (`../manifest-entity.ts`), so they get
|
|
10
|
-
* default labels and ownership stamping, post-synth checks, and
|
|
11
|
-
* `lifecycle diff --live` like any declared resource.
|
|
12
|
-
*
|
|
13
|
-
* This module is the declaration only, with no filesystem or network access,
|
|
14
|
-
* so the factory stays pure and folds under `--sandbox`. The bytes are read
|
|
15
|
-
* at `buildRoots()`, the build's one impure seam, in `./resolve.ts`, the same
|
|
16
|
-
* split `declareSecret({ provenance: "committed-encrypted" })` uses.
|
|
17
|
-
*
|
|
18
|
-
* The declaration itself never reaches the output: the serializer skips it,
|
|
19
|
-
* and it carries no `props`, so the live read paths never ask a cluster
|
|
20
|
-
* about it.
|
|
21
|
-
*/
|
|
22
|
-
import { DECLARABLE_MARKER, type Declarable } from "@intentius/chant/declarable";
|
|
23
|
-
import type { RenderedPatch } from "../patch/rendered-patch";
|
|
24
|
-
|
|
25
|
-
/** Marks a `k8sInclude` declaration. */
|
|
26
|
-
export const K8S_INCLUDE_MARKER = Symbol.for("chant.k8s.include");
|
|
27
|
-
|
|
28
|
-
export const K8S_INCLUDE_ENTITY_TYPE = "chant:k8s:include";
|
|
29
|
-
|
|
30
|
-
/** Annotation stamped on every included document, valued with its source. */
|
|
31
|
-
export const INCLUDE_SOURCE_ANNOTATION = "chant.intentius.io/include-source";
|
|
32
|
-
|
|
33
|
-
const DIGEST_RE = /^sha256:[0-9a-f]{64}$/;
|
|
34
|
-
|
|
35
|
-
export interface K8sIncludeProps {
|
|
36
|
-
/**
|
|
37
|
-
* A local file path, relative to the project root (the directory holding
|
|
38
|
-
* `chant.config.*`), or an `https://` / `http://` URL.
|
|
39
|
-
*/
|
|
40
|
-
source: string;
|
|
41
|
-
/**
|
|
42
|
-
* `sha256:<64 hex>` digest of the source's bytes. Required for a URL: the
|
|
43
|
-
* fetched bytes must match it, and the digest keys the local cache, so
|
|
44
|
-
* only the first build needs the network. Optional for a local file; when
|
|
45
|
-
* set, the file must match it too.
|
|
46
|
-
*/
|
|
47
|
-
digest?: string;
|
|
48
|
-
/** Patches applied to the documents before they become entities. */
|
|
49
|
-
patches?: RenderedPatch[];
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export interface K8sIncludeDeclaration extends Declarable {
|
|
53
|
-
readonly lexicon: "k8s";
|
|
54
|
-
readonly entityType: typeof K8S_INCLUDE_ENTITY_TYPE;
|
|
55
|
-
readonly [K8S_INCLUDE_MARKER]: true;
|
|
56
|
-
readonly source: string;
|
|
57
|
-
readonly digest?: string;
|
|
58
|
-
readonly patches?: RenderedPatch[];
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export function isK8sInclude(value: unknown): value is K8sIncludeDeclaration {
|
|
62
|
-
return (
|
|
63
|
-
typeof value === "object" &&
|
|
64
|
-
value !== null &&
|
|
65
|
-
(value as Record<symbol, unknown>)[K8S_INCLUDE_MARKER] === true
|
|
66
|
-
);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/** True for an `http://` or `https://` source. */
|
|
70
|
-
export function isRemoteSource(source: string): boolean {
|
|
71
|
-
return /^https?:\/\//i.test(source);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Declare a local or pinned remote multi-document YAML to include in the
|
|
76
|
-
* build.
|
|
77
|
-
*
|
|
78
|
-
* @example
|
|
79
|
-
* ```ts
|
|
80
|
-
* import { k8sInclude } from "@intentius/chant-lexicon-k8s";
|
|
81
|
-
*
|
|
82
|
-
* export const certManager = k8sInclude({
|
|
83
|
-
* source: "https://github.com/cert-manager/cert-manager/releases/download/v1.16.2/cert-manager.yaml",
|
|
84
|
-
* digest: "sha256:...",
|
|
85
|
-
* });
|
|
86
|
-
*
|
|
87
|
-
* export const legacy = k8sInclude({ source: "manifests/legacy.yaml" });
|
|
88
|
-
* ```
|
|
89
|
-
*/
|
|
90
|
-
export function k8sInclude(props: K8sIncludeProps): K8sIncludeDeclaration {
|
|
91
|
-
const source = props?.source;
|
|
92
|
-
if (typeof source !== "string" || source.length === 0) {
|
|
93
|
-
throw new Error("k8sInclude: `source` must be a non-empty path or URL");
|
|
94
|
-
}
|
|
95
|
-
if (/^[a-z][a-z0-9+.-]*:\/\//i.test(source) && !isRemoteSource(source)) {
|
|
96
|
-
throw new Error(`k8sInclude("${source}"): only local paths and http(s) URLs are supported`);
|
|
97
|
-
}
|
|
98
|
-
if (props.digest !== undefined && !DIGEST_RE.test(props.digest)) {
|
|
99
|
-
throw new Error(
|
|
100
|
-
`k8sInclude("${source}"): digest ${JSON.stringify(props.digest)} is not of the form "sha256:<64 lowercase hex>"`,
|
|
101
|
-
);
|
|
102
|
-
}
|
|
103
|
-
if (isRemoteSource(source) && props.digest === undefined) {
|
|
104
|
-
throw new Error(
|
|
105
|
-
`k8sInclude("${source}"): a URL source must be pinned with \`digest: "sha256:<hex>"\`. ` +
|
|
106
|
-
`Compute it from a copy you have reviewed, e.g. \`curl -sL <url> | shasum -a 256\`.`,
|
|
107
|
-
);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
return {
|
|
111
|
-
lexicon: "k8s",
|
|
112
|
-
entityType: K8S_INCLUDE_ENTITY_TYPE,
|
|
113
|
-
source,
|
|
114
|
-
...(props.digest !== undefined ? { digest: props.digest } : {}),
|
|
115
|
-
...(props.patches !== undefined ? { patches: JSON.parse(JSON.stringify(props.patches)) as RenderedPatch[] } : {}),
|
|
116
|
-
[DECLARABLE_MARKER]: true,
|
|
117
|
-
[K8S_INCLUDE_MARKER]: true,
|
|
118
|
-
};
|
|
119
|
-
}
|
|
@@ -1,345 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `k8sInclude` (#3566 item 4). What must hold: a local file or a pinned URL
|
|
3
|
-
* resolves at `buildRoots()` into verbatim manifest entities with
|
|
4
|
-
* deterministic names and source provenance; a URL's bytes must match the
|
|
5
|
-
* digest and are cached by it, so later builds are offline; patches apply
|
|
6
|
-
* before the documents become entities; and every way an include can be
|
|
7
|
-
* wrong fails with the path or URL in the message. No test touches the
|
|
8
|
-
* network: the fetcher is injected.
|
|
9
|
-
*/
|
|
10
|
-
import { describe, test, expect, beforeEach, afterEach } from "vitest";
|
|
11
|
-
import { fileURLToPath } from "node:url";
|
|
12
|
-
import { dirname, join } from "node:path";
|
|
13
|
-
import { existsSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
14
|
-
import { mkdir, rm, writeFile } from "node:fs/promises";
|
|
15
|
-
import { tmpdir } from "node:os";
|
|
16
|
-
import { build } from "@intentius/chant";
|
|
17
|
-
import type { Declarable } from "@intentius/chant/declarable";
|
|
18
|
-
import type { PostSynthContext } from "@intentius/chant/lint/post-synth";
|
|
19
|
-
import { k8sInclude, isK8sInclude, INCLUDE_SOURCE_ANNOTATION, type K8sIncludeDeclaration } from "./entity";
|
|
20
|
-
import { includeBuildRoot, resolveIncludes, sha256Digest, type IncludeFetcher } from "./resolve";
|
|
21
|
-
import { isRenderedManifestEntity } from "../manifest-entity";
|
|
22
|
-
import { k8sSerializer } from "../serializer";
|
|
23
|
-
import { k8sPlugin } from "../plugin";
|
|
24
|
-
import { wk8005 } from "../lint/post-synth/wk8005";
|
|
25
|
-
|
|
26
|
-
const here = dirname(fileURLToPath(import.meta.url));
|
|
27
|
-
const fixtureRoot = join(here, "..", "testdata", "include");
|
|
28
|
-
const BUNDLE = readFileSync(join(fixtureRoot, "bundle.yaml"));
|
|
29
|
-
const BUNDLE_DIGEST = sha256Digest(BUNDLE);
|
|
30
|
-
const URL_SOURCE = "https://example.com/releases/v0.4.1/widget.yaml";
|
|
31
|
-
/** Absolute path to the factory — a temp project cannot resolve the package name. */
|
|
32
|
-
const ENTITY_MODULE = join(here, "entity");
|
|
33
|
-
|
|
34
|
-
const EXPECTED_KEYS = [
|
|
35
|
-
"widgets/namespaceWidgetSystem",
|
|
36
|
-
"widgets/configMapWidgetConfig",
|
|
37
|
-
"widgets/configMapWidgetConfig.widget-edge",
|
|
38
|
-
"widgets/deploymentWidgetController",
|
|
39
|
-
];
|
|
40
|
-
|
|
41
|
-
function decls(...pairs: Array<[string, K8sIncludeDeclaration]>) {
|
|
42
|
-
return new Map(pairs);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function propsOf(entity: Declarable | undefined): Record<string, unknown> {
|
|
46
|
-
return (entity as unknown as { props: Record<string, unknown> }).props;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
let cacheRoot: string;
|
|
50
|
-
beforeEach(() => {
|
|
51
|
-
cacheRoot = mkdtempSync(join(tmpdir(), "chant-include-cache-"));
|
|
52
|
-
});
|
|
53
|
-
afterEach(() => {
|
|
54
|
-
rmSync(cacheRoot, { recursive: true, force: true });
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
describe("k8sInclude — the declaration", () => {
|
|
58
|
-
test("is a k8s declarable with no props, so it never reaches the live read paths", () => {
|
|
59
|
-
const decl = k8sInclude({ source: "manifests/bundle.yaml" });
|
|
60
|
-
expect(isK8sInclude(decl)).toBe(true);
|
|
61
|
-
expect(decl.lexicon).toBe("k8s");
|
|
62
|
-
expect("props" in decl).toBe(false);
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
test("a URL without a digest is refused at declaration time", () => {
|
|
66
|
-
expect(() => k8sInclude({ source: URL_SOURCE })).toThrow(/must be pinned with `digest: "sha256:<hex>"`/);
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
test("a malformed digest is refused", () => {
|
|
70
|
-
expect(() => k8sInclude({ source: URL_SOURCE, digest: "sha256:abc" })).toThrow(/not of the form/);
|
|
71
|
-
expect(() => k8sInclude({ source: URL_SOURCE, digest: BUNDLE_DIGEST.replace("sha256:", "md5:") })).toThrow(
|
|
72
|
-
/not of the form/,
|
|
73
|
-
);
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
test("schemes other than http(s) are refused", () => {
|
|
77
|
-
expect(() => k8sInclude({ source: "oci://registry/bundle" })).toThrow(/only local paths and http\(s\) URLs/);
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
test("the serializer emits nothing for the declaration itself", () => {
|
|
81
|
-
const out = k8sSerializer.serialize(new Map<string, Declarable>([["inc", k8sInclude({ source: "x.yaml" })]]));
|
|
82
|
-
expect(typeof out === "string" ? out : out.primary).toBe("");
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
describe("resolveIncludes — local files", () => {
|
|
87
|
-
test("resolves relative to the project root into verbatim entities with deterministic keys", async () => {
|
|
88
|
-
const entities = await resolveIncludes({
|
|
89
|
-
projectRoot: join(fixtureRoot, ".."),
|
|
90
|
-
declarations: decls(["widgets", k8sInclude({ source: "include/bundle.yaml" })]),
|
|
91
|
-
cacheRoot,
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
// The stray `---` empties are skipped; the two same-name ConfigMaps are
|
|
95
|
-
// qualified by namespace, in document order.
|
|
96
|
-
expect([...entities.keys()]).toEqual(EXPECTED_KEYS);
|
|
97
|
-
const deployment = entities.get("widgets/deploymentWidgetController")!;
|
|
98
|
-
expect(isRenderedManifestEntity(deployment)).toBe(true);
|
|
99
|
-
expect(deployment.entityType).toBe("K8s::Apps::Deployment");
|
|
100
|
-
const metadata = propsOf(deployment).metadata as { annotations: Record<string, string> };
|
|
101
|
-
expect(metadata.annotations[INCLUDE_SOURCE_ANNOTATION]).toBe("include/bundle.yaml");
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
test("names are the same on every resolve, and a third same-name document is numbered", async () => {
|
|
105
|
-
const readFile = () =>
|
|
106
|
-
Buffer.from(
|
|
107
|
-
["a", "a", "b"]
|
|
108
|
-
.map((ns) => `apiVersion: v1\nkind: ConfigMap\nmetadata:\n name: c\n namespace: ${ns}\n`)
|
|
109
|
-
.join("---\n"),
|
|
110
|
-
);
|
|
111
|
-
const run = () =>
|
|
112
|
-
resolveIncludes({ projectRoot: "/p", declarations: decls(["inc", k8sInclude({ source: "c.yaml" })]), readFile });
|
|
113
|
-
const first = [...(await run()).keys()];
|
|
114
|
-
expect(first).toEqual(["inc/configMapC", "inc/configMapC.a", "inc/configMapC.b"]);
|
|
115
|
-
expect([...(await run()).keys()]).toEqual(first);
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
test("a local file with a digest must match it", async () => {
|
|
119
|
-
const wrong = `sha256:${"0".repeat(64)}`;
|
|
120
|
-
await expect(
|
|
121
|
-
resolveIncludes({
|
|
122
|
-
projectRoot: fixtureRoot,
|
|
123
|
-
declarations: decls(["w", k8sInclude({ source: "bundle.yaml", digest: wrong })]),
|
|
124
|
-
}),
|
|
125
|
-
).rejects.toThrow(/bundle\.yaml does not match its pinned digest: expected sha256:0+, found sha256:/);
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
test("a missing file fails with the declared source and the resolved path", async () => {
|
|
129
|
-
await expect(
|
|
130
|
-
resolveIncludes({ projectRoot: fixtureRoot, declarations: decls(["w", k8sInclude({ source: "nope.yaml" })]) }),
|
|
131
|
-
).rejects.toThrow(new RegExp(`k8sInclude "w" \\(nope\\.yaml\\): file not readable at ${join(fixtureRoot, "nope.yaml")}`));
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
test("a document without apiVersion/kind fails with its index", async () => {
|
|
135
|
-
const readFile = () => Buffer.from("apiVersion: v1\nkind: Namespace\nmetadata:\n name: x\n---\njust: data\n");
|
|
136
|
-
await expect(
|
|
137
|
-
resolveIncludes({ projectRoot: "/p", declarations: decls(["w", k8sInclude({ source: "m.yaml" })]), readFile }),
|
|
138
|
-
).rejects.toThrow(/k8sInclude "w" \(m\.yaml\): document 1 has no string apiVersion and kind/);
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
test("a file holding only empty documents fails", async () => {
|
|
142
|
-
const readFile = () => Buffer.from("---\n---\n# nothing\n");
|
|
143
|
-
await expect(
|
|
144
|
-
resolveIncludes({ projectRoot: "/p", declarations: decls(["w", k8sInclude({ source: "m.yaml" })]), readFile }),
|
|
145
|
-
).rejects.toThrow(/k8sInclude "w" \(m\.yaml\) contains no YAML documents/);
|
|
146
|
-
});
|
|
147
|
-
|
|
148
|
-
test("patches apply before the documents become entities", async () => {
|
|
149
|
-
const entities = await resolveIncludes({
|
|
150
|
-
projectRoot: fixtureRoot,
|
|
151
|
-
declarations: decls([
|
|
152
|
-
"widgets",
|
|
153
|
-
k8sInclude({
|
|
154
|
-
source: "bundle.yaml",
|
|
155
|
-
patches: [
|
|
156
|
-
{ kind: "Deployment", name: "widget-controller", merge: { spec: { replicas: 2 } } },
|
|
157
|
-
{
|
|
158
|
-
kind: "ConfigMap",
|
|
159
|
-
name: "widget-config",
|
|
160
|
-
namespace: "widget-edge",
|
|
161
|
-
jsonPatch: [
|
|
162
|
-
{ op: "test", path: "/data/level", value: "debug" },
|
|
163
|
-
{ op: "replace", path: "/data/level", value: "info" },
|
|
164
|
-
],
|
|
165
|
-
},
|
|
166
|
-
],
|
|
167
|
-
}),
|
|
168
|
-
]),
|
|
169
|
-
});
|
|
170
|
-
expect((propsOf(entities.get("widgets/deploymentWidgetController")).spec as { replicas: number }).replicas).toBe(2);
|
|
171
|
-
expect(propsOf(entities.get("widgets/configMapWidgetConfig.widget-edge")).data).toEqual({ level: "info" });
|
|
172
|
-
});
|
|
173
|
-
|
|
174
|
-
test("a patch selecting nothing fails, naming the include", async () => {
|
|
175
|
-
await expect(
|
|
176
|
-
resolveIncludes({
|
|
177
|
-
projectRoot: fixtureRoot,
|
|
178
|
-
declarations: decls([
|
|
179
|
-
"widgets",
|
|
180
|
-
k8sInclude({ source: "bundle.yaml", patches: [{ kind: "Deployment", name: "widget-manager", merge: {} }] }),
|
|
181
|
-
]),
|
|
182
|
-
}),
|
|
183
|
-
).rejects.toThrow(/k8sInclude "widgets" \(bundle\.yaml\): patch 0 .* matched no document\. Deployment documents present: widget-system\/widget-controller/);
|
|
184
|
-
});
|
|
185
|
-
});
|
|
186
|
-
|
|
187
|
-
describe("resolveIncludes — pinned URLs", () => {
|
|
188
|
-
test("fetches once, verifies the digest, then resolves offline from the cache", async () => {
|
|
189
|
-
const fetched: string[] = [];
|
|
190
|
-
const fetcher: IncludeFetcher = async (url) => {
|
|
191
|
-
fetched.push(url);
|
|
192
|
-
return BUNDLE;
|
|
193
|
-
};
|
|
194
|
-
const declarations = decls(["widgets", k8sInclude({ source: URL_SOURCE, digest: BUNDLE_DIGEST })]);
|
|
195
|
-
|
|
196
|
-
const first = await resolveIncludes({ projectRoot: "/p", declarations, fetch: fetcher, cacheRoot });
|
|
197
|
-
expect(fetched).toEqual([URL_SOURCE]);
|
|
198
|
-
expect([...first.keys()]).toEqual(EXPECTED_KEYS);
|
|
199
|
-
expect(existsSync(join(cacheRoot, `${BUNDLE_DIGEST.replace(":", "-")}.yaml`))).toBe(true);
|
|
200
|
-
|
|
201
|
-
// The second build has no network at all.
|
|
202
|
-
const offline: IncludeFetcher = async () => {
|
|
203
|
-
throw new Error("network unavailable");
|
|
204
|
-
};
|
|
205
|
-
const second = await resolveIncludes({ projectRoot: "/p", declarations, fetch: offline, cacheRoot });
|
|
206
|
-
expect([...second.keys()]).toEqual(EXPECTED_KEYS);
|
|
207
|
-
const ns = propsOf(second.get("widgets/namespaceWidgetSystem")).metadata as { annotations: Record<string, string> };
|
|
208
|
-
expect(ns.annotations[INCLUDE_SOURCE_ANNOTATION]).toBe(URL_SOURCE);
|
|
209
|
-
});
|
|
210
|
-
|
|
211
|
-
test("fetched bytes that do not match the digest fail the build and are not cached", async () => {
|
|
212
|
-
const tampered = Buffer.concat([BUNDLE, Buffer.from("\n# changed upstream\n")]);
|
|
213
|
-
await expect(
|
|
214
|
-
resolveIncludes({
|
|
215
|
-
projectRoot: "/p",
|
|
216
|
-
declarations: decls(["widgets", k8sInclude({ source: URL_SOURCE, digest: BUNDLE_DIGEST })]),
|
|
217
|
-
fetch: async () => tampered,
|
|
218
|
-
cacheRoot,
|
|
219
|
-
}),
|
|
220
|
-
).rejects.toThrow(
|
|
221
|
-
new RegExp(
|
|
222
|
-
`k8sInclude "widgets" \\(${URL_SOURCE.replace(/[.]/g, "\\.")}\\): fetched bytes do not match the pinned digest: ` +
|
|
223
|
-
`expected ${BUNDLE_DIGEST}, fetched ${sha256Digest(tampered)}`,
|
|
224
|
-
),
|
|
225
|
-
);
|
|
226
|
-
expect(existsSync(join(cacheRoot, `${BUNDLE_DIGEST.replace(":", "-")}.yaml`))).toBe(false);
|
|
227
|
-
});
|
|
228
|
-
|
|
229
|
-
test("a corrupt cache entry is refetched, not trusted", async () => {
|
|
230
|
-
writeFileSync(join(cacheRoot, `${BUNDLE_DIGEST.replace(":", "-")}.yaml`), "apiVersion: v1\nkind: Namespace\nmetadata:\n name: evil\n");
|
|
231
|
-
let fetches = 0;
|
|
232
|
-
const entities = await resolveIncludes({
|
|
233
|
-
projectRoot: "/p",
|
|
234
|
-
declarations: decls(["widgets", k8sInclude({ source: URL_SOURCE, digest: BUNDLE_DIGEST })]),
|
|
235
|
-
fetch: async () => {
|
|
236
|
-
fetches++;
|
|
237
|
-
return BUNDLE;
|
|
238
|
-
},
|
|
239
|
-
cacheRoot,
|
|
240
|
-
});
|
|
241
|
-
expect(fetches).toBe(1);
|
|
242
|
-
expect([...entities.keys()]).toEqual(EXPECTED_KEYS);
|
|
243
|
-
});
|
|
244
|
-
|
|
245
|
-
test("a failed fetch names the URL", async () => {
|
|
246
|
-
await expect(
|
|
247
|
-
resolveIncludes({
|
|
248
|
-
projectRoot: "/p",
|
|
249
|
-
declarations: decls(["widgets", k8sInclude({ source: URL_SOURCE, digest: BUNDLE_DIGEST })]),
|
|
250
|
-
fetch: async () => {
|
|
251
|
-
throw new Error("HTTP 404 Not Found");
|
|
252
|
-
},
|
|
253
|
-
cacheRoot,
|
|
254
|
-
}),
|
|
255
|
-
).rejects.toThrow(/widget\.yaml\): fetch failed — HTTP 404 Not Found/);
|
|
256
|
-
});
|
|
257
|
-
|
|
258
|
-
test("CHANT_INCLUDE_CACHE_ROOT moves the cache", async () => {
|
|
259
|
-
const orig = process.env.CHANT_INCLUDE_CACHE_ROOT;
|
|
260
|
-
process.env.CHANT_INCLUDE_CACHE_ROOT = cacheRoot;
|
|
261
|
-
try {
|
|
262
|
-
await resolveIncludes({
|
|
263
|
-
projectRoot: "/p",
|
|
264
|
-
declarations: decls(["widgets", k8sInclude({ source: URL_SOURCE, digest: BUNDLE_DIGEST })]),
|
|
265
|
-
fetch: async () => BUNDLE,
|
|
266
|
-
});
|
|
267
|
-
expect(existsSync(join(cacheRoot, `${BUNDLE_DIGEST.replace(":", "-")}.yaml`))).toBe(true);
|
|
268
|
-
} finally {
|
|
269
|
-
if (orig === undefined) delete process.env.CHANT_INCLUDE_CACHE_ROOT;
|
|
270
|
-
else process.env.CHANT_INCLUDE_CACHE_ROOT = orig;
|
|
271
|
-
}
|
|
272
|
-
});
|
|
273
|
-
});
|
|
274
|
-
|
|
275
|
-
describe("k8sInclude through the build pipeline", () => {
|
|
276
|
-
test("included docs reach the output ownership-stamped, patched, and seen by post-synth checks", async () => {
|
|
277
|
-
const dir = join(tmpdir(), `chant-include-build-${Date.now()}-${Math.random()}`);
|
|
278
|
-
await mkdir(dir, { recursive: true });
|
|
279
|
-
try {
|
|
280
|
-
await writeFile(join(dir, "bundle.yaml"), BUNDLE);
|
|
281
|
-
await writeFile(
|
|
282
|
-
join(dir, "widgets.infra.ts"),
|
|
283
|
-
`import { k8sInclude } from ${JSON.stringify(ENTITY_MODULE)};
|
|
284
|
-
export const widgets = k8sInclude({
|
|
285
|
-
source: "bundle.yaml",
|
|
286
|
-
patches: [{ kind: "Deployment", name: "widget-controller", merge: { spec: { replicas: 4 } } }],
|
|
287
|
-
});
|
|
288
|
-
`,
|
|
289
|
-
);
|
|
290
|
-
|
|
291
|
-
const result = await build(dir, [k8sSerializer], undefined, {
|
|
292
|
-
ownership: { stack: "widgets", env: "prod" },
|
|
293
|
-
buildRoots: [(ctx) => k8sPlugin.buildRoots!({ projectRoot: dir, config: {}, entities: ctx.entities })],
|
|
294
|
-
});
|
|
295
|
-
|
|
296
|
-
expect(result.errors).toEqual([]);
|
|
297
|
-
for (const key of EXPECTED_KEYS) expect(result.entities.has(key)).toBe(true);
|
|
298
|
-
|
|
299
|
-
const output = result.outputs.get("k8s")!;
|
|
300
|
-
const yaml = typeof output === "string" ? output : output.primary;
|
|
301
|
-
expect(yaml).toContain("name: widget-controller");
|
|
302
|
-
expect(yaml).toContain("replicas: 4");
|
|
303
|
-
expect(yaml).toContain("app.kubernetes.io/managed-by: chant");
|
|
304
|
-
expect(yaml).toContain("chant.intentius.io/stack: widgets");
|
|
305
|
-
expect(yaml).toContain(`${INCLUDE_SOURCE_ANNOTATION}: bundle.yaml`);
|
|
306
|
-
// Four documents, the declaration itself emits nothing.
|
|
307
|
-
expect(yaml.split(/^---$/m).filter((d) => d.trim()).length).toBe(4);
|
|
308
|
-
|
|
309
|
-
const ctx: PostSynthContext = {
|
|
310
|
-
outputs: result.outputs,
|
|
311
|
-
entities: result.entities,
|
|
312
|
-
buildResult: {
|
|
313
|
-
outputs: result.outputs,
|
|
314
|
-
entities: result.entities,
|
|
315
|
-
warnings: result.warnings,
|
|
316
|
-
errors: [],
|
|
317
|
-
sourceFileCount: result.sourceFileCount,
|
|
318
|
-
},
|
|
319
|
-
};
|
|
320
|
-
expect(wk8005.check(ctx).some((d) => d.message.includes("API_TOKEN"))).toBe(true);
|
|
321
|
-
} finally {
|
|
322
|
-
await rm(dir, { recursive: true, force: true });
|
|
323
|
-
}
|
|
324
|
-
});
|
|
325
|
-
|
|
326
|
-
test("an include that does not resolve is a build error naming it", async () => {
|
|
327
|
-
const dir = join(tmpdir(), `chant-include-build-bad-${Date.now()}-${Math.random()}`);
|
|
328
|
-
await mkdir(dir, { recursive: true });
|
|
329
|
-
try {
|
|
330
|
-
await writeFile(
|
|
331
|
-
join(dir, "widgets.infra.ts"),
|
|
332
|
-
`import { k8sInclude } from ${JSON.stringify(ENTITY_MODULE)};
|
|
333
|
-
export const widgets = k8sInclude({ source: "vendor/missing.yaml" });
|
|
334
|
-
`,
|
|
335
|
-
);
|
|
336
|
-
const result = await build(dir, [k8sSerializer], undefined, {
|
|
337
|
-
buildRoots: [(ctx) => includeBuildRoot({ projectRoot: dir, config: {}, entities: ctx.entities })],
|
|
338
|
-
});
|
|
339
|
-
expect(result.errors).toHaveLength(1);
|
|
340
|
-
expect(result.errors[0].message).toContain('k8sInclude "widgets" (vendor/missing.yaml): file not readable');
|
|
341
|
-
} finally {
|
|
342
|
-
await rm(dir, { recursive: true, force: true });
|
|
343
|
-
}
|
|
344
|
-
});
|
|
345
|
-
});
|
package/src/include/resolve.ts
DELETED
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Resolving `k8sInclude` declarations at `buildRoots()` (#3566 item 4).
|
|
3
|
-
*
|
|
4
|
-
* For each declaration in the discovered entity set: read the local file or
|
|
5
|
-
* fetch the URL, check the bytes against the pinned digest, parse the
|
|
6
|
-
* multi-document YAML, apply the declaration's patches, and wrap each
|
|
7
|
-
* document in a verbatim manifest entity stamped with the source.
|
|
8
|
-
*
|
|
9
|
-
* - Local paths resolve against the project root (the directory holding
|
|
10
|
-
* `chant.config.*`), as `declareSecret`'s committed ciphertext and
|
|
11
|
-
* `k8s.kustomize.roots` do.
|
|
12
|
-
* - A URL is fetched once. The bytes are cached under their digest in
|
|
13
|
-
* `~/.chant/includes/` (override with `CHANT_INCLUDE_CACHE_ROOT`, the
|
|
14
|
-
* counterpart of the helm lexicon's `CHANT_HELM_RENDER_ROOT`), and a build
|
|
15
|
-
* that finds a cached copy matching the digest never touches the network.
|
|
16
|
-
* Fetched bytes that do not match the digest fail the build and are not
|
|
17
|
-
* cached.
|
|
18
|
-
* - Entity names are `<declaration name>/<kindName>`, qualified by
|
|
19
|
-
* namespace and then numbered in document order on collision, the scheme
|
|
20
|
-
* kustomize roots use. Keying on the declaration's export name rather than
|
|
21
|
-
* the URL keeps the names stable when a pinned version is bumped, so the
|
|
22
|
-
* live diff lines up across the upgrade.
|
|
23
|
-
* - A missing file, a failed fetch, a file with no documents, and a
|
|
24
|
-
* document without a string `apiVersion` and `kind` each fail the build
|
|
25
|
-
* with the path or URL in the message. Empty documents (a stray `---`)
|
|
26
|
-
* are skipped.
|
|
27
|
-
*/
|
|
28
|
-
import { createHash } from "node:crypto";
|
|
29
|
-
import { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
30
|
-
import { homedir } from "node:os";
|
|
31
|
-
import { join, resolve } from "node:path";
|
|
32
|
-
import { loadAll } from "js-yaml";
|
|
33
|
-
import type { Declarable } from "@intentius/chant/declarable";
|
|
34
|
-
import type { BuildRootContext, BuildRootContribution } from "@intentius/chant/lexicon";
|
|
35
|
-
import { applyRenderedPatches } from "../patch/rendered-patch";
|
|
36
|
-
import { addRenderedEntity, renderedManifestEntity } from "../kustomize/rendered-entity";
|
|
37
|
-
import { INCLUDE_SOURCE_ANNOTATION, isK8sInclude, isRemoteSource, type K8sIncludeDeclaration } from "./entity";
|
|
38
|
-
|
|
39
|
-
/** Fetches a URL's bytes. Injectable so tests never touch the network. */
|
|
40
|
-
export type IncludeFetcher = (url: string) => Promise<Uint8Array>;
|
|
41
|
-
|
|
42
|
-
export const defaultIncludeFetcher: IncludeFetcher = async (url) => {
|
|
43
|
-
const response = await fetch(url, { redirect: "follow" });
|
|
44
|
-
if (!response.ok) throw new Error(`HTTP ${response.status} ${response.statusText}`.trim());
|
|
45
|
-
return new Uint8Array(await response.arrayBuffer());
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
/** Where fetched include sources are cached, keyed by digest. */
|
|
49
|
-
export function includeCacheRoot(): string {
|
|
50
|
-
return process.env.CHANT_INCLUDE_CACHE_ROOT ?? join(homedir(), ".chant", "includes");
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export function sha256Digest(bytes: Uint8Array): string {
|
|
54
|
-
return `sha256:${createHash("sha256").update(bytes).digest("hex")}`;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/** `sha256:<hex>` -> `sha256-<hex>.yaml`; colons are not filesystem-safe everywhere. */
|
|
58
|
-
function cachePath(root: string, digest: string): string {
|
|
59
|
-
return join(root, `${digest.replace(":", "-")}.yaml`);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export interface ResolveIncludesOptions {
|
|
63
|
-
projectRoot: string;
|
|
64
|
-
/** Declarations keyed by entity (export) name. */
|
|
65
|
-
declarations: ReadonlyMap<string, K8sIncludeDeclaration>;
|
|
66
|
-
fetch?: IncludeFetcher;
|
|
67
|
-
readFile?: (path: string) => Uint8Array;
|
|
68
|
-
/** Cache directory; defaults to {@link includeCacheRoot}. */
|
|
69
|
-
cacheRoot?: string;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
async function loadBytes(
|
|
73
|
-
name: string,
|
|
74
|
-
decl: K8sIncludeDeclaration,
|
|
75
|
-
opts: ResolveIncludesOptions,
|
|
76
|
-
): Promise<Uint8Array> {
|
|
77
|
-
const read = opts.readFile ?? ((path: string) => readFileSync(path));
|
|
78
|
-
const label = `k8sInclude "${name}" (${decl.source})`;
|
|
79
|
-
|
|
80
|
-
if (!isRemoteSource(decl.source)) {
|
|
81
|
-
const absolute = resolve(opts.projectRoot, decl.source);
|
|
82
|
-
let bytes: Uint8Array;
|
|
83
|
-
try {
|
|
84
|
-
bytes = read(absolute);
|
|
85
|
-
} catch (err) {
|
|
86
|
-
throw new Error(
|
|
87
|
-
`${label}: file not readable at ${absolute} — ${err instanceof Error ? err.message : String(err)}`,
|
|
88
|
-
);
|
|
89
|
-
}
|
|
90
|
-
if (decl.digest !== undefined) {
|
|
91
|
-
const actual = sha256Digest(bytes);
|
|
92
|
-
if (actual !== decl.digest) {
|
|
93
|
-
throw new Error(`${label}: ${absolute} does not match its pinned digest: expected ${decl.digest}, found ${actual}`);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
return bytes;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
// The factory refuses an unpinned URL; this guards a declaration revived
|
|
100
|
-
// from the entity wire format or built by hand.
|
|
101
|
-
if (decl.digest === undefined) {
|
|
102
|
-
throw new Error(`${label}: a URL source must be pinned with a sha256 digest`);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
const root = opts.cacheRoot ?? includeCacheRoot();
|
|
106
|
-
const cached = cachePath(root, decl.digest);
|
|
107
|
-
if (existsSync(cached)) {
|
|
108
|
-
const bytes = readFileSync(cached);
|
|
109
|
-
// A corrupt or hand-edited cache entry is refetched, never trusted.
|
|
110
|
-
if (sha256Digest(bytes) === decl.digest) return bytes;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
const fetcher = opts.fetch ?? defaultIncludeFetcher;
|
|
114
|
-
let bytes: Uint8Array;
|
|
115
|
-
try {
|
|
116
|
-
bytes = await fetcher(decl.source);
|
|
117
|
-
} catch (err) {
|
|
118
|
-
throw new Error(`${label}: fetch failed — ${err instanceof Error ? err.message : String(err)}`);
|
|
119
|
-
}
|
|
120
|
-
const actual = sha256Digest(bytes);
|
|
121
|
-
if (actual !== decl.digest) {
|
|
122
|
-
throw new Error(
|
|
123
|
-
`${label}: fetched bytes do not match the pinned digest: expected ${decl.digest}, fetched ${actual}. ` +
|
|
124
|
-
`The content at the URL changed, or the digest is wrong.`,
|
|
125
|
-
);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
try {
|
|
129
|
-
mkdirSync(root, { recursive: true });
|
|
130
|
-
const tmp = `${cached}.${process.pid}.tmp`;
|
|
131
|
-
writeFileSync(tmp, bytes);
|
|
132
|
-
renameSync(tmp, cached);
|
|
133
|
-
} catch {
|
|
134
|
-
// A cache write failure is not fatal: the verified bytes are in memory,
|
|
135
|
-
// and the next build fetches again.
|
|
136
|
-
}
|
|
137
|
-
return bytes;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
/** Parse, validate and patch one source's documents. */
|
|
141
|
-
function documentsOf(name: string, decl: K8sIncludeDeclaration, text: string): Array<Record<string, unknown>> {
|
|
142
|
-
const label = `k8sInclude "${name}" (${decl.source})`;
|
|
143
|
-
let parsed: unknown[];
|
|
144
|
-
try {
|
|
145
|
-
parsed = loadAll(text);
|
|
146
|
-
} catch (err) {
|
|
147
|
-
throw new Error(`${label} is not valid YAML: ${err instanceof Error ? err.message : String(err)}`);
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
const docs: Array<Record<string, unknown>> = [];
|
|
151
|
-
parsed.forEach((doc, i) => {
|
|
152
|
-
if (doc === null || doc === undefined) return;
|
|
153
|
-
if (typeof doc !== "object" || Array.isArray(doc)) {
|
|
154
|
-
throw new Error(`${label}: document ${i} is not a Kubernetes object`);
|
|
155
|
-
}
|
|
156
|
-
const record = doc as Record<string, unknown>;
|
|
157
|
-
if (typeof record.apiVersion !== "string" || !record.apiVersion || typeof record.kind !== "string" || !record.kind) {
|
|
158
|
-
throw new Error(`${label}: document ${i} has no string apiVersion and kind`);
|
|
159
|
-
}
|
|
160
|
-
docs.push(record);
|
|
161
|
-
});
|
|
162
|
-
if (docs.length === 0) throw new Error(`${label} contains no YAML documents`);
|
|
163
|
-
|
|
164
|
-
return applyRenderedPatches(docs, decl.patches, label);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* Resolve every declaration into entities. Throws on the first one that
|
|
169
|
-
* does not resolve: a build that would silently drop an included bundle
|
|
170
|
-
* must not proceed.
|
|
171
|
-
*/
|
|
172
|
-
export async function resolveIncludes(opts: ResolveIncludesOptions): Promise<Map<string, Declarable>> {
|
|
173
|
-
const entities = new Map<string, Declarable>();
|
|
174
|
-
for (const [name, decl] of opts.declarations) {
|
|
175
|
-
const bytes = await loadBytes(name, decl, opts);
|
|
176
|
-
const text = Buffer.from(bytes).toString("utf-8");
|
|
177
|
-
for (const doc of documentsOf(name, decl, text)) {
|
|
178
|
-
// documentsOf checked apiVersion/kind, so the wrap cannot return null.
|
|
179
|
-
addRenderedEntity(entities, name, renderedManifestEntity(doc, decl.source, INCLUDE_SOURCE_ANNOTATION)!);
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
return entities;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
/** Every `k8sInclude` declaration in an entity map, keyed by entity name. */
|
|
186
|
-
export function includeDeclarations(
|
|
187
|
-
entities: ReadonlyMap<string, Declarable>,
|
|
188
|
-
): Map<string, K8sIncludeDeclaration> {
|
|
189
|
-
const out = new Map<string, K8sIncludeDeclaration>();
|
|
190
|
-
for (const [name, entity] of entities) {
|
|
191
|
-
if (isK8sInclude(entity)) out.set(name, entity);
|
|
192
|
-
}
|
|
193
|
-
return out;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
/** The `buildRoots` contribution: the documents of every `k8sInclude`. */
|
|
197
|
-
export async function includeBuildRoot(
|
|
198
|
-
ctx: BuildRootContext,
|
|
199
|
-
overrides?: Pick<ResolveIncludesOptions, "fetch" | "readFile" | "cacheRoot">,
|
|
200
|
-
): Promise<BuildRootContribution> {
|
|
201
|
-
const declarations = includeDeclarations(ctx.entities ?? new Map());
|
|
202
|
-
if (declarations.size === 0) return { entities: new Map() };
|
|
203
|
-
return { entities: await resolveIncludes({ projectRoot: ctx.projectRoot, declarations, ...overrides }) };
|
|
204
|
-
}
|