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
41
42
43
44
45
46
use crate::{MergeLayersUse, ResourceRef, SplitSegmentUse, ValueKind, YamlPath};
/// Contract fact that needs a Kubernetes resource schema lookup.
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct ProviderSchemaUse {
/// Canonical values path whose runtime value reaches the provider slot.
pub value_path: String,
/// Structural path of the slot in the rendered Kubernetes resource.
pub path: YamlPath,
/// How the value contributes to rendered YAML at the slot.
pub kind: ValueKind,
/// Resource whose schema owns the slot.
pub resource: ResourceRef,
/// Whether the value is the collection directly ranged by the template.
pub is_self_range_collection: bool,
/// Literal member keys the template writes beside the splice in the
/// same mapping; the slot schema's `required` must not re-demand them.
pub template_supplied_member_keys: std::collections::BTreeSet<String>,
/// Set when the rendered text is one separator-delimited segment of the
/// source string; the slot schema constrains that segment only.
pub split_segment: Option<SplitSegmentUse>,
/// Set when the value renders as one layer of an ordered `merge`: a
/// shadowed layer's members reach the slot only where every earlier
/// layer lacks them.
pub merge_layers: Option<MergeLayersUse>,
/// Set when the rendered text is the collection's RANGE KEY rather than
/// its value: a string-only slot then excludes the integer keys of a
/// non-empty list lane.
pub range_key: bool,
/// Set when the rendered text is a Sprig `quote`/`squote` of the value:
/// the transform SKIPS nil operands, so a missing or null source
/// renders an explicit YAML null into the slot. Typing still abstains
/// (any input quotes); only provider-required presence claims may read
/// this flag.
pub nil_omitting: bool,
/// Literal member keys a guard-scoped `omit` may remove from the
/// rendered map before the sink reads it: the slot's whole-payload
/// typing must exclude them, and each key's member typing is re-added
/// only under its RETAIN guards (empty means never).
pub omitted_members: std::collections::BTreeMap<String, Vec<crate::ConditionalGuard>>,
/// Decoded conditions gating the render this use rides. Synthesized
/// merge-layer arms must carry them: without the gates a dormant state
/// (KPS's `defaultRules.create: false`) would still be typed by the
/// layer arms even though nothing renders.
pub outer_guards: Vec<crate::ConditionalGuard>,
}