@intentius/chant-lexicon-k8s 0.37.3 → 0.39.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/codegen/generate-list-map-keys.d.ts +53 -0
- package/dist/codegen/generate-list-map-keys.d.ts.map +1 -0
- package/dist/codegen/generate.d.ts.map +1 -1
- package/dist/composites/adot-collector.d.ts +7 -1
- package/dist/composites/adot-collector.d.ts.map +1 -1
- package/dist/composites/agic-ingress.d.ts +3 -1
- package/dist/composites/agic-ingress.d.ts.map +1 -1
- package/dist/composites/aks-external-dns-agent.d.ts +6 -1
- package/dist/composites/aks-external-dns-agent.d.ts.map +1 -1
- package/dist/composites/alb-ingress.d.ts +3 -1
- package/dist/composites/alb-ingress.d.ts.map +1 -1
- package/dist/composites/autoscaled-service.d.ts +6 -1
- package/dist/composites/autoscaled-service.d.ts.map +1 -1
- package/dist/composites/azure-disk-storage-class.d.ts +3 -1
- package/dist/composites/azure-disk-storage-class.d.ts.map +1 -1
- package/dist/composites/azure-file-storage-class.d.ts +3 -1
- package/dist/composites/azure-file-storage-class.d.ts.map +1 -1
- package/dist/composites/azure-monitor-collector.d.ts +7 -1
- package/dist/composites/azure-monitor-collector.d.ts.map +1 -1
- package/dist/composites/batch-job.d.ts +1 -1
- package/dist/composites/batch-job.d.ts.map +1 -1
- package/dist/composites/cockroachdb-cluster.d.ts +13 -1
- package/dist/composites/cockroachdb-cluster.d.ts.map +1 -1
- package/dist/composites/config-connector-context.d.ts +3 -1
- package/dist/composites/config-connector-context.d.ts.map +1 -1
- package/dist/composites/configured-app.d.ts +1 -1
- package/dist/composites/configured-app.d.ts.map +1 -1
- package/dist/composites/cron-workload.d.ts +6 -1
- package/dist/composites/cron-workload.d.ts.map +1 -1
- package/dist/composites/ebs-storage-class.d.ts +3 -1
- package/dist/composites/ebs-storage-class.d.ts.map +1 -1
- package/dist/composites/efs-storage-class.d.ts +3 -1
- package/dist/composites/efs-storage-class.d.ts.map +1 -1
- package/dist/composites/external-dns-agent.d.ts +6 -1
- package/dist/composites/external-dns-agent.d.ts.map +1 -1
- package/dist/composites/filestore-storage-class.d.ts +3 -1
- package/dist/composites/filestore-storage-class.d.ts.map +1 -1
- package/dist/composites/fluent-bit-agent.d.ts +7 -1
- package/dist/composites/fluent-bit-agent.d.ts.map +1 -1
- package/dist/composites/gce-ingress.d.ts +3 -1
- package/dist/composites/gce-ingress.d.ts.map +1 -1
- package/dist/composites/gce-pd-storage-class.d.ts +3 -1
- package/dist/composites/gce-pd-storage-class.d.ts.map +1 -1
- package/dist/composites/gke-external-dns-agent.d.ts +6 -1
- package/dist/composites/gke-external-dns-agent.d.ts.map +1 -1
- package/dist/composites/gke-fluent-bit-agent.d.ts +7 -1
- package/dist/composites/gke-fluent-bit-agent.d.ts.map +1 -1
- package/dist/composites/gke-gateway.d.ts +4 -1
- package/dist/composites/gke-gateway.d.ts.map +1 -1
- package/dist/composites/gke-otel-collector.d.ts +7 -1
- package/dist/composites/gke-otel-collector.d.ts.map +1 -1
- package/dist/composites/irsa-service-account.d.ts +1 -1
- package/dist/composites/irsa-service-account.d.ts.map +1 -1
- package/dist/composites/metrics-server.d.ts +10 -1
- package/dist/composites/metrics-server.d.ts.map +1 -1
- package/dist/composites/monitored-service.d.ts +1 -1
- package/dist/composites/monitored-service.d.ts.map +1 -1
- package/dist/composites/namespace-env.d.ts +1 -1
- package/dist/composites/namespace-env.d.ts.map +1 -1
- package/dist/composites/network-isolated-app.d.ts +5 -1
- package/dist/composites/network-isolated-app.d.ts.map +1 -1
- package/dist/composites/node-agent.d.ts +1 -1
- package/dist/composites/node-agent.d.ts.map +1 -1
- package/dist/composites/ray-cluster.d.ts +10 -1
- package/dist/composites/ray-cluster.d.ts.map +1 -1
- package/dist/composites/ray-job.d.ts +8 -1
- package/dist/composites/ray-job.d.ts.map +1 -1
- package/dist/composites/ray-service.d.ts +10 -1
- package/dist/composites/ray-service.d.ts.map +1 -1
- package/dist/composites/secure-ingress.d.ts +1 -1
- package/dist/composites/secure-ingress.d.ts.map +1 -1
- package/dist/composites/sidecar-app.d.ts +4 -1
- package/dist/composites/sidecar-app.d.ts.map +1 -1
- package/dist/composites/stateful-app.d.ts +1 -1
- package/dist/composites/stateful-app.d.ts.map +1 -1
- package/dist/composites/web-app.d.ts +1 -1
- package/dist/composites/web-app.d.ts.map +1 -1
- package/dist/composites/worker-pool.d.ts +1 -1
- package/dist/composites/worker-pool.d.ts.map +1 -1
- package/dist/composites/workload-identity-sa.d.ts +1 -1
- package/dist/composites/workload-identity-sa.d.ts.map +1 -1
- package/dist/composites/workload-identity-service-account.d.ts +1 -1
- package/dist/composites/workload-identity-service-account.d.ts.map +1 -1
- package/dist/config-schema.d.ts +40 -0
- package/dist/config-schema.d.ts.map +1 -0
- package/dist/config.d.ts +22 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/crd/crd-sources.d.ts.map +1 -1
- package/dist/crd/parser.d.ts.map +1 -1
- package/dist/deep-observe-hooks.d.ts +15 -18
- package/dist/deep-observe-hooks.d.ts.map +1 -1
- package/dist/deep-observe.d.ts.map +1 -1
- package/dist/describe-resources.d.ts +1 -0
- package/dist/describe-resources.d.ts.map +1 -1
- package/dist/generated/index.d.ts +134 -0
- package/dist/generated/index.d.ts.map +1 -1
- package/dist/integrity.json +4 -4
- package/dist/manifest.json +1 -1
- package/dist/meta.json +1086 -45
- package/dist/plugin.d.ts.map +1 -1
- package/dist/serializer.d.ts.map +1 -1
- package/dist/spec/parse.d.ts +17 -0
- package/dist/spec/parse.d.ts.map +1 -1
- package/dist/types/index.d.ts +229 -0
- package/package.json +3 -2
- package/src/codegen/generate-list-map-keys.test.ts +112 -0
- package/src/codegen/generate-list-map-keys.ts +99 -0
- package/src/codegen/generate.ts +9 -1
- package/src/composites/adot-collector.ts +1 -1
- package/src/composites/agic-ingress.ts +1 -1
- package/src/composites/aks-external-dns-agent.ts +1 -1
- package/src/composites/alb-ingress.ts +1 -1
- package/src/composites/autoscaled-service.ts +1 -1
- package/src/composites/azure-disk-storage-class.ts +1 -1
- package/src/composites/azure-file-storage-class.ts +1 -1
- package/src/composites/azure-monitor-collector.ts +1 -1
- package/src/composites/batch-job.ts +1 -1
- package/src/composites/cockroachdb-cluster.ts +1 -1
- package/src/composites/config-connector-context.ts +1 -1
- package/src/composites/configured-app.ts +1 -1
- package/src/composites/cron-workload.ts +1 -1
- package/src/composites/ebs-storage-class.ts +1 -1
- package/src/composites/efs-storage-class.ts +1 -1
- package/src/composites/external-dns-agent.ts +1 -1
- package/src/composites/filestore-storage-class.ts +1 -1
- package/src/composites/fluent-bit-agent.ts +1 -1
- package/src/composites/gce-ingress.ts +1 -1
- package/src/composites/gce-pd-storage-class.ts +1 -1
- package/src/composites/gke-external-dns-agent.ts +1 -1
- package/src/composites/gke-fluent-bit-agent.ts +1 -1
- package/src/composites/gke-gateway.ts +1 -1
- package/src/composites/gke-otel-collector.ts +1 -1
- package/src/composites/irsa-service-account.ts +1 -1
- package/src/composites/metrics-server.ts +1 -1
- package/src/composites/monitored-service.ts +1 -1
- package/src/composites/namespace-env.ts +1 -1
- package/src/composites/network-isolated-app.ts +1 -1
- package/src/composites/node-agent.ts +1 -1
- package/src/composites/ray-cluster.ts +1 -1
- package/src/composites/ray-job.ts +1 -1
- package/src/composites/ray-service.ts +1 -1
- package/src/composites/secure-ingress.ts +1 -1
- package/src/composites/sidecar-app.ts +1 -1
- package/src/composites/stateful-app.ts +1 -1
- package/src/composites/web-app.ts +1 -1
- package/src/composites/worker-pool.ts +1 -1
- package/src/composites/workload-identity-sa.ts +1 -1
- package/src/composites/workload-identity-service-account.ts +1 -1
- package/src/config-schema.ts +46 -0
- package/src/config.ts +25 -1
- package/src/crd/cnpg.test.ts +186 -0
- package/src/crd/crd-sources.ts +123 -0
- package/src/crd/infisical.test.ts +100 -0
- package/src/crd/parser.ts +8 -0
- package/src/crd/traefik.test.ts +108 -0
- package/src/deep-observe-hooks.ts +90 -10
- package/src/deep-observe.ts +7 -0
- package/src/describe-resources.test.ts +138 -1
- package/src/describe-resources.ts +98 -0
- package/src/generated/index.d.ts +229 -0
- package/src/generated/index.ts +134 -0
- package/src/generated/lexicon-k8s.json +1086 -45
- package/src/generated/list-map-keys.json +166 -0
- package/src/generated/operations.json +288 -0
- package/src/lifecycle-integration.test.ts +1 -0
- package/src/list-map-order-key.test.ts +119 -0
- package/src/plugin.ts +4 -0
- package/src/serializer.ts +4 -0
- package/src/spec/parse.test.ts +42 -0
- package/src/spec/parse.ts +51 -2
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
{
|
|
2
|
+
"addresses": [
|
|
3
|
+
[
|
|
4
|
+
"type"
|
|
5
|
+
]
|
|
6
|
+
],
|
|
7
|
+
"allocatedResourcesStatus": [
|
|
8
|
+
[
|
|
9
|
+
"name"
|
|
10
|
+
]
|
|
11
|
+
],
|
|
12
|
+
"claims": [
|
|
13
|
+
[
|
|
14
|
+
"name"
|
|
15
|
+
]
|
|
16
|
+
],
|
|
17
|
+
"conditions": [
|
|
18
|
+
[
|
|
19
|
+
"type"
|
|
20
|
+
]
|
|
21
|
+
],
|
|
22
|
+
"containers": [
|
|
23
|
+
[
|
|
24
|
+
"name"
|
|
25
|
+
]
|
|
26
|
+
],
|
|
27
|
+
"devices": [
|
|
28
|
+
[
|
|
29
|
+
"device",
|
|
30
|
+
"driver",
|
|
31
|
+
"pool",
|
|
32
|
+
"shareID"
|
|
33
|
+
]
|
|
34
|
+
],
|
|
35
|
+
"drivers": [
|
|
36
|
+
[
|
|
37
|
+
"name"
|
|
38
|
+
]
|
|
39
|
+
],
|
|
40
|
+
"env": [
|
|
41
|
+
[
|
|
42
|
+
"name"
|
|
43
|
+
]
|
|
44
|
+
],
|
|
45
|
+
"ephemeralContainers": [
|
|
46
|
+
[
|
|
47
|
+
"name"
|
|
48
|
+
]
|
|
49
|
+
],
|
|
50
|
+
"hostAliases": [
|
|
51
|
+
[
|
|
52
|
+
"ip"
|
|
53
|
+
]
|
|
54
|
+
],
|
|
55
|
+
"imagePullSecrets": [
|
|
56
|
+
[
|
|
57
|
+
"name"
|
|
58
|
+
]
|
|
59
|
+
],
|
|
60
|
+
"initContainers": [
|
|
61
|
+
[
|
|
62
|
+
"name"
|
|
63
|
+
]
|
|
64
|
+
],
|
|
65
|
+
"matchConditions": [
|
|
66
|
+
[
|
|
67
|
+
"name"
|
|
68
|
+
]
|
|
69
|
+
],
|
|
70
|
+
"ownerReferences": [
|
|
71
|
+
[
|
|
72
|
+
"uid"
|
|
73
|
+
]
|
|
74
|
+
],
|
|
75
|
+
"podGroupTemplates": [
|
|
76
|
+
[
|
|
77
|
+
"name"
|
|
78
|
+
]
|
|
79
|
+
],
|
|
80
|
+
"podIPs": [
|
|
81
|
+
[
|
|
82
|
+
"ip"
|
|
83
|
+
]
|
|
84
|
+
],
|
|
85
|
+
"ports": [
|
|
86
|
+
[
|
|
87
|
+
"containerPort",
|
|
88
|
+
"protocol"
|
|
89
|
+
],
|
|
90
|
+
[
|
|
91
|
+
"port",
|
|
92
|
+
"protocol"
|
|
93
|
+
]
|
|
94
|
+
],
|
|
95
|
+
"reservedFor": [
|
|
96
|
+
[
|
|
97
|
+
"uid"
|
|
98
|
+
]
|
|
99
|
+
],
|
|
100
|
+
"resourceClaimStatuses": [
|
|
101
|
+
[
|
|
102
|
+
"name"
|
|
103
|
+
]
|
|
104
|
+
],
|
|
105
|
+
"resourceClaims": [
|
|
106
|
+
[
|
|
107
|
+
"name"
|
|
108
|
+
]
|
|
109
|
+
],
|
|
110
|
+
"resources": [
|
|
111
|
+
[
|
|
112
|
+
"resourceID"
|
|
113
|
+
]
|
|
114
|
+
],
|
|
115
|
+
"schedulingGates": [
|
|
116
|
+
[
|
|
117
|
+
"name"
|
|
118
|
+
]
|
|
119
|
+
],
|
|
120
|
+
"secrets": [
|
|
121
|
+
[
|
|
122
|
+
"name"
|
|
123
|
+
]
|
|
124
|
+
],
|
|
125
|
+
"storageVersions": [
|
|
126
|
+
[
|
|
127
|
+
"apiServerID"
|
|
128
|
+
]
|
|
129
|
+
],
|
|
130
|
+
"topologySpreadConstraints": [
|
|
131
|
+
[
|
|
132
|
+
"topologyKey",
|
|
133
|
+
"whenUnsatisfiable"
|
|
134
|
+
]
|
|
135
|
+
],
|
|
136
|
+
"variables": [
|
|
137
|
+
[
|
|
138
|
+
"name"
|
|
139
|
+
]
|
|
140
|
+
],
|
|
141
|
+
"volumeDevices": [
|
|
142
|
+
[
|
|
143
|
+
"devicePath"
|
|
144
|
+
]
|
|
145
|
+
],
|
|
146
|
+
"volumeMounts": [
|
|
147
|
+
[
|
|
148
|
+
"mountPath"
|
|
149
|
+
]
|
|
150
|
+
],
|
|
151
|
+
"volumes": [
|
|
152
|
+
[
|
|
153
|
+
"name"
|
|
154
|
+
]
|
|
155
|
+
],
|
|
156
|
+
"webhooks": [
|
|
157
|
+
[
|
|
158
|
+
"name"
|
|
159
|
+
]
|
|
160
|
+
],
|
|
161
|
+
"x-kubernetes-validations": [
|
|
162
|
+
[
|
|
163
|
+
"rule"
|
|
164
|
+
]
|
|
165
|
+
]
|
|
166
|
+
}
|
|
@@ -625,6 +625,86 @@
|
|
|
625
625
|
"scope": "Namespaced",
|
|
626
626
|
"verbs": []
|
|
627
627
|
},
|
|
628
|
+
"K8s::Cnpg::Backup": {
|
|
629
|
+
"entityType": "K8s::Cnpg::Backup",
|
|
630
|
+
"apiVersion": "postgresql.cnpg.io/v1",
|
|
631
|
+
"kind": "Backup",
|
|
632
|
+
"plural": "backups",
|
|
633
|
+
"scope": "Namespaced",
|
|
634
|
+
"verbs": [
|
|
635
|
+
"delete",
|
|
636
|
+
"get",
|
|
637
|
+
"list",
|
|
638
|
+
"patch",
|
|
639
|
+
"post",
|
|
640
|
+
"put",
|
|
641
|
+
"watch"
|
|
642
|
+
]
|
|
643
|
+
},
|
|
644
|
+
"K8s::Cnpg::Cluster": {
|
|
645
|
+
"entityType": "K8s::Cnpg::Cluster",
|
|
646
|
+
"apiVersion": "postgresql.cnpg.io/v1",
|
|
647
|
+
"kind": "Cluster",
|
|
648
|
+
"plural": "clusters",
|
|
649
|
+
"scope": "Namespaced",
|
|
650
|
+
"verbs": [
|
|
651
|
+
"delete",
|
|
652
|
+
"get",
|
|
653
|
+
"list",
|
|
654
|
+
"patch",
|
|
655
|
+
"post",
|
|
656
|
+
"put",
|
|
657
|
+
"watch"
|
|
658
|
+
]
|
|
659
|
+
},
|
|
660
|
+
"K8s::Cnpg::ObjectStore": {
|
|
661
|
+
"entityType": "K8s::Cnpg::ObjectStore",
|
|
662
|
+
"apiVersion": "barmancloud.cnpg.io/v1",
|
|
663
|
+
"kind": "ObjectStore",
|
|
664
|
+
"plural": "objectstores",
|
|
665
|
+
"scope": "Namespaced",
|
|
666
|
+
"verbs": [
|
|
667
|
+
"delete",
|
|
668
|
+
"get",
|
|
669
|
+
"list",
|
|
670
|
+
"patch",
|
|
671
|
+
"post",
|
|
672
|
+
"put",
|
|
673
|
+
"watch"
|
|
674
|
+
]
|
|
675
|
+
},
|
|
676
|
+
"K8s::Cnpg::Pooler": {
|
|
677
|
+
"entityType": "K8s::Cnpg::Pooler",
|
|
678
|
+
"apiVersion": "postgresql.cnpg.io/v1",
|
|
679
|
+
"kind": "Pooler",
|
|
680
|
+
"plural": "poolers",
|
|
681
|
+
"scope": "Namespaced",
|
|
682
|
+
"verbs": [
|
|
683
|
+
"delete",
|
|
684
|
+
"get",
|
|
685
|
+
"list",
|
|
686
|
+
"patch",
|
|
687
|
+
"post",
|
|
688
|
+
"put",
|
|
689
|
+
"watch"
|
|
690
|
+
]
|
|
691
|
+
},
|
|
692
|
+
"K8s::Cnpg::ScheduledBackup": {
|
|
693
|
+
"entityType": "K8s::Cnpg::ScheduledBackup",
|
|
694
|
+
"apiVersion": "postgresql.cnpg.io/v1",
|
|
695
|
+
"kind": "ScheduledBackup",
|
|
696
|
+
"plural": "scheduledbackups",
|
|
697
|
+
"scope": "Namespaced",
|
|
698
|
+
"verbs": [
|
|
699
|
+
"delete",
|
|
700
|
+
"get",
|
|
701
|
+
"list",
|
|
702
|
+
"patch",
|
|
703
|
+
"post",
|
|
704
|
+
"put",
|
|
705
|
+
"watch"
|
|
706
|
+
]
|
|
707
|
+
},
|
|
628
708
|
"K8s::Coordination::Lease": {
|
|
629
709
|
"entityType": "K8s::Coordination::Lease",
|
|
630
710
|
"apiVersion": "coordination.k8s.io/v1",
|
|
@@ -1537,6 +1617,54 @@
|
|
|
1537
1617
|
"watch"
|
|
1538
1618
|
]
|
|
1539
1619
|
},
|
|
1620
|
+
"K8s::Infisical::InfisicalDynamicSecret": {
|
|
1621
|
+
"entityType": "K8s::Infisical::InfisicalDynamicSecret",
|
|
1622
|
+
"apiVersion": "secrets.infisical.com/v1alpha1",
|
|
1623
|
+
"kind": "InfisicalDynamicSecret",
|
|
1624
|
+
"plural": "infisicaldynamicsecrets",
|
|
1625
|
+
"scope": "Namespaced",
|
|
1626
|
+
"verbs": [
|
|
1627
|
+
"delete",
|
|
1628
|
+
"get",
|
|
1629
|
+
"list",
|
|
1630
|
+
"patch",
|
|
1631
|
+
"post",
|
|
1632
|
+
"put",
|
|
1633
|
+
"watch"
|
|
1634
|
+
]
|
|
1635
|
+
},
|
|
1636
|
+
"K8s::Infisical::InfisicalPushSecret": {
|
|
1637
|
+
"entityType": "K8s::Infisical::InfisicalPushSecret",
|
|
1638
|
+
"apiVersion": "secrets.infisical.com/v1alpha1",
|
|
1639
|
+
"kind": "InfisicalPushSecret",
|
|
1640
|
+
"plural": "infisicalpushsecrets",
|
|
1641
|
+
"scope": "Namespaced",
|
|
1642
|
+
"verbs": [
|
|
1643
|
+
"delete",
|
|
1644
|
+
"get",
|
|
1645
|
+
"list",
|
|
1646
|
+
"patch",
|
|
1647
|
+
"post",
|
|
1648
|
+
"put",
|
|
1649
|
+
"watch"
|
|
1650
|
+
]
|
|
1651
|
+
},
|
|
1652
|
+
"K8s::Infisical::InfisicalSecret": {
|
|
1653
|
+
"entityType": "K8s::Infisical::InfisicalSecret",
|
|
1654
|
+
"apiVersion": "secrets.infisical.com/v1alpha1",
|
|
1655
|
+
"kind": "InfisicalSecret",
|
|
1656
|
+
"plural": "infisicalsecrets",
|
|
1657
|
+
"scope": "Namespaced",
|
|
1658
|
+
"verbs": [
|
|
1659
|
+
"delete",
|
|
1660
|
+
"get",
|
|
1661
|
+
"list",
|
|
1662
|
+
"patch",
|
|
1663
|
+
"post",
|
|
1664
|
+
"put",
|
|
1665
|
+
"watch"
|
|
1666
|
+
]
|
|
1667
|
+
},
|
|
1540
1668
|
"K8s::KubeMicroVM::MicroVM": {
|
|
1541
1669
|
"entityType": "K8s::KubeMicroVM::MicroVM",
|
|
1542
1670
|
"apiVersion": "lambda.aws.amazon.com/v1alpha1",
|
|
@@ -2232,5 +2360,165 @@
|
|
|
2232
2360
|
"plural": "storageversionmigrationlists",
|
|
2233
2361
|
"scope": "Namespaced",
|
|
2234
2362
|
"verbs": []
|
|
2363
|
+
},
|
|
2364
|
+
"K8s::Traefik::IngressRoute": {
|
|
2365
|
+
"entityType": "K8s::Traefik::IngressRoute",
|
|
2366
|
+
"apiVersion": "traefik.io/v1alpha1",
|
|
2367
|
+
"kind": "IngressRoute",
|
|
2368
|
+
"plural": "ingressroutes",
|
|
2369
|
+
"scope": "Namespaced",
|
|
2370
|
+
"verbs": [
|
|
2371
|
+
"delete",
|
|
2372
|
+
"get",
|
|
2373
|
+
"list",
|
|
2374
|
+
"patch",
|
|
2375
|
+
"post",
|
|
2376
|
+
"put",
|
|
2377
|
+
"watch"
|
|
2378
|
+
]
|
|
2379
|
+
},
|
|
2380
|
+
"K8s::Traefik::IngressRouteTCP": {
|
|
2381
|
+
"entityType": "K8s::Traefik::IngressRouteTCP",
|
|
2382
|
+
"apiVersion": "traefik.io/v1alpha1",
|
|
2383
|
+
"kind": "IngressRouteTCP",
|
|
2384
|
+
"plural": "ingressroutetcps",
|
|
2385
|
+
"scope": "Namespaced",
|
|
2386
|
+
"verbs": [
|
|
2387
|
+
"delete",
|
|
2388
|
+
"get",
|
|
2389
|
+
"list",
|
|
2390
|
+
"patch",
|
|
2391
|
+
"post",
|
|
2392
|
+
"put",
|
|
2393
|
+
"watch"
|
|
2394
|
+
]
|
|
2395
|
+
},
|
|
2396
|
+
"K8s::Traefik::IngressRouteUDP": {
|
|
2397
|
+
"entityType": "K8s::Traefik::IngressRouteUDP",
|
|
2398
|
+
"apiVersion": "traefik.io/v1alpha1",
|
|
2399
|
+
"kind": "IngressRouteUDP",
|
|
2400
|
+
"plural": "ingressrouteudps",
|
|
2401
|
+
"scope": "Namespaced",
|
|
2402
|
+
"verbs": [
|
|
2403
|
+
"delete",
|
|
2404
|
+
"get",
|
|
2405
|
+
"list",
|
|
2406
|
+
"patch",
|
|
2407
|
+
"post",
|
|
2408
|
+
"put",
|
|
2409
|
+
"watch"
|
|
2410
|
+
]
|
|
2411
|
+
},
|
|
2412
|
+
"K8s::Traefik::Middleware": {
|
|
2413
|
+
"entityType": "K8s::Traefik::Middleware",
|
|
2414
|
+
"apiVersion": "traefik.io/v1alpha1",
|
|
2415
|
+
"kind": "Middleware",
|
|
2416
|
+
"plural": "middlewares",
|
|
2417
|
+
"scope": "Namespaced",
|
|
2418
|
+
"verbs": [
|
|
2419
|
+
"delete",
|
|
2420
|
+
"get",
|
|
2421
|
+
"list",
|
|
2422
|
+
"patch",
|
|
2423
|
+
"post",
|
|
2424
|
+
"put",
|
|
2425
|
+
"watch"
|
|
2426
|
+
]
|
|
2427
|
+
},
|
|
2428
|
+
"K8s::Traefik::MiddlewareTCP": {
|
|
2429
|
+
"entityType": "K8s::Traefik::MiddlewareTCP",
|
|
2430
|
+
"apiVersion": "traefik.io/v1alpha1",
|
|
2431
|
+
"kind": "MiddlewareTCP",
|
|
2432
|
+
"plural": "middlewaretcps",
|
|
2433
|
+
"scope": "Namespaced",
|
|
2434
|
+
"verbs": [
|
|
2435
|
+
"delete",
|
|
2436
|
+
"get",
|
|
2437
|
+
"list",
|
|
2438
|
+
"patch",
|
|
2439
|
+
"post",
|
|
2440
|
+
"put",
|
|
2441
|
+
"watch"
|
|
2442
|
+
]
|
|
2443
|
+
},
|
|
2444
|
+
"K8s::Traefik::ServersTransport": {
|
|
2445
|
+
"entityType": "K8s::Traefik::ServersTransport",
|
|
2446
|
+
"apiVersion": "traefik.io/v1alpha1",
|
|
2447
|
+
"kind": "ServersTransport",
|
|
2448
|
+
"plural": "serverstransports",
|
|
2449
|
+
"scope": "Namespaced",
|
|
2450
|
+
"verbs": [
|
|
2451
|
+
"delete",
|
|
2452
|
+
"get",
|
|
2453
|
+
"list",
|
|
2454
|
+
"patch",
|
|
2455
|
+
"post",
|
|
2456
|
+
"put",
|
|
2457
|
+
"watch"
|
|
2458
|
+
]
|
|
2459
|
+
},
|
|
2460
|
+
"K8s::Traefik::ServersTransportTCP": {
|
|
2461
|
+
"entityType": "K8s::Traefik::ServersTransportTCP",
|
|
2462
|
+
"apiVersion": "traefik.io/v1alpha1",
|
|
2463
|
+
"kind": "ServersTransportTCP",
|
|
2464
|
+
"plural": "serverstransporttcps",
|
|
2465
|
+
"scope": "Namespaced",
|
|
2466
|
+
"verbs": [
|
|
2467
|
+
"delete",
|
|
2468
|
+
"get",
|
|
2469
|
+
"list",
|
|
2470
|
+
"patch",
|
|
2471
|
+
"post",
|
|
2472
|
+
"put",
|
|
2473
|
+
"watch"
|
|
2474
|
+
]
|
|
2475
|
+
},
|
|
2476
|
+
"K8s::Traefik::TLSOption": {
|
|
2477
|
+
"entityType": "K8s::Traefik::TLSOption",
|
|
2478
|
+
"apiVersion": "traefik.io/v1alpha1",
|
|
2479
|
+
"kind": "TLSOption",
|
|
2480
|
+
"plural": "tlsoptions",
|
|
2481
|
+
"scope": "Namespaced",
|
|
2482
|
+
"verbs": [
|
|
2483
|
+
"delete",
|
|
2484
|
+
"get",
|
|
2485
|
+
"list",
|
|
2486
|
+
"patch",
|
|
2487
|
+
"post",
|
|
2488
|
+
"put",
|
|
2489
|
+
"watch"
|
|
2490
|
+
]
|
|
2491
|
+
},
|
|
2492
|
+
"K8s::Traefik::TLSStore": {
|
|
2493
|
+
"entityType": "K8s::Traefik::TLSStore",
|
|
2494
|
+
"apiVersion": "traefik.io/v1alpha1",
|
|
2495
|
+
"kind": "TLSStore",
|
|
2496
|
+
"plural": "tlsstores",
|
|
2497
|
+
"scope": "Namespaced",
|
|
2498
|
+
"verbs": [
|
|
2499
|
+
"delete",
|
|
2500
|
+
"get",
|
|
2501
|
+
"list",
|
|
2502
|
+
"patch",
|
|
2503
|
+
"post",
|
|
2504
|
+
"put",
|
|
2505
|
+
"watch"
|
|
2506
|
+
]
|
|
2507
|
+
},
|
|
2508
|
+
"K8s::Traefik::TraefikService": {
|
|
2509
|
+
"entityType": "K8s::Traefik::TraefikService",
|
|
2510
|
+
"apiVersion": "traefik.io/v1alpha1",
|
|
2511
|
+
"kind": "TraefikService",
|
|
2512
|
+
"plural": "traefikservices",
|
|
2513
|
+
"scope": "Namespaced",
|
|
2514
|
+
"verbs": [
|
|
2515
|
+
"delete",
|
|
2516
|
+
"get",
|
|
2517
|
+
"list",
|
|
2518
|
+
"patch",
|
|
2519
|
+
"post",
|
|
2520
|
+
"put",
|
|
2521
|
+
"watch"
|
|
2522
|
+
]
|
|
2235
2523
|
}
|
|
2236
2524
|
}
|
|
@@ -211,6 +211,7 @@ describe("k8s lifecycle integration (#163)", () => {
|
|
|
211
211
|
// The shared conformance suite (#1089) — every observing lexicon runs it.
|
|
212
212
|
describeObservationConformance({
|
|
213
213
|
lexicon: "k8s",
|
|
214
|
+
ownershipChannel: k8sPlugin.ownershipChannel,
|
|
214
215
|
scenarios: [
|
|
215
216
|
{
|
|
216
217
|
name: "an RBAC-denied read alongside a confirmed absence",
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { describe, test, expect } from "vitest";
|
|
2
|
+
import { schemaListMapOrderKey } from "./deep-observe-hooks";
|
|
3
|
+
import { k8sListMapOrderKey } from "@intentius/chant/managed-fields";
|
|
4
|
+
import type { DeepArrayElement } from "@intentius/chant/lexicon";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* chant #1441 — list elements are identified by the key the SPEC declares,
|
|
8
|
+
* with the hand-written conventions kept as fallback.
|
|
9
|
+
*
|
|
10
|
+
* The behavioural claim under test: two observations of the same object whose
|
|
11
|
+
* associative lists arrive in different orders must canonicalize to the same
|
|
12
|
+
* sequence, so ordering alone is never reported as drift.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
function el(pattern: string, element: unknown, index = 0): DeepArrayElement {
|
|
16
|
+
return { entityType: "K8s::Apps::Deployment", pattern, path: pattern, element, index, side: "live" };
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** Sort a list the way core's normalization does, using the hook's key. */
|
|
20
|
+
function canonicalOrder(pattern: string, elements: unknown[]): unknown[] {
|
|
21
|
+
return elements
|
|
22
|
+
.map((element, index) => ({ element, key: schemaListMapOrderKey(el(pattern, element, index)) }))
|
|
23
|
+
.sort((a, b) => (a.key ?? "").localeCompare(b.key ?? ""))
|
|
24
|
+
.map((e) => e.element);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
describe("conditions — the case the hardcoded table missed", () => {
|
|
28
|
+
const ready = { type: "Ready", status: "True" };
|
|
29
|
+
const progressing = { type: "Progressing", status: "True" };
|
|
30
|
+
|
|
31
|
+
test("is identified by type", () => {
|
|
32
|
+
expect(schemaListMapOrderKey(el("status.conditions", ready))).toBe("Ready");
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
test("was NOT identified before this change", () => {
|
|
36
|
+
// Guards the premise: without the spec-derived table, `conditions` fell
|
|
37
|
+
// through to `undefined`, which leaves the array order alone — so two
|
|
38
|
+
// orderings compared positionally and read as drift.
|
|
39
|
+
expect(k8sListMapOrderKey(el("status.conditions", ready))).toBeUndefined();
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
test("two orderings of the same conditions canonicalize identically", () => {
|
|
43
|
+
expect(canonicalOrder("status.conditions", [ready, progressing])).toEqual(
|
|
44
|
+
canonicalOrder("status.conditions", [progressing, ready]),
|
|
45
|
+
);
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
describe("ports — one name, two key shapes", () => {
|
|
50
|
+
test("a container port is keyed by containerPort and protocol", () => {
|
|
51
|
+
// Byte-identical to what the hardcoded implementation produced, because
|
|
52
|
+
// this string is also the element's address in drift output.
|
|
53
|
+
const element = { containerPort: 8080, protocol: "TCP" };
|
|
54
|
+
expect(schemaListMapOrderKey(el("spec.template.spec.containers.ports", element))).toBe("08080/TCP");
|
|
55
|
+
expect(schemaListMapOrderKey(el("spec.template.spec.containers.ports", element))).toBe(
|
|
56
|
+
k8sListMapOrderKey(el("spec.template.spec.containers.ports", element)),
|
|
57
|
+
);
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
test("a Service port is keyed by port and protocol", () => {
|
|
61
|
+
expect(schemaListMapOrderKey(el("spec.ports", { port: 443, protocol: "TCP" }))).toBe("00443/TCP");
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
test("numeric key fields order numerically, not lexicographically", () => {
|
|
65
|
+
const ordered = canonicalOrder("spec.ports", [
|
|
66
|
+
{ port: 443, protocol: "TCP" },
|
|
67
|
+
{ port: 80, protocol: "TCP" },
|
|
68
|
+
]);
|
|
69
|
+
expect(ordered).toEqual([
|
|
70
|
+
{ port: 80, protocol: "TCP" },
|
|
71
|
+
{ port: 443, protocol: "TCP" },
|
|
72
|
+
]);
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
describe("fallback", () => {
|
|
77
|
+
test("a list the spec does not annotate still gets the hand-written key", () => {
|
|
78
|
+
// `containers` is in both the generated table and the hardcoded one; the
|
|
79
|
+
// point is that removing an element's spec-declared fields does not strand
|
|
80
|
+
// it — it lands on the by-name convention.
|
|
81
|
+
const key = schemaListMapOrderKey(el("spec.template.spec.containers", { name: "app", image: "nginx" }));
|
|
82
|
+
expect(key).toBeDefined();
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
test("an unknown list is left unordered, exactly as before", () => {
|
|
86
|
+
expect(schemaListMapOrderKey(el("spec.somethingUnknown", { a: 1 }))).toBeUndefined();
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
test("a non-object element is left to the fallback rather than crashing", () => {
|
|
90
|
+
expect(() => schemaListMapOrderKey(el("spec.template.spec.containers", "not-an-object"))).not.toThrow();
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
test("an element missing its declared key fields falls through", () => {
|
|
94
|
+
// A conditions entry with no `type` cannot be identified by the spec key.
|
|
95
|
+
// It must not produce `type=undefined`, which would collide across
|
|
96
|
+
// elements and silently merge distinct entries.
|
|
97
|
+
const key = schemaListMapOrderKey(el("status.conditions", { status: "True" }));
|
|
98
|
+
expect(key ?? "").not.toContain("undefined");
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
describe("compatibility with the hardcoded table", () => {
|
|
103
|
+
// The order key is the element's address in drift output, so every property
|
|
104
|
+
// the hand-written table already covered must keep producing the identical
|
|
105
|
+
// string. A change here silently rewrites existing drift paths.
|
|
106
|
+
const cases: Array<[string, unknown]> = [
|
|
107
|
+
["spec.template.spec.containers", { name: "app", image: "nginx" }],
|
|
108
|
+
["spec.template.spec.initContainers", { name: "init" }],
|
|
109
|
+
["spec.template.spec.ephemeralContainers", { name: "debug" }],
|
|
110
|
+
["spec.template.spec.containers.env", { name: "PORT", value: "8080" }],
|
|
111
|
+
["spec.template.spec.volumes", { name: "data" }],
|
|
112
|
+
["spec.template.spec.containers.ports", { containerPort: 80, protocol: "TCP" }],
|
|
113
|
+
["spec.ports", { port: 443, protocol: "TCP" }],
|
|
114
|
+
];
|
|
115
|
+
|
|
116
|
+
test.each(cases)("%s produces the same key as before", (pattern, element) => {
|
|
117
|
+
expect(schemaListMapOrderKey(el(pattern, element))).toBe(k8sListMapOrderKey(el(pattern, element)));
|
|
118
|
+
});
|
|
119
|
+
});
|
package/src/plugin.ts
CHANGED
|
@@ -26,9 +26,13 @@ import { k8sHover } from "./lsp/hover";
|
|
|
26
26
|
import { K8sParser } from "./import/parser";
|
|
27
27
|
import { K8sGenerator } from "./import/generator";
|
|
28
28
|
import { k8sDeepNormalizationHooks } from "./deep-observe-hooks";
|
|
29
|
+
import { LABEL_OWNERSHIP_KEYS } from "@intentius/chant/ownership";
|
|
30
|
+
import { k8sConfigSchema } from "./config-schema";
|
|
29
31
|
|
|
30
32
|
export const k8sPlugin: LexiconPlugin = {
|
|
31
33
|
name: "k8s",
|
|
34
|
+
ownershipChannel: { keys: LABEL_OWNERSHIP_KEYS, reads: ["describeResources", "observeResourcesDeep", "exportResources"] },
|
|
35
|
+
configSchema: k8sConfigSchema,
|
|
32
36
|
auditCatalog: () => k8sAuditCatalog,
|
|
33
37
|
serializer: k8sSerializer,
|
|
34
38
|
// Self-upgrade: where the pinned Kubernetes schema version lives + its upstream (#685).
|
package/src/serializer.ts
CHANGED
|
@@ -153,6 +153,10 @@ function toYAMLValue(value: unknown, entityNames: Map<Declarable, string>): unkn
|
|
|
153
153
|
export const k8sSerializer: Serializer = {
|
|
154
154
|
name: "k8s",
|
|
155
155
|
rulePrefix: "WK8",
|
|
156
|
+
// The Argo CD checks are a distinct product surface this lexicon covers, and
|
|
157
|
+
// their ids are published — renaming them would break every `chant-disable
|
|
158
|
+
// ARGO001` already written (#1349).
|
|
159
|
+
extraRulePrefixes: ["ARGO"],
|
|
156
160
|
|
|
157
161
|
serialize(entities: Map<string, Declarable>, _outputs?: LexiconOutput[], context?: SerializeContext): string {
|
|
158
162
|
// Build reverse map: entity → name
|
package/src/spec/parse.test.ts
CHANGED
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
gvkToApiVersion,
|
|
5
5
|
k8sShortName,
|
|
6
6
|
k8sServiceName,
|
|
7
|
+
specListMapKeyPairs,
|
|
7
8
|
} from "./parse";
|
|
8
9
|
|
|
9
10
|
describe("gvkToTypeName", () => {
|
|
@@ -100,3 +101,44 @@ describe("k8sServiceName", () => {
|
|
|
100
101
|
expect(typeof name).toBe("string");
|
|
101
102
|
});
|
|
102
103
|
});
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* chant #1441 — the merge semantics the API server publishes, read off every
|
|
107
|
+
* definition rather than only the ones chant emits a type for.
|
|
108
|
+
*/
|
|
109
|
+
describe("specListMapKeyPairs", () => {
|
|
110
|
+
const spec = JSON.stringify({
|
|
111
|
+
definitions: {
|
|
112
|
+
"io.k8s.api.core.v1.PodSpec": {
|
|
113
|
+
properties: {
|
|
114
|
+
containers: { type: "array", "x-kubernetes-list-type": "map", "x-kubernetes-list-map-keys": ["name"] },
|
|
115
|
+
// atomic and set lists carry no identity key
|
|
116
|
+
tolerations: { type: "array", "x-kubernetes-list-type": "atomic" },
|
|
117
|
+
finalizers: { type: "array", "x-kubernetes-list-type": "set" },
|
|
118
|
+
nodeName: { type: "string" },
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
"io.k8s.api.core.v1.ServiceSpec": {
|
|
122
|
+
properties: {
|
|
123
|
+
ports: { type: "array", "x-kubernetes-list-type": "map", "x-kubernetes-list-map-keys": ["port", "protocol"] },
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
"io.k8s.api.core.v1.NoProperties": {},
|
|
127
|
+
},
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
test("collects only map-typed lists that name their keys", () => {
|
|
131
|
+
expect(specListMapKeyPairs(spec)).toEqual([
|
|
132
|
+
["containers", ["name"]],
|
|
133
|
+
["ports", ["port", "protocol"]],
|
|
134
|
+
]);
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
test("accepts a Buffer, as the fetch path supplies", () => {
|
|
138
|
+
expect(specListMapKeyPairs(Buffer.from(spec, "utf-8"))).toHaveLength(2);
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
test("a spec with no definitions yields nothing rather than throwing", () => {
|
|
142
|
+
expect(specListMapKeyPairs(JSON.stringify({}))).toEqual([]);
|
|
143
|
+
});
|
|
144
|
+
});
|