pub fn select_command_target(
deployment_id: &str,
targets: &[CommandTarget],
requested: Option<&str>,
) -> Result<CommandTarget>Expand description
Target-selection rules shared by both the in-memory and SQLite registries route through.
requested = Some(id): the id must be well-formed (no:) and name an existing command-capable target, elseCOMMAND_TARGET_NOT_FOUND. An empty id never falls back to shorthand. The reservedOPERATOR_COMMAND_TARGET_IDalways resolves to a pull-mode daemon target for the operator, independent of the stack.requested = None(single-target shorthand): exactly one non-reserved stack target must exist, elseCOMMAND_TARGET_AMBIGUOUS(more than one) orNO_COMMAND_TARGETS(none). Reserved operations targets (seeis_operations_command_target) are excluded so shorthand can never address them.
The resolved target’s own id is also validated, so a target registered with
a :-bearing id can never resolve into the key grammar.