Skip to content

Commit f722038

Browse files
authored
Thing-flinger: Allow deployment to single node (#837)
`sled-agent-overlay-files` generates secret shares for rack unlock in a multinode cluster. However, rack secrets and their resulting shares can only be created for clusters with 2 or more nodes. As we want to be able to use thing-flinger to deploy to a single node system, we skip generation of the secret if there is only one deployment server. This works because the sled-agent bootstrap code runs in single node mode if no share is found. Without this change, the user would get a `vsss_rs::Error::SharingMinThreshold` error when running `thing-flinger overlay`.
1 parent 9afe1f8 commit f722038

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

deploy/src/bin/sled-agent-overlay-files.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ fn overlay_secret_shares(
3737
server_dirs: &[PathBuf],
3838
) -> Result<()> {
3939
let total_shares = server_dirs.len();
40+
if total_shares < 2 {
41+
println!(
42+
"Skipping secret share distribution: only one server \
43+
available."
44+
);
45+
return Ok(());
46+
}
4047
let secret = RackSecret::new();
4148
let (shares, verifier) = secret
4249
.split(threshold, total_shares)

0 commit comments

Comments
 (0)