Support the Container Runner purpose identity in updates

This commit is contained in:
Pavel Isaev 2026-11-10 01:09:43 +03:00
parent 8556954e7c
commit b93fb280b7

View file

@ -153,6 +153,7 @@ fn purpose_variant(identity: &str) -> Result<&'static str, String> {
match identity.trim() {
"purpose/desktop/gnome" => Ok("gnome"),
"purpose/desktop/kde" => Ok("kde"),
"purpose/server/container-runner" => Ok("container"),
other => Err(format!("unsupported Purpose identity: {other:?}")),
}
}
@ -366,6 +367,11 @@ fn apply_plan(plan: &Value, download_only: bool) -> Result<(), String> {
#[cfg(test)]
mod tests {
#[test]
fn container_runner_purpose_identity_is_supported() {
assert_eq!(purpose_variant("purpose/server/container-runner").unwrap(), "container");
assert!(purpose_variant("purpose/server/unknown").is_err());
}
use super::*;
#[test]
fn summary_track_is_exact_and_missing_track_fails() {