@intentius/chant-lexicon-k8s 0.18.36 → 0.19.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.
@@ -153,6 +153,52 @@ describe("k8sSerializer", () => {
153
153
  expect(result).toContain("project: default");
154
154
  });
155
155
 
156
+ test("Flux CRDs serialize with the correct per-group GVK", () => {
157
+ const entities = new Map<string, any>();
158
+ entities.set(
159
+ "podinfoRepo",
160
+ mockResource("K8s::Flux::GitRepository", {
161
+ metadata: { name: "podinfo", namespace: "flux-system" },
162
+ spec: { url: "https://github.com/stefanprodan/podinfo", interval: "1m" },
163
+ }),
164
+ );
165
+ entities.set(
166
+ "apps",
167
+ mockResource("K8s::Flux::Kustomization", {
168
+ metadata: { name: "apps", namespace: "flux-system" },
169
+ spec: { interval: "10m", path: "./apps", prune: true },
170
+ }),
171
+ );
172
+ entities.set(
173
+ "podinfoRelease",
174
+ mockResource("K8s::Flux::HelmRelease", {
175
+ metadata: { name: "podinfo", namespace: "flux-system" },
176
+ spec: { interval: "5m", chart: { spec: { chart: "podinfo" } } },
177
+ }),
178
+ );
179
+ entities.set(
180
+ "flux",
181
+ mockResource("K8s::Flux::FluxInstance", {
182
+ metadata: { name: "flux", namespace: "flux-system" },
183
+ spec: { distribution: { version: "2.x", registry: "ghcr.io/fluxcd" } },
184
+ }),
185
+ );
186
+
187
+ const result = k8sSerializer.serialize(entities);
188
+ // source-controller v1
189
+ expect(result).toContain("apiVersion: source.toolkit.fluxcd.io/v1");
190
+ expect(result).toContain("kind: GitRepository");
191
+ // kustomize-controller v1
192
+ expect(result).toContain("apiVersion: kustomize.toolkit.fluxcd.io/v1");
193
+ expect(result).toContain("kind: Kustomization");
194
+ // helm-controller — the one on v2, not v1
195
+ expect(result).toContain("apiVersion: helm.toolkit.fluxcd.io/v2");
196
+ expect(result).toContain("kind: HelmRelease");
197
+ // Flux Operator v1
198
+ expect(result).toContain("apiVersion: fluxcd.controlplane.io/v1");
199
+ expect(result).toContain("kind: FluxInstance");
200
+ });
201
+
156
202
  test("Namespace is specless type", () => {
157
203
  const entities = new Map<string, any>();
158
204
  entities.set(