@intentius/chant-lexicon-k8s 0.46.0 → 0.50.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/dist/components/kubectl-apply.d.ts +5 -0
- package/dist/components/kubectl-apply.d.ts.map +1 -1
- package/dist/composites/flux-app.d.ts +12 -0
- package/dist/composites/flux-app.d.ts.map +1 -1
- package/dist/composites/index.d.ts +8 -0
- package/dist/composites/index.d.ts.map +1 -1
- package/dist/composites/inference-service.d.ts +86 -0
- package/dist/composites/inference-service.d.ts.map +1 -0
- package/dist/composites/model.d.ts +80 -0
- package/dist/composites/model.d.ts.map +1 -0
- package/dist/composites/operator-stack.d.ts +183 -0
- package/dist/composites/operator-stack.d.ts.map +1 -0
- package/dist/composites/vllm-serving-runtime.d.ts +100 -0
- package/dist/composites/vllm-serving-runtime.d.ts.map +1 -0
- package/dist/crd/crd-sources.d.ts.map +1 -1
- package/dist/deep-observe-hooks.d.ts.map +1 -1
- package/dist/generated/index.d.ts +167 -40
- package/dist/generated/index.d.ts.map +1 -1
- package/dist/group-namespace.d.ts.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/integrity.json +41 -33
- package/dist/kube/apply.d.ts.map +1 -1
- package/dist/lint/audit-catalog.d.ts.map +1 -1
- package/dist/lint/post-synth/argo-helpers.d.ts.map +1 -1
- package/dist/lint/post-synth/crd-schema-helpers.d.ts.map +1 -1
- package/dist/lint/post-synth/index.d.ts.map +1 -1
- package/dist/lint/post-synth/k8s-helpers.d.ts +56 -6
- package/dist/lint/post-synth/k8s-helpers.d.ts.map +1 -1
- package/dist/lint/post-synth/sops-helpers.d.ts +38 -0
- package/dist/lint/post-synth/sops-helpers.d.ts.map +1 -0
- package/dist/lint/post-synth/wk8005.d.ts.map +1 -1
- package/dist/lint/post-synth/wk8006.d.ts.map +1 -1
- package/dist/lint/post-synth/wk8041.d.ts.map +1 -1
- package/dist/lint/post-synth/wk8042.d.ts.map +1 -1
- package/dist/lint/post-synth/wk8101.d.ts.map +1 -1
- package/dist/lint/post-synth/wk8102.d.ts.map +1 -1
- package/dist/lint/post-synth/wk8103.d.ts.map +1 -1
- package/dist/lint/post-synth/wk8104.d.ts.map +1 -1
- package/dist/lint/post-synth/wk8105.d.ts.map +1 -1
- package/dist/lint/post-synth/wk8201.d.ts.map +1 -1
- package/dist/lint/post-synth/wk8202.d.ts.map +1 -1
- package/dist/lint/post-synth/wk8203.d.ts.map +1 -1
- package/dist/lint/post-synth/wk8204.d.ts.map +1 -1
- package/dist/lint/post-synth/wk8205.d.ts.map +1 -1
- package/dist/lint/post-synth/wk8207.d.ts.map +1 -1
- package/dist/lint/post-synth/wk8208.d.ts.map +1 -1
- package/dist/lint/post-synth/wk8209.d.ts.map +1 -1
- package/dist/lint/post-synth/wk8301.d.ts.map +1 -1
- package/dist/lint/post-synth/wk8302.d.ts.map +1 -1
- package/dist/lint/post-synth/wk8303.d.ts.map +1 -1
- package/dist/lint/post-synth/wk8304.d.ts.map +1 -1
- package/dist/lint/post-synth/wk8305.d.ts.map +1 -1
- package/dist/lint/post-synth/wk8306.d.ts.map +1 -1
- package/dist/lint/post-synth/wk8401.d.ts.map +1 -1
- package/dist/lint/post-synth/wk8402.d.ts.map +1 -1
- package/dist/lint/post-synth/wk8403.d.ts.map +1 -1
- package/dist/lint/post-synth/wk8404.d.ts +12 -0
- package/dist/lint/post-synth/wk8404.d.ts.map +1 -0
- package/dist/lint/post-synth/wk8405.d.ts +13 -0
- package/dist/lint/post-synth/wk8405.d.ts.map +1 -0
- package/dist/lint/post-synth/wk8406.d.ts +12 -0
- package/dist/lint/post-synth/wk8406.d.ts.map +1 -0
- package/dist/lint/post-synth/wk8407.d.ts +21 -0
- package/dist/lint/post-synth/wk8407.d.ts.map +1 -0
- package/dist/lint/post-synth/wk8503.d.ts +39 -0
- package/dist/lint/post-synth/wk8503.d.ts.map +1 -0
- package/dist/lint/post-synth/wk8504.d.ts +28 -0
- package/dist/lint/post-synth/wk8504.d.ts.map +1 -0
- package/dist/lint/post-synth/wk8505.d.ts +28 -0
- package/dist/lint/post-synth/wk8505.d.ts.map +1 -0
- package/dist/manifest.json +1 -1
- package/dist/meta.json +1039 -68
- package/dist/okf/index.md +26 -2
- package/dist/okf/rules/FLUX002.md +0 -1
- package/dist/okf/rules/WK8404.md +11 -0
- package/dist/okf/rules/WK8405.md +17 -0
- package/dist/okf/rules/WK8406.md +11 -0
- package/dist/okf/rules/WK8407.md +15 -0
- package/dist/okf/rules/WK8503.md +17 -0
- package/dist/okf/rules/WK8504.md +11 -0
- package/dist/okf/rules/WK8505.md +15 -0
- package/dist/okf/types/AWSClusterControllerIdentity.md +14 -0
- package/dist/okf/types/AWSManagedCluster.md +14 -0
- package/dist/okf/types/AWSManagedControlPlane.md +14 -0
- package/dist/okf/types/AWSManagedMachinePool.md +14 -0
- package/dist/okf/types/CAPICluster.md +14 -0
- package/dist/okf/types/Certificate.md +1 -0
- package/dist/okf/types/ClusterResourceSet.md +14 -0
- package/dist/okf/types/ClusterServingRuntime.md +14 -0
- package/dist/okf/types/{Cluster.md → CnpgCluster.md} +2 -2
- package/dist/okf/types/DBInstance.md +14 -0
- package/dist/okf/types/{Bucket.md → FluxBucket.md} +2 -6
- package/dist/okf/types/HelmChartProxy.md +14 -0
- package/dist/okf/types/IamRole.md +14 -0
- package/dist/okf/types/InferenceService.md +19 -0
- package/dist/okf/types/InfisicalDynamicSecret.md +4 -0
- package/dist/okf/types/InfisicalSecret.md +4 -0
- package/dist/okf/types/Kustomization.md +1 -0
- package/dist/okf/types/MachinePool.md +14 -0
- package/dist/okf/types/PDB.md +1 -0
- package/dist/okf/types/PodIdentityAssociation.md +14 -0
- package/dist/okf/types/Policy.md +14 -0
- package/dist/okf/types/S3Bucket.md +14 -0
- package/dist/okf/types/ServingRuntime.md +14 -0
- package/dist/okf/types/StatefulSet.md +1 -0
- package/dist/okf/types/User.md +14 -0
- package/dist/op/activities/ensure-secret.d.ts +41 -0
- package/dist/op/activities/ensure-secret.d.ts.map +1 -0
- package/dist/op/activities/index.d.ts +2 -0
- package/dist/op/activities/index.d.ts.map +1 -1
- package/dist/op/activities/kubectl.d.ts +9 -0
- package/dist/op/activities/kubectl.d.ts.map +1 -1
- package/dist/op/activities/wait-for-ready.d.ts.map +1 -1
- package/dist/op/builders.d.ts +69 -0
- package/dist/op/builders.d.ts.map +1 -0
- package/dist/plugin.d.ts.map +1 -1
- package/dist/rules/argo-helpers.ts +2 -6
- package/dist/rules/crd-schema-helpers.ts +4 -6
- package/dist/rules/k8s-helpers.ts +87 -24
- package/dist/rules/sops-helpers.ts +76 -0
- package/dist/rules/wk8005.ts +27 -32
- package/dist/rules/wk8006.ts +33 -38
- package/dist/rules/wk8041.ts +19 -24
- package/dist/rules/wk8042.ts +17 -22
- package/dist/rules/wk8101.ts +29 -34
- package/dist/rules/wk8102.ts +13 -18
- package/dist/rules/wk8103.ts +17 -22
- package/dist/rules/wk8104.ts +30 -35
- package/dist/rules/wk8105.ts +16 -21
- package/dist/rules/wk8201.ts +26 -31
- package/dist/rules/wk8202.ts +17 -22
- package/dist/rules/wk8203.ts +17 -22
- package/dist/rules/wk8204.ts +46 -51
- package/dist/rules/wk8205.ts +27 -32
- package/dist/rules/wk8207.ts +14 -19
- package/dist/rules/wk8208.ts +14 -19
- package/dist/rules/wk8209.ts +14 -19
- package/dist/rules/wk8301.ts +25 -30
- package/dist/rules/wk8302.ts +19 -24
- package/dist/rules/wk8303.ts +23 -26
- package/dist/rules/wk8304.ts +35 -40
- package/dist/rules/wk8305.ts +39 -42
- package/dist/rules/wk8306.ts +20 -25
- package/dist/rules/wk8401.ts +59 -64
- package/dist/rules/wk8402.ts +13 -18
- package/dist/rules/wk8403.ts +32 -37
- package/dist/rules/wk8404.ts +49 -0
- package/dist/rules/wk8405.ts +85 -0
- package/dist/rules/wk8406.ts +55 -0
- package/dist/rules/wk8407.ts +66 -0
- package/dist/rules/wk8503.ts +220 -0
- package/dist/rules/wk8504.ts +51 -0
- package/dist/rules/wk8505.ts +63 -0
- package/dist/secret-labels.d.ts +31 -0
- package/dist/secret-labels.d.ts.map +1 -0
- package/dist/secret-store.d.ts +73 -0
- package/dist/secret-store.d.ts.map +1 -0
- package/dist/serializer.d.ts.map +1 -1
- package/dist/sops/encrypted-secret-file.d.ts +52 -0
- package/dist/sops/encrypted-secret-file.d.ts.map +1 -0
- package/dist/sops/entity.d.ts +31 -0
- package/dist/sops/entity.d.ts.map +1 -0
- package/dist/teardown.d.ts.map +1 -1
- package/dist/types/index.d.ts +261 -9
- package/package.json +4 -4
- package/src/components/kubectl-apply.ts +5 -0
- package/src/composites/composites.test.ts +556 -0
- package/src/composites/flux-app.ts +23 -0
- package/src/composites/index.ts +15 -0
- package/src/composites/inference-service.ts +140 -0
- package/src/composites/model.ts +150 -0
- package/src/composites/operator-stack.ts +385 -0
- package/src/composites/vllm-serving-runtime.test.ts +167 -0
- package/src/composites/vllm-serving-runtime.ts +196 -0
- package/src/crd/cnpg.test.ts +8 -3
- package/src/crd/crd-sources.ts +183 -0
- package/src/crd/parser.test.ts +14 -0
- package/src/deep-observe-hooks.ts +24 -0
- package/src/deep-observe.test.ts +89 -0
- package/src/generated/index.d.ts +261 -9
- package/src/generated/index.ts +167 -40
- package/src/generated/lexicon-k8s.json +1039 -68
- package/src/generated/operations.json +272 -0
- package/src/group-namespace.test.ts +31 -0
- package/src/group-namespace.ts +13 -0
- package/src/index.ts +17 -0
- package/src/kube/apply.ts +5 -0
- package/src/lint/audit-catalog.ts +7 -0
- package/src/lint/post-synth/argo-helpers.ts +2 -6
- package/src/lint/post-synth/crd-schema-helpers.ts +4 -6
- package/src/lint/post-synth/index.ts +14 -0
- package/src/lint/post-synth/k8s-helpers.test.ts +26 -9
- package/src/lint/post-synth/k8s-helpers.ts +87 -24
- package/src/lint/post-synth/post-synth.test.ts +826 -0
- package/src/lint/post-synth/sops-helpers.ts +76 -0
- package/src/lint/post-synth/wk8005.ts +27 -32
- package/src/lint/post-synth/wk8006.ts +33 -38
- package/src/lint/post-synth/wk8041.ts +19 -24
- package/src/lint/post-synth/wk8042.ts +17 -22
- package/src/lint/post-synth/wk8101.ts +29 -34
- package/src/lint/post-synth/wk8102.ts +13 -18
- package/src/lint/post-synth/wk8103.ts +17 -22
- package/src/lint/post-synth/wk8104.ts +30 -35
- package/src/lint/post-synth/wk8105.ts +16 -21
- package/src/lint/post-synth/wk8201.ts +26 -31
- package/src/lint/post-synth/wk8202.ts +17 -22
- package/src/lint/post-synth/wk8203.ts +17 -22
- package/src/lint/post-synth/wk8204.ts +46 -51
- package/src/lint/post-synth/wk8205.ts +27 -32
- package/src/lint/post-synth/wk8207.ts +14 -19
- package/src/lint/post-synth/wk8208.ts +14 -19
- package/src/lint/post-synth/wk8209.ts +14 -19
- package/src/lint/post-synth/wk8301.ts +25 -30
- package/src/lint/post-synth/wk8302.ts +19 -24
- package/src/lint/post-synth/wk8303.ts +23 -26
- package/src/lint/post-synth/wk8304.ts +35 -40
- package/src/lint/post-synth/wk8305.ts +39 -42
- package/src/lint/post-synth/wk8306.ts +20 -25
- package/src/lint/post-synth/wk8401.ts +59 -64
- package/src/lint/post-synth/wk8402.ts +13 -18
- package/src/lint/post-synth/wk8403.ts +32 -37
- package/src/lint/post-synth/wk8404.ts +49 -0
- package/src/lint/post-synth/wk8405.ts +85 -0
- package/src/lint/post-synth/wk8406.ts +55 -0
- package/src/lint/post-synth/wk8407.ts +66 -0
- package/src/lint/post-synth/wk8503.ts +220 -0
- package/src/lint/post-synth/wk8504.ts +51 -0
- package/src/lint/post-synth/wk8505.ts +63 -0
- package/src/op/activities/ensure-secret.ts +71 -0
- package/src/op/activities/index.ts +7 -0
- package/src/op/activities/kubectl.test.ts +32 -0
- package/src/op/activities/kubectl.ts +28 -5
- package/src/op/activities/wait-for-ready.test.ts +34 -0
- package/src/op/activities/wait-for-ready.ts +26 -0
- package/src/op/builders.test.ts +82 -0
- package/src/op/builders.ts +95 -0
- package/src/plugin.ts +21 -2
- package/src/secret-labels.ts +36 -0
- package/src/secret-store.test.ts +184 -0
- package/src/secret-store.ts +165 -0
- package/src/serializer.ts +41 -2
- package/src/sops/encrypted-secret-file.test.ts +333 -0
- package/src/sops/encrypted-secret-file.ts +264 -0
- package/src/sops/entity.ts +53 -0
- package/src/teardown.test.ts +36 -0
- package/src/teardown.ts +14 -0
- package/src/testdata/sops/db-credentials.sops.yaml +23 -0
|
@@ -31,6 +31,38 @@
|
|
|
31
31
|
"watch"
|
|
32
32
|
]
|
|
33
33
|
},
|
|
34
|
+
"K8s::Addons::ClusterResourceSet": {
|
|
35
|
+
"entityType": "K8s::Addons::ClusterResourceSet",
|
|
36
|
+
"apiVersion": "addons.cluster.x-k8s.io/v1beta2",
|
|
37
|
+
"kind": "ClusterResourceSet",
|
|
38
|
+
"plural": "clusterresourcesets",
|
|
39
|
+
"scope": "Namespaced",
|
|
40
|
+
"verbs": [
|
|
41
|
+
"delete",
|
|
42
|
+
"get",
|
|
43
|
+
"list",
|
|
44
|
+
"patch",
|
|
45
|
+
"post",
|
|
46
|
+
"put",
|
|
47
|
+
"watch"
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
"K8s::Addons::HelmChartProxy": {
|
|
51
|
+
"entityType": "K8s::Addons::HelmChartProxy",
|
|
52
|
+
"apiVersion": "addons.cluster.x-k8s.io/v1alpha1",
|
|
53
|
+
"kind": "HelmChartProxy",
|
|
54
|
+
"plural": "helmchartproxies",
|
|
55
|
+
"scope": "Namespaced",
|
|
56
|
+
"verbs": [
|
|
57
|
+
"delete",
|
|
58
|
+
"get",
|
|
59
|
+
"list",
|
|
60
|
+
"patch",
|
|
61
|
+
"post",
|
|
62
|
+
"put",
|
|
63
|
+
"watch"
|
|
64
|
+
]
|
|
65
|
+
},
|
|
34
66
|
"K8s::Admissionregistration::MutatingAdmissionPolicy": {
|
|
35
67
|
"entityType": "K8s::Admissionregistration::MutatingAdmissionPolicy",
|
|
36
68
|
"apiVersion": "admissionregistration.k8s.io/v1",
|
|
@@ -495,6 +527,38 @@
|
|
|
495
527
|
"scope": "Namespaced",
|
|
496
528
|
"verbs": []
|
|
497
529
|
},
|
|
530
|
+
"K8s::CAPI::Cluster": {
|
|
531
|
+
"entityType": "K8s::CAPI::Cluster",
|
|
532
|
+
"apiVersion": "cluster.x-k8s.io/v1beta2",
|
|
533
|
+
"kind": "Cluster",
|
|
534
|
+
"plural": "clusters",
|
|
535
|
+
"scope": "Namespaced",
|
|
536
|
+
"verbs": [
|
|
537
|
+
"delete",
|
|
538
|
+
"get",
|
|
539
|
+
"list",
|
|
540
|
+
"patch",
|
|
541
|
+
"post",
|
|
542
|
+
"put",
|
|
543
|
+
"watch"
|
|
544
|
+
]
|
|
545
|
+
},
|
|
546
|
+
"K8s::CAPI::MachinePool": {
|
|
547
|
+
"entityType": "K8s::CAPI::MachinePool",
|
|
548
|
+
"apiVersion": "cluster.x-k8s.io/v1beta2",
|
|
549
|
+
"kind": "MachinePool",
|
|
550
|
+
"plural": "machinepools",
|
|
551
|
+
"scope": "Namespaced",
|
|
552
|
+
"verbs": [
|
|
553
|
+
"delete",
|
|
554
|
+
"get",
|
|
555
|
+
"list",
|
|
556
|
+
"patch",
|
|
557
|
+
"post",
|
|
558
|
+
"put",
|
|
559
|
+
"watch"
|
|
560
|
+
]
|
|
561
|
+
},
|
|
498
562
|
"K8s::CertManager::Certificate": {
|
|
499
563
|
"entityType": "K8s::CertManager::Certificate",
|
|
500
564
|
"apiVersion": "cert-manager.io/v1",
|
|
@@ -705,6 +769,22 @@
|
|
|
705
769
|
"watch"
|
|
706
770
|
]
|
|
707
771
|
},
|
|
772
|
+
"K8s::Controlplane::AWSManagedControlPlane": {
|
|
773
|
+
"entityType": "K8s::Controlplane::AWSManagedControlPlane",
|
|
774
|
+
"apiVersion": "controlplane.cluster.x-k8s.io/v1beta2",
|
|
775
|
+
"kind": "AWSManagedControlPlane",
|
|
776
|
+
"plural": "awsmanagedcontrolplanes",
|
|
777
|
+
"scope": "Namespaced",
|
|
778
|
+
"verbs": [
|
|
779
|
+
"delete",
|
|
780
|
+
"get",
|
|
781
|
+
"list",
|
|
782
|
+
"patch",
|
|
783
|
+
"post",
|
|
784
|
+
"put",
|
|
785
|
+
"watch"
|
|
786
|
+
]
|
|
787
|
+
},
|
|
708
788
|
"K8s::Coordination::Lease": {
|
|
709
789
|
"entityType": "K8s::Coordination::Lease",
|
|
710
790
|
"apiVersion": "coordination.k8s.io/v1",
|
|
@@ -1199,6 +1279,22 @@
|
|
|
1199
1279
|
"scope": "Namespaced",
|
|
1200
1280
|
"verbs": []
|
|
1201
1281
|
},
|
|
1282
|
+
"K8s::Eks::PodIdentityAssociation": {
|
|
1283
|
+
"entityType": "K8s::Eks::PodIdentityAssociation",
|
|
1284
|
+
"apiVersion": "eks.services.k8s.aws/v1alpha1",
|
|
1285
|
+
"kind": "PodIdentityAssociation",
|
|
1286
|
+
"plural": "podidentityassociations",
|
|
1287
|
+
"scope": "Namespaced",
|
|
1288
|
+
"verbs": [
|
|
1289
|
+
"delete",
|
|
1290
|
+
"get",
|
|
1291
|
+
"list",
|
|
1292
|
+
"patch",
|
|
1293
|
+
"post",
|
|
1294
|
+
"put",
|
|
1295
|
+
"watch"
|
|
1296
|
+
]
|
|
1297
|
+
},
|
|
1202
1298
|
"K8s::Events::Event": {
|
|
1203
1299
|
"entityType": "K8s::Events::Event",
|
|
1204
1300
|
"apiVersion": "events.k8s.io/v1",
|
|
@@ -1617,6 +1713,54 @@
|
|
|
1617
1713
|
"watch"
|
|
1618
1714
|
]
|
|
1619
1715
|
},
|
|
1716
|
+
"K8s::Iam::Policy": {
|
|
1717
|
+
"entityType": "K8s::Iam::Policy",
|
|
1718
|
+
"apiVersion": "iam.services.k8s.aws/v1alpha1",
|
|
1719
|
+
"kind": "Policy",
|
|
1720
|
+
"plural": "policies",
|
|
1721
|
+
"scope": "Namespaced",
|
|
1722
|
+
"verbs": [
|
|
1723
|
+
"delete",
|
|
1724
|
+
"get",
|
|
1725
|
+
"list",
|
|
1726
|
+
"patch",
|
|
1727
|
+
"post",
|
|
1728
|
+
"put",
|
|
1729
|
+
"watch"
|
|
1730
|
+
]
|
|
1731
|
+
},
|
|
1732
|
+
"K8s::Iam::Role": {
|
|
1733
|
+
"entityType": "K8s::Iam::Role",
|
|
1734
|
+
"apiVersion": "iam.services.k8s.aws/v1alpha1",
|
|
1735
|
+
"kind": "Role",
|
|
1736
|
+
"plural": "roles",
|
|
1737
|
+
"scope": "Namespaced",
|
|
1738
|
+
"verbs": [
|
|
1739
|
+
"delete",
|
|
1740
|
+
"get",
|
|
1741
|
+
"list",
|
|
1742
|
+
"patch",
|
|
1743
|
+
"post",
|
|
1744
|
+
"put",
|
|
1745
|
+
"watch"
|
|
1746
|
+
]
|
|
1747
|
+
},
|
|
1748
|
+
"K8s::Iam::User": {
|
|
1749
|
+
"entityType": "K8s::Iam::User",
|
|
1750
|
+
"apiVersion": "iam.services.k8s.aws/v1alpha1",
|
|
1751
|
+
"kind": "User",
|
|
1752
|
+
"plural": "users",
|
|
1753
|
+
"scope": "Namespaced",
|
|
1754
|
+
"verbs": [
|
|
1755
|
+
"delete",
|
|
1756
|
+
"get",
|
|
1757
|
+
"list",
|
|
1758
|
+
"patch",
|
|
1759
|
+
"post",
|
|
1760
|
+
"put",
|
|
1761
|
+
"watch"
|
|
1762
|
+
]
|
|
1763
|
+
},
|
|
1620
1764
|
"K8s::Infisical::InfisicalDynamicSecret": {
|
|
1621
1765
|
"entityType": "K8s::Infisical::InfisicalDynamicSecret",
|
|
1622
1766
|
"apiVersion": "secrets.infisical.com/v1alpha1",
|
|
@@ -1665,6 +1809,54 @@
|
|
|
1665
1809
|
"watch"
|
|
1666
1810
|
]
|
|
1667
1811
|
},
|
|
1812
|
+
"K8s::Infrastructure::AWSClusterControllerIdentity": {
|
|
1813
|
+
"entityType": "K8s::Infrastructure::AWSClusterControllerIdentity",
|
|
1814
|
+
"apiVersion": "infrastructure.cluster.x-k8s.io/v1beta2",
|
|
1815
|
+
"kind": "AWSClusterControllerIdentity",
|
|
1816
|
+
"plural": "awsclustercontrolleridentities",
|
|
1817
|
+
"scope": "Cluster",
|
|
1818
|
+
"verbs": [
|
|
1819
|
+
"delete",
|
|
1820
|
+
"get",
|
|
1821
|
+
"list",
|
|
1822
|
+
"patch",
|
|
1823
|
+
"post",
|
|
1824
|
+
"put",
|
|
1825
|
+
"watch"
|
|
1826
|
+
]
|
|
1827
|
+
},
|
|
1828
|
+
"K8s::Infrastructure::AWSManagedCluster": {
|
|
1829
|
+
"entityType": "K8s::Infrastructure::AWSManagedCluster",
|
|
1830
|
+
"apiVersion": "infrastructure.cluster.x-k8s.io/v1beta2",
|
|
1831
|
+
"kind": "AWSManagedCluster",
|
|
1832
|
+
"plural": "awsmanagedclusters",
|
|
1833
|
+
"scope": "Namespaced",
|
|
1834
|
+
"verbs": [
|
|
1835
|
+
"delete",
|
|
1836
|
+
"get",
|
|
1837
|
+
"list",
|
|
1838
|
+
"patch",
|
|
1839
|
+
"post",
|
|
1840
|
+
"put",
|
|
1841
|
+
"watch"
|
|
1842
|
+
]
|
|
1843
|
+
},
|
|
1844
|
+
"K8s::Infrastructure::AWSManagedMachinePool": {
|
|
1845
|
+
"entityType": "K8s::Infrastructure::AWSManagedMachinePool",
|
|
1846
|
+
"apiVersion": "infrastructure.cluster.x-k8s.io/v1beta2",
|
|
1847
|
+
"kind": "AWSManagedMachinePool",
|
|
1848
|
+
"plural": "awsmanagedmachinepools",
|
|
1849
|
+
"scope": "Namespaced",
|
|
1850
|
+
"verbs": [
|
|
1851
|
+
"delete",
|
|
1852
|
+
"get",
|
|
1853
|
+
"list",
|
|
1854
|
+
"patch",
|
|
1855
|
+
"post",
|
|
1856
|
+
"put",
|
|
1857
|
+
"watch"
|
|
1858
|
+
]
|
|
1859
|
+
},
|
|
1668
1860
|
"K8s::K3s::Addon": {
|
|
1669
1861
|
"entityType": "K8s::K3s::Addon",
|
|
1670
1862
|
"apiVersion": "k3s.cattle.io/v1",
|
|
@@ -1713,6 +1905,54 @@
|
|
|
1713
1905
|
"watch"
|
|
1714
1906
|
]
|
|
1715
1907
|
},
|
|
1908
|
+
"K8s::KServe::ClusterServingRuntime": {
|
|
1909
|
+
"entityType": "K8s::KServe::ClusterServingRuntime",
|
|
1910
|
+
"apiVersion": "serving.kserve.io/v1alpha1",
|
|
1911
|
+
"kind": "ClusterServingRuntime",
|
|
1912
|
+
"plural": "clusterservingruntimes",
|
|
1913
|
+
"scope": "Cluster",
|
|
1914
|
+
"verbs": [
|
|
1915
|
+
"delete",
|
|
1916
|
+
"get",
|
|
1917
|
+
"list",
|
|
1918
|
+
"patch",
|
|
1919
|
+
"post",
|
|
1920
|
+
"put",
|
|
1921
|
+
"watch"
|
|
1922
|
+
]
|
|
1923
|
+
},
|
|
1924
|
+
"K8s::KServe::InferenceService": {
|
|
1925
|
+
"entityType": "K8s::KServe::InferenceService",
|
|
1926
|
+
"apiVersion": "serving.kserve.io/v1beta1",
|
|
1927
|
+
"kind": "InferenceService",
|
|
1928
|
+
"plural": "inferenceservices",
|
|
1929
|
+
"scope": "Namespaced",
|
|
1930
|
+
"verbs": [
|
|
1931
|
+
"delete",
|
|
1932
|
+
"get",
|
|
1933
|
+
"list",
|
|
1934
|
+
"patch",
|
|
1935
|
+
"post",
|
|
1936
|
+
"put",
|
|
1937
|
+
"watch"
|
|
1938
|
+
]
|
|
1939
|
+
},
|
|
1940
|
+
"K8s::KServe::ServingRuntime": {
|
|
1941
|
+
"entityType": "K8s::KServe::ServingRuntime",
|
|
1942
|
+
"apiVersion": "serving.kserve.io/v1alpha1",
|
|
1943
|
+
"kind": "ServingRuntime",
|
|
1944
|
+
"plural": "servingruntimes",
|
|
1945
|
+
"scope": "Namespaced",
|
|
1946
|
+
"verbs": [
|
|
1947
|
+
"delete",
|
|
1948
|
+
"get",
|
|
1949
|
+
"list",
|
|
1950
|
+
"patch",
|
|
1951
|
+
"post",
|
|
1952
|
+
"put",
|
|
1953
|
+
"watch"
|
|
1954
|
+
]
|
|
1955
|
+
},
|
|
1716
1956
|
"K8s::KubeMicroVM::MicroVM": {
|
|
1717
1957
|
"entityType": "K8s::KubeMicroVM::MicroVM",
|
|
1718
1958
|
"apiVersion": "lambda.aws.amazon.com/v1alpha1",
|
|
@@ -2123,6 +2363,22 @@
|
|
|
2123
2363
|
"scope": "Namespaced",
|
|
2124
2364
|
"verbs": []
|
|
2125
2365
|
},
|
|
2366
|
+
"K8s::Rds::DBInstance": {
|
|
2367
|
+
"entityType": "K8s::Rds::DBInstance",
|
|
2368
|
+
"apiVersion": "rds.services.k8s.aws/v1alpha1",
|
|
2369
|
+
"kind": "DBInstance",
|
|
2370
|
+
"plural": "dbinstances",
|
|
2371
|
+
"scope": "Namespaced",
|
|
2372
|
+
"verbs": [
|
|
2373
|
+
"delete",
|
|
2374
|
+
"get",
|
|
2375
|
+
"list",
|
|
2376
|
+
"patch",
|
|
2377
|
+
"post",
|
|
2378
|
+
"put",
|
|
2379
|
+
"watch"
|
|
2380
|
+
]
|
|
2381
|
+
},
|
|
2126
2382
|
"K8s::Resource::DeviceClass": {
|
|
2127
2383
|
"entityType": "K8s::Resource::DeviceClass",
|
|
2128
2384
|
"apiVersion": "resource.k8s.io/v1",
|
|
@@ -2233,6 +2489,22 @@
|
|
|
2233
2489
|
"scope": "Namespaced",
|
|
2234
2490
|
"verbs": []
|
|
2235
2491
|
},
|
|
2492
|
+
"K8s::S3::Bucket": {
|
|
2493
|
+
"entityType": "K8s::S3::Bucket",
|
|
2494
|
+
"apiVersion": "s3.services.k8s.aws/v1alpha1",
|
|
2495
|
+
"kind": "Bucket",
|
|
2496
|
+
"plural": "buckets",
|
|
2497
|
+
"scope": "Namespaced",
|
|
2498
|
+
"verbs": [
|
|
2499
|
+
"delete",
|
|
2500
|
+
"get",
|
|
2501
|
+
"list",
|
|
2502
|
+
"patch",
|
|
2503
|
+
"post",
|
|
2504
|
+
"put",
|
|
2505
|
+
"watch"
|
|
2506
|
+
]
|
|
2507
|
+
},
|
|
2236
2508
|
"K8s::Scheduling::PriorityClass": {
|
|
2237
2509
|
"entityType": "K8s::Scheduling::PriorityClass",
|
|
2238
2510
|
"apiVersion": "scheduling.k8s.io/v1",
|
|
@@ -27,6 +27,18 @@ describe("namespaceSegmentForGroup", () => {
|
|
|
27
27
|
test("the toolkit groups collapse to Flux", () => {
|
|
28
28
|
expect(namespaceSegmentForGroup("kustomize.toolkit.fluxcd.io")).toBe("Flux");
|
|
29
29
|
});
|
|
30
|
+
|
|
31
|
+
test("serving.kserve.io takes the KServe override", () => {
|
|
32
|
+
expect(namespaceSegmentForGroup("serving.kserve.io")).toBe("KServe");
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
test("cluster.x-k8s.io takes the CAPI override, avoiding the Cluster::Cluster stutter", () => {
|
|
36
|
+
expect(namespaceSegmentForGroup("cluster.x-k8s.io")).toBe("CAPI");
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
test("infrastructure.cluster.x-k8s.io is not overridden — first segment reads fine", () => {
|
|
40
|
+
expect(namespaceSegmentForGroup("infrastructure.cluster.x-k8s.io")).toBe("Infrastructure");
|
|
41
|
+
});
|
|
30
42
|
});
|
|
31
43
|
|
|
32
44
|
// #1628: rendered and imported entityTypes used to bypass the overrides, so a
|
|
@@ -61,4 +73,23 @@ spec:
|
|
|
61
73
|
expect(ir.resources.length).toBe(1);
|
|
62
74
|
expect(ir.resources[0].type).toBe("K8s::Argo::Application");
|
|
63
75
|
});
|
|
76
|
+
|
|
77
|
+
test("an imported InferenceService is typed K8s::KServe::InferenceService", () => {
|
|
78
|
+
const ir = new K8sParser().parse(`
|
|
79
|
+
apiVersion: serving.kserve.io/v1beta1
|
|
80
|
+
kind: InferenceService
|
|
81
|
+
metadata:
|
|
82
|
+
name: sklearn-iris
|
|
83
|
+
namespace: kserve-test
|
|
84
|
+
spec:
|
|
85
|
+
predictor:
|
|
86
|
+
model:
|
|
87
|
+
modelFormat:
|
|
88
|
+
name: sklearn
|
|
89
|
+
storageUri: gs://kfserving-examples/models/sklearn/1.0/model
|
|
90
|
+
`);
|
|
91
|
+
|
|
92
|
+
expect(ir.resources.length).toBe(1);
|
|
93
|
+
expect(ir.resources[0].type).toBe("K8s::KServe::InferenceService");
|
|
94
|
+
});
|
|
64
95
|
});
|
package/src/group-namespace.ts
CHANGED
|
@@ -59,6 +59,19 @@ export const GROUP_NAMESPACE_OVERRIDES: Record<string, string> = {
|
|
|
59
59
|
// and would split HelmChart from the Addon that tracks its deployment.
|
|
60
60
|
"helm.cattle.io": "K3s",
|
|
61
61
|
"k3s.cattle.io": "K3s",
|
|
62
|
+
// The first-segment rule would give `Serving`, which reads like a generic
|
|
63
|
+
// core concept rather than the KServe operator that owns it.
|
|
64
|
+
"serving.kserve.io": "KServe",
|
|
65
|
+
// The first-segment rule would give `Cluster`, which stutters against the
|
|
66
|
+
// CAPI `Cluster` kind itself (`K8s::Cluster::Cluster`) the same way the
|
|
67
|
+
// rejected `K8s::MicroVM::MicroVM` reads above. `infrastructure.cluster.x-k8s.io`
|
|
68
|
+
// (CAPA's AWSManagedCluster, AWSManagedMachinePool, AWSClusterControllerIdentity)
|
|
69
|
+
// and `controlplane.cluster.x-k8s.io` (CAPA's AWSManagedControlPlane) are left on
|
|
70
|
+
// the first-segment rule — their kinds already carry an `AWS` prefix, so
|
|
71
|
+
// `K8s::Infrastructure::AWSManagedCluster` / `K8s::Controlplane::AWSManagedControlPlane`
|
|
72
|
+
// don't need the same rescue. `addons.cluster.x-k8s.io` (CAAPH's HelmChartProxy,
|
|
73
|
+
// core CAPI's ClusterResourceSet) likewise stays `Addons`.
|
|
74
|
+
"cluster.x-k8s.io": "CAPI",
|
|
62
75
|
};
|
|
63
76
|
|
|
64
77
|
/**
|
package/src/index.ts
CHANGED
|
@@ -4,6 +4,15 @@ export { k8sSerializer } from "./serializer";
|
|
|
4
4
|
// Plugin
|
|
5
5
|
export { k8sPlugin } from "./plugin";
|
|
6
6
|
|
|
7
|
+
// Typed Op step-builder wrappers (chant #1288 Stage 2) — kubectlApply/
|
|
8
|
+
// waitForReady/ensureSecret — are deliberately NOT re-exported here: their
|
|
9
|
+
// types derive from the activities' own *Args interfaces, which name the API
|
|
10
|
+
// client and therefore sit behind the #1074 dynamic-import boundary this
|
|
11
|
+
// entry point must never reach, even type-only
|
|
12
|
+
// (examples/k8s-client-boundary.test.ts). Import them via the subpath
|
|
13
|
+
// `@intentius/chant-lexicon-k8s/op/builders`, the same way workers import
|
|
14
|
+
// `@intentius/chant-lexicon-k8s/op/activities`.
|
|
15
|
+
|
|
7
16
|
// The capability plugin core's loader discovers on this package (#1495 piece 2)
|
|
8
17
|
// — the kubectl-apply leaf a component composes, the way aws contributes
|
|
9
18
|
// cfn-deploy.
|
|
@@ -18,6 +27,10 @@ export { DEFAULT_LABELS_MARKER, DEFAULT_ANNOTATIONS_MARKER } from "./default-lab
|
|
|
18
27
|
// Variables / label constants
|
|
19
28
|
export { K8sLabels, K8sAnnotations } from "./variables";
|
|
20
29
|
|
|
30
|
+
// Generated-once secret marker (#1830) — constants only; the store adapter
|
|
31
|
+
// itself lives at the `/secret-store` subpath, off the build path (#1074).
|
|
32
|
+
export { GENERATED_ONCE_LABEL_KEY, GENERATED_ONCE_LABEL_VALUE, isGeneratedOnce } from "./secret-labels";
|
|
33
|
+
|
|
21
34
|
// MicroTime helpers — see micro-time.ts for why this exists.
|
|
22
35
|
export { microTime, isMicroTimeFormatted } from "./micro-time";
|
|
23
36
|
|
|
@@ -38,6 +51,8 @@ export {
|
|
|
38
51
|
AgicIngress, AzureDiskStorageClass, AzureFileStorageClass, AzureMonitorCollector,
|
|
39
52
|
AksWorkloadIdentityServiceAccount,
|
|
40
53
|
GkeFluentBitAgent, GkeOtelCollector, GkeExternalDnsAgent, AksExternalDnsAgent,
|
|
54
|
+
Model, resolveModelStorageUri,
|
|
55
|
+
OperatorStack, deriveHostVerbClass, DEFAULT_RESOURCE_RULES,
|
|
41
56
|
} from "./composites/index";
|
|
42
57
|
export type {
|
|
43
58
|
WebAppProps, WebAppResult, StatefulAppProps, StatefulAppResult, CronWorkloadProps, CronWorkloadResult,
|
|
@@ -77,6 +92,8 @@ export type {
|
|
|
77
92
|
GkeOtelCollectorProps, GkeOtelCollectorResult,
|
|
78
93
|
GkeExternalDnsAgentProps, GkeExternalDnsAgentResult,
|
|
79
94
|
AksExternalDnsAgentProps, AksExternalDnsAgentResult,
|
|
95
|
+
ModelSource, ModelProps, ModelResult,
|
|
96
|
+
OperatorDial, OperatorRbacResourceRule, OperatorStackConvergeHost, OperatorStackConfig, OperatorStackResult,
|
|
80
97
|
} from "./composites/index";
|
|
81
98
|
|
|
82
99
|
// RBAC verb constants
|
package/src/kube/apply.ts
CHANGED
|
@@ -96,6 +96,11 @@ export async function runApply(rawArgs: string[], deps: ApplyDeps = {}): Promise
|
|
|
96
96
|
} else {
|
|
97
97
|
console.log(`applied ${result.applied.length} object(s) as field manager "${result.fieldManager}"`);
|
|
98
98
|
if (result.pruned.length > 0) console.log(`pruned ${result.pruned.length} chant-owned object(s) no longer declared`);
|
|
99
|
+
if ((result.retained ?? []).length > 0) {
|
|
100
|
+
console.log(
|
|
101
|
+
`retained ${result.retained!.length} generated-once secret(s) no longer declared — never pruned; delete explicitly if you mean to`,
|
|
102
|
+
);
|
|
103
|
+
}
|
|
99
104
|
}
|
|
100
105
|
return 0;
|
|
101
106
|
}
|
|
@@ -36,6 +36,13 @@ export const k8sAuditCatalog: Record<string, RuleMeta> = {
|
|
|
36
36
|
WK8401: auditRule("WK8401", "merge-worthy", "guidance", "shmSize exceeds the container memory limit", "Lower shmSize or raise the memory limit so the pod can schedule.", { category: "best-practice" }),
|
|
37
37
|
WK8402: auditRule("WK8402", "report-only", "guidance", "RayCluster missing spec.rayVersion", "Set spec.rayVersion so KubeRay picks the right autoscaler image.", { category: "best-practice" }),
|
|
38
38
|
WK8403: auditRule("WK8403", "report-only", "guidance", "rayVersion does not match the head image tag", "Align spec.rayVersion with the Ray version in the head container image.", { category: "best-practice" }),
|
|
39
|
+
WK8404: auditRule("WK8404", "merge-worthy", "guidance", "GPU request without a matching toleration", "Add a toleration for the nvidia.com/gpu taint (or a wildcard Exists toleration) so the pod can schedule onto a GPU node pool.", { category: "correctness" }),
|
|
40
|
+
WK8405: auditRule("WK8405", "report-only", "guidance", "Serving workload has no PodDisruptionBudget", "Add a PDB selecting the InferenceService/serving Deployment so a node drain can't take down every replica at once.", { category: "best-practice" }),
|
|
41
|
+
WK8406: auditRule("WK8406", "merge-worthy", "guidance", "GPU container missing resource limits", "Set CPU and memory limits on GPU-requesting containers to avoid starving the (scarce, expensive) GPU node.", { category: "best-practice" }),
|
|
42
|
+
WK8407: auditRule("WK8407", "merge-worthy", "guidance", "Unpinned model version", "Pin the InferenceService model storageUri to an explicit version segment (e.g. via the Model composite's required version) instead of a floating tag.", { category: "correctness" }),
|
|
39
43
|
WK8501: auditRule("WK8501", "merge-worthy", "guidance", "Custom resource spec has a field its CRD does not declare", "Fix the field name; the API server prunes unknown fields and the controller never sees them.", { category: "correctness" }),
|
|
40
44
|
WK8502: auditRule("WK8502", "merge-worthy", "guidance", "Custom resource spec field has the wrong type or enum value", "Match the CRD schema: use the declared scalar type and one of the enum values.", { category: "correctness" }),
|
|
45
|
+
WK8503: auditRule("WK8503", "merge-worthy", "guidance", "Workload consumes a Secret nothing in the output produces", "Produce the Secret in the same build (Secret, ExternalSecret, InfisicalSecret, cert-manager Certificate), or declare its provenance with declareSecret() if it exists out of band.", { category: "correctness" }),
|
|
46
|
+
WK8504: auditRule("WK8504", "merge-worthy", "guidance", "committed-encrypted secret declaration does not resolve", "Point `file` at the committed ciphertext, make its metadata.name match the declaration, and re-run `sops -e -i` so every data/stringData value is ENC[...].", { authority: [K8S_SECRETS] }),
|
|
47
|
+
WK8505: auditRule("WK8505", "report-only", "guidance", "committed-encrypted secret with no Flux decryption wiring", "Add decryption: \"sops\" to the FluxAppFor reconciling the path that carries the ciphertext sidecar, or ignore if that Kustomization is declared in a different build.", { category: "correctness" }),
|
|
41
48
|
};
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* Excluded from check auto-discovery by the "helper" filename filter.
|
|
7
7
|
*/
|
|
8
8
|
import type { PostSynthContext } from "@intentius/chant/lint/post-synth";
|
|
9
|
-
import {
|
|
9
|
+
import { docsToManifests, type K8sManifest } from "./k8s-helpers";
|
|
10
10
|
|
|
11
11
|
/** The always-present, in-cluster Argo destination. */
|
|
12
12
|
export const IN_CLUSTER_SERVER = "https://kubernetes.default.svc";
|
|
@@ -17,11 +17,7 @@ export const CLUSTER_SECRET_TYPE_LABEL = "argocd.argoproj.io/secret-type";
|
|
|
17
17
|
|
|
18
18
|
/** All manifests across every lexicon output. */
|
|
19
19
|
export function allManifests(ctx: PostSynthContext): K8sManifest[] {
|
|
20
|
-
|
|
21
|
-
for (const [, output] of ctx.outputs) {
|
|
22
|
-
manifests.push(...parseK8sManifests(getPrimaryOutput(output)));
|
|
23
|
-
}
|
|
24
|
-
return manifests;
|
|
20
|
+
return docsToManifests(ctx);
|
|
25
21
|
}
|
|
26
22
|
|
|
27
23
|
/** Manifests of a given Argo kind. */
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
import { createRequire } from "module";
|
|
15
15
|
import type { PostSynthContext } from "@intentius/chant/lint/post-synth";
|
|
16
16
|
import type { CrdFieldSchema } from "../../spec/parse";
|
|
17
|
-
import {
|
|
17
|
+
import { docsToManifests, type K8sManifest } from "./k8s-helpers";
|
|
18
18
|
|
|
19
19
|
export type { CrdFieldSchema };
|
|
20
20
|
|
|
@@ -70,11 +70,9 @@ export function specSchemaFor(manifest: K8sManifest): CrdFieldSchema | undefined
|
|
|
70
70
|
/** Every manifest in the build that has a shipped spec schema, with that schema. */
|
|
71
71
|
export function customResources(ctx: PostSynthContext): Array<{ manifest: K8sManifest; schema: CrdFieldSchema }> {
|
|
72
72
|
const out: Array<{ manifest: K8sManifest; schema: CrdFieldSchema }> = [];
|
|
73
|
-
for (const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
if (schema) out.push({ manifest, schema });
|
|
77
|
-
}
|
|
73
|
+
for (const manifest of docsToManifests(ctx)) {
|
|
74
|
+
const schema = specSchemaFor(manifest);
|
|
75
|
+
if (schema) out.push({ manifest, schema });
|
|
78
76
|
}
|
|
79
77
|
return out;
|
|
80
78
|
}
|
|
@@ -31,8 +31,15 @@ import { wk8306 } from "./wk8306";
|
|
|
31
31
|
import { wk8401 } from "./wk8401";
|
|
32
32
|
import { wk8402 } from "./wk8402";
|
|
33
33
|
import { wk8403 } from "./wk8403";
|
|
34
|
+
import { wk8404 } from "./wk8404";
|
|
35
|
+
import { wk8405 } from "./wk8405";
|
|
36
|
+
import { wk8406 } from "./wk8406";
|
|
37
|
+
import { wk8407 } from "./wk8407";
|
|
34
38
|
import { wk8501 } from "./wk8501";
|
|
35
39
|
import { wk8502 } from "./wk8502";
|
|
40
|
+
import { wk8503 } from "./wk8503";
|
|
41
|
+
import { wk8504 } from "./wk8504";
|
|
42
|
+
import { wk8505 } from "./wk8505";
|
|
36
43
|
|
|
37
44
|
export const postSynthChecks: PostSynthCheck[] = [
|
|
38
45
|
argo002,
|
|
@@ -66,6 +73,13 @@ export const postSynthChecks: PostSynthCheck[] = [
|
|
|
66
73
|
wk8401,
|
|
67
74
|
wk8402,
|
|
68
75
|
wk8403,
|
|
76
|
+
wk8404,
|
|
77
|
+
wk8405,
|
|
78
|
+
wk8406,
|
|
79
|
+
wk8407,
|
|
69
80
|
wk8501,
|
|
70
81
|
wk8502,
|
|
82
|
+
wk8503,
|
|
83
|
+
wk8504,
|
|
84
|
+
wk8505,
|
|
71
85
|
];
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { describe, test, expect } from "vitest";
|
|
2
|
+
import { makePostSynthCtx } from "@intentius/chant-test-utils";
|
|
2
3
|
import {
|
|
3
|
-
|
|
4
|
+
docsToManifests,
|
|
4
5
|
extractContainers,
|
|
5
6
|
extractPodSpec,
|
|
6
7
|
WORKLOAD_KINDS,
|
|
7
8
|
} from "./k8s-helpers";
|
|
8
9
|
|
|
9
|
-
describe("
|
|
10
|
+
describe("docsToManifests", () => {
|
|
10
11
|
test("splits multi-doc YAML", () => {
|
|
11
12
|
const yaml = `
|
|
12
13
|
apiVersion: v1
|
|
@@ -19,7 +20,7 @@ kind: Deployment
|
|
|
19
20
|
metadata:
|
|
20
21
|
name: deploy
|
|
21
22
|
`;
|
|
22
|
-
const manifests =
|
|
23
|
+
const manifests = docsToManifests(makePostSynthCtx("k8s", yaml));
|
|
23
24
|
expect(manifests.length).toBe(2);
|
|
24
25
|
expect(manifests[0].kind).toBe("Service");
|
|
25
26
|
expect(manifests[1].kind).toBe("Deployment");
|
|
@@ -34,16 +35,15 @@ metadata:
|
|
|
34
35
|
data:
|
|
35
36
|
key: value
|
|
36
37
|
`;
|
|
37
|
-
const manifests =
|
|
38
|
+
const manifests = docsToManifests(makePostSynthCtx("k8s", yaml));
|
|
38
39
|
expect(manifests.length).toBe(1);
|
|
39
40
|
expect(manifests[0].kind).toBe("ConfigMap");
|
|
40
41
|
});
|
|
41
42
|
|
|
42
43
|
test("handles empty/invalid YAML gracefully", () => {
|
|
43
|
-
expect(
|
|
44
|
-
expect(
|
|
45
|
-
|
|
46
|
-
expect(parseK8sManifests("---\n---\n")).toEqual([]);
|
|
44
|
+
expect(docsToManifests(makePostSynthCtx("k8s", ""))).toEqual([]);
|
|
45
|
+
expect(docsToManifests(makePostSynthCtx("k8s", "---"))).toEqual([]);
|
|
46
|
+
expect(docsToManifests(makePostSynthCtx("k8s", "---\n---\n"))).toEqual([]);
|
|
47
47
|
});
|
|
48
48
|
|
|
49
49
|
test("skips blank documents between separators", () => {
|
|
@@ -60,9 +60,26 @@ kind: Service
|
|
|
60
60
|
metadata:
|
|
61
61
|
name: s
|
|
62
62
|
`;
|
|
63
|
-
const manifests =
|
|
63
|
+
const manifests = docsToManifests(makePostSynthCtx("k8s", yaml));
|
|
64
64
|
expect(manifests.length).toBe(2);
|
|
65
65
|
});
|
|
66
|
+
|
|
67
|
+
test("falls back to parsing ctx.outputs when ctx.docs is absent (hand-rolled test contexts)", () => {
|
|
68
|
+
const ctx = {
|
|
69
|
+
outputs: new Map([["k8s", "apiVersion: v1\nkind: Pod\nmetadata:\n name: p\n"]]),
|
|
70
|
+
entities: new Map(),
|
|
71
|
+
buildResult: {
|
|
72
|
+
outputs: new Map([["k8s", "apiVersion: v1\nkind: Pod\nmetadata:\n name: p\n"]]),
|
|
73
|
+
entities: new Map(),
|
|
74
|
+
warnings: [],
|
|
75
|
+
errors: [],
|
|
76
|
+
sourceFileCount: 1,
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
const manifests = docsToManifests(ctx);
|
|
80
|
+
expect(manifests.length).toBe(1);
|
|
81
|
+
expect(manifests[0].kind).toBe("Pod");
|
|
82
|
+
});
|
|
66
83
|
});
|
|
67
84
|
|
|
68
85
|
describe("extractContainers", () => {
|