1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//! Emit polychrome's `CustomResourceDefinition`s as a multi-document YAML
//! stream on stdout, one CRD per document separated by `---`.
//!
//! This is a code generator, not a deploy step: its output is committed to
//! `manifests/crds/crds.yaml` (regenerate with `just crdgen`) so the CRDs are
//! version-controlled and installed before their instances — the
//! GitOps-friendly pattern kube recommends ("provide a generated YAML file so
//! consumers can install a CRD out of band"). The committed file is applied via
//! its own kustomization (`kubectl apply -k manifests/crds`) ahead of the
//! workloads, since a CRD must exist before any CR of that kind.
//!
//! Each CRD is serialized as genuine YAML (`serde_yaml_ng` — the maintained
//! fork `polyc-control-plane`/`polyc-harness`/`polyc-runtime` already pin;
//! `serde_yaml` is deprecated upstream). Earlier this printed pretty JSON
//! joined by `---`: JSON is a valid YAML 1.2 subset for a single document,
//! but `kubectl` sniffs the leading `{` of the whole stream, decides the
//! entire input is one JSON document, and errors on the first `---`
//! separator ("invalid character '-' in numeric literal") — the committed
//! file's entire purpose, being applied as a stream, was unreachable (#1233).
//! Every document, including the first, opens with its own `---` so the
//! stream unambiguously sniffs as YAML from the first byte.
use CustomResourceExt;
use ;