record whether an agent's config sets privateUsers in its closure record
This commit is contained in:
parent
7412a0f1bd
commit
3ca660e558
1 changed files with 178 additions and 6 deletions
|
|
@ -149,6 +149,11 @@ pub enum FromMetaReply {
|
|||
system: String,
|
||||
#[serde(default)]
|
||||
cached: bool,
|
||||
/// Whether the agent's evaluated config sets
|
||||
/// `services.hyperhive.agent.user.privateUsers`. A builder that
|
||||
/// predates the field answers without it, which reads as false.
|
||||
#[serde(default)]
|
||||
private_users: bool,
|
||||
},
|
||||
/// The build did not succeed: the last lines `nix` printed, or why it
|
||||
/// stopped (it timed out, or could not start). The controller holds the
|
||||
|
|
@ -262,12 +267,14 @@ mod tests {
|
|||
out_path: "/nix/store/x".to_owned(),
|
||||
system: "x86_64-linux".to_owned(),
|
||||
cached: true,
|
||||
private_users: true,
|
||||
},
|
||||
json!({
|
||||
"state": "built",
|
||||
"out_path": "/nix/store/x",
|
||||
"system": "x86_64-linux",
|
||||
"cached": true,
|
||||
"private_users": true,
|
||||
}),
|
||||
),
|
||||
(
|
||||
|
|
@ -292,7 +299,7 @@ mod tests {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn a_built_reply_from_a_builder_without_the_field_reads_as_not_cached() {
|
||||
fn a_built_reply_from_a_builder_without_the_fields_reads_as_not_cached_and_not_namespaced() {
|
||||
let old = json!({"state": "built", "out_path": "/nix/store/x", "system": "s"});
|
||||
assert_eq!(
|
||||
serde_json::from_value::<FromMetaReply>(old).expect("decodes"),
|
||||
|
|
@ -300,6 +307,7 @@ mod tests {
|
|||
out_path: "/nix/store/x".to_owned(),
|
||||
system: "s".to_owned(),
|
||||
cached: false,
|
||||
private_users: false,
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue