diff --git a/sled-agent/src/bootstrap/agent.rs b/sled-agent/src/bootstrap/agent.rs index 8e3ed304b94..ad1a21db197 100644 --- a/sled-agent/src/bootstrap/agent.rs +++ b/sled-agent/src/bootstrap/agent.rs @@ -93,8 +93,9 @@ pub(crate) struct Agent { sled_config: SledConfig, } -fn get_subnet_path() -> PathBuf { - Path::new(omicron_common::OMICRON_CONFIG_PATH).join("subnet.toml") +fn get_sled_agent_request_path() -> PathBuf { + Path::new(omicron_common::OMICRON_CONFIG_PATH) + .join("sled-agent-request.toml") } fn mac_to_socket_addr(mac: MacAddr) -> SocketAddrV6 { @@ -147,11 +148,11 @@ impl Agent { sled_config, }; - let subnet_path = get_subnet_path(); - if subnet_path.exists() { + let request_path = get_sled_agent_request_path(); + if request_path.exists() { info!(agent.log, "Sled already configured, loading sled agent"); let sled_request: SledAgentRequest = toml::from_str( - &tokio::fs::read_to_string(&subnet_path).await?, + &tokio::fs::read_to_string(&request_path).await?, )?; agent.request_agent(sled_request).await?; } @@ -207,13 +208,13 @@ impl Agent { maybe_agent.replace(server); info!(&self.log, "Sled Agent loaded; recording configuration"); - // Record the subnet, so the sled agent can be automatically + // Record this request so the sled agent can be automatically // initialized on the next boot. tokio::fs::write( - get_subnet_path(), + get_sled_agent_request_path(), &toml::to_string( - &toml::Value::try_from(&request.subnet) - .expect("Cannot serialize IP"), + &toml::Value::try_from(&request) + .expect("Cannot serialize request"), ) .expect("Cannot convert toml to string"), )