@intentius/chant-lexicon-k8s 0.44.13 → 0.45.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/docs.d.ts.map +1 -1
- package/dist/codegen/generate-lexicon.d.ts +15 -1
- package/dist/codegen/generate-lexicon.d.ts.map +1 -1
- package/dist/components/capability-plugin.d.ts.map +1 -1
- package/dist/crd/parser.d.ts +28 -1
- package/dist/crd/parser.d.ts.map +1 -1
- package/dist/deep-observe-hooks.d.ts +60 -4
- package/dist/deep-observe-hooks.d.ts.map +1 -1
- package/dist/deep-observe.d.ts +36 -61
- package/dist/deep-observe.d.ts.map +1 -1
- package/dist/integrity.json +6 -3
- package/dist/lint/audit-catalog.d.ts.map +1 -1
- package/dist/lint/post-synth/crd-schema-helpers.d.ts +49 -0
- package/dist/lint/post-synth/crd-schema-helpers.d.ts.map +1 -0
- package/dist/lint/post-synth/index.d.ts.map +1 -1
- package/dist/lint/post-synth/wk8501.d.ts +14 -0
- package/dist/lint/post-synth/wk8501.d.ts.map +1 -0
- package/dist/lint/post-synth/wk8502.d.ts +13 -0
- package/dist/lint/post-synth/wk8502.d.ts.map +1 -0
- package/dist/manifest.json +1 -1
- package/dist/meta.json +126 -63
- package/dist/okf/index.md +2 -0
- package/dist/okf/rules/WK8501.md +11 -0
- package/dist/okf/rules/WK8502.md +11 -0
- package/dist/rules/crd-schema-helpers.ts +228 -0
- package/dist/rules/wk8501.ts +40 -0
- package/dist/rules/wk8502.ts +39 -0
- package/dist/spec/parse.d.ts +32 -0
- package/dist/spec/parse.d.ts.map +1 -1
- package/dist/validate.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/codegen/docs.ts +0 -1044
- package/src/codegen/generate-lexicon.ts +38 -2
- package/src/codegen/snapshot.test.ts +20 -0
- package/src/components/capability-plugin.test.ts +20 -0
- package/src/components/capability-plugin.ts +5 -2
- package/src/crd/cnpg.test.ts +1 -1
- package/src/crd/infisical.test.ts +1 -1
- package/src/crd/parser.test.ts +117 -1
- package/src/crd/parser.ts +71 -5
- package/src/crd/traefik.test.ts +1 -1
- package/src/deep-observe-hooks.ts +78 -16
- package/src/deep-observe.test.ts +145 -29
- package/src/deep-observe.ts +43 -85
- package/src/generated/lexicon-k8s.json +126 -63
- package/src/lint/audit-catalog.ts +2 -0
- package/src/lint/post-synth/crd-schema-helpers.ts +228 -0
- package/src/lint/post-synth/index.ts +4 -0
- package/src/lint/post-synth/post-synth.test.ts +156 -0
- package/src/lint/post-synth/wk8501.ts +40 -0
- package/src/lint/post-synth/wk8502.ts +39 -0
- package/src/list-map-key-table.test.ts +83 -0
- package/src/op/activities/kubectl.ts +2 -2
- package/src/serializer.test.ts +4 -4
- package/src/spec/parse.ts +33 -0
- package/src/validate.ts +7 -4
package/src/spec/parse.ts
CHANGED
|
@@ -78,6 +78,33 @@ export interface ParsedOperation {
|
|
|
78
78
|
verbs: string[];
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
+
/**
|
|
82
|
+
* Compact, recursive field schema for a custom resource's `spec` — chant #1372.
|
|
83
|
+
*
|
|
84
|
+
* Built-in kinds get their field typing from the generated `.d.ts`. A CRD's
|
|
85
|
+
* constructor takes `spec: Record<string, unknown>`, so its field names, enums
|
|
86
|
+
* and scalar types have to travel through the lexicon JSON instead. This is
|
|
87
|
+
* the shape that ships there: no descriptions, no numeric bounds, only what a
|
|
88
|
+
* validator needs to reject a misspelled field or a wrong-typed value.
|
|
89
|
+
*/
|
|
90
|
+
export interface CrdFieldSchema {
|
|
91
|
+
/** OpenAPI type; `integer` is kept distinct from `number`. Absent when the schema says nothing. */
|
|
92
|
+
type?: "string" | "integer" | "number" | "boolean" | "object" | "array";
|
|
93
|
+
enum?: string[];
|
|
94
|
+
/** Object members, keyed by field name. */
|
|
95
|
+
fields?: Record<string, CrdFieldSchema>;
|
|
96
|
+
/** Required member names of an object. */
|
|
97
|
+
required?: string[];
|
|
98
|
+
/** Element schema of an array. */
|
|
99
|
+
items?: CrdFieldSchema;
|
|
100
|
+
/**
|
|
101
|
+
* True when the object accepts members its `fields` do not list —
|
|
102
|
+
* `x-kubernetes-preserve-unknown-fields` or `additionalProperties`.
|
|
103
|
+
* `x-kubernetes-int-or-string` also sets it on a scalar, meaning either type passes.
|
|
104
|
+
*/
|
|
105
|
+
open?: true;
|
|
106
|
+
}
|
|
107
|
+
|
|
81
108
|
export interface K8sParseResult {
|
|
82
109
|
resource: ParsedResource;
|
|
83
110
|
propertyTypes: ParsedPropertyType[];
|
|
@@ -87,6 +114,12 @@ export interface K8sParseResult {
|
|
|
87
114
|
isProperty?: boolean;
|
|
88
115
|
/** How the API addresses this resource. Absent for property types. */
|
|
89
116
|
operation?: ParsedOperation;
|
|
117
|
+
/**
|
|
118
|
+
* The `spec` field schema of a custom resource (chant #1372). Present only
|
|
119
|
+
* for CRD-derived kinds whose `openAPIV3Schema` declares a `spec`; built-in
|
|
120
|
+
* kinds carry their typing in the `.d.ts` instead.
|
|
121
|
+
*/
|
|
122
|
+
specSchema?: CrdFieldSchema;
|
|
90
123
|
}
|
|
91
124
|
|
|
92
125
|
// ── Swagger types ──────────────────────────────────────────────────
|
package/src/validate.ts
CHANGED
|
@@ -42,9 +42,12 @@ export async function validate(opts?: { basePath?: string }): Promise<ValidateRe
|
|
|
42
42
|
lexiconJsonFilename: "lexicon-k8s.json",
|
|
43
43
|
requiredNames: REQUIRED_NAMES,
|
|
44
44
|
basePath,
|
|
45
|
-
// chant #1475 — the
|
|
46
|
-
//
|
|
47
|
-
//
|
|
48
|
-
|
|
45
|
+
// chant #1475 — the baseline was re-baselined with the k3s CRD work
|
|
46
|
+
// (#1605). k8s generates from a pinned kubernetes release tag plus CRDs
|
|
47
|
+
// vendored in this repo, so a fresh generate is deterministic and the
|
|
48
|
+
// surface can only move through a change here. Gate on every validate,
|
|
49
|
+
// not just under CHANT_RELEASE_GATE, so a CRD batch can no longer leave
|
|
50
|
+
// the snapshot behind the way #1319/#1320/#1321 did.
|
|
51
|
+
checkSurfaceSnapshot: "always",
|
|
49
52
|
});
|
|
50
53
|
}
|