Skip to main content

resolve

Function resolve 

Source
pub fn resolve(
    global: Option<&ConfigScope>,
    group_scopes: &BTreeMap<String, ConfigScope>,
    pc_scope: Option<&ConfigScope>,
    my_groups: &[String],
) -> (EffectiveConfig, Vec<ResolutionWarning>)
Expand description

Flatten the scope stack into an EffectiveConfig.

  • global — the global key in the agent_config bucket (None if no row yet).
  • group_scopes — every groups.<name> row currently in the bucket (the caller can pass all of them; only the ones whose name is in my_groups are applied).
  • pc_scope — the pcs.<pc_id> row for this agent (None if no row yet).
  • my_groups — this agent’s current memberships (from the agent_groups bucket).

Order of application: built-in default → global → per-group (alphabetical, last wins) → per-pc. Multi-group conflicts (≥ 2 of my_groups setting the same field) are returned as warnings alongside the resolved config.