Skip to content

Commit 9d00c93

Browse files
committed
Fix tests
1 parent 3a9ad87 commit 9d00c93

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

openapi/sled-agent.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1745,7 +1745,7 @@
17451745
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$"
17461746
},
17471747
"ServiceEnsureBody": {
1748-
"description": "Used to request that the Sled initialize certain services.\n\nThis may be used to record that certain sleds are responsible for launching services which may not be associated with a dataset, such as Nexus.",
1748+
"description": "Used to request that the Sled initialize multiple services.\n\nThis may be used to record that certain sleds are responsible for launching services which may not be associated with a dataset, such as Nexus.",
17491749
"type": "object",
17501750
"properties": {
17511751
"services": {
@@ -2138,6 +2138,7 @@
21382138
]
21392139
},
21402140
"ServiceZoneService": {
2141+
"description": "Used to request that the Sled initialize a single service.",
21412142
"type": "object",
21422143
"properties": {
21432144
"details": {

sled-agent/src/params.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ impl From<ServiceZoneRequest> for sled_agent_client::types::ServiceZoneRequest {
575575
}
576576
}
577577

578-
/// Used to request that the Sled initialize certain services.
578+
/// Used to request that the Sled initialize a single service.
579579
#[derive(
580580
Clone, Debug, Deserialize, Serialize, JsonSchema, PartialEq, Eq, Hash,
581581
)]
@@ -590,7 +590,7 @@ impl From<ServiceZoneService> for sled_agent_client::types::ServiceZoneService {
590590
}
591591
}
592592

593-
/// Used to request that the Sled initialize certain services on initialization.
593+
/// Used to request that the Sled initialize multiple services.
594594
///
595595
/// This may be used to record that certain sleds are responsible for
596596
/// launching services which may not be associated with a dataset, such

sled-agent/src/services.rs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -464,9 +464,11 @@ impl ServiceManager {
464464

465465
pub async fn load_non_storage_services(&self) -> Result<(), Error> {
466466
let log = &self.inner.log;
467-
let services =
468-
AllZoneRequests::read_from(log, &self.services_ledger_path()?)
469-
.await?;
467+
let ledger = self.services_ledger_path()?;
468+
if !ledger.exists() {
469+
return Ok(());
470+
}
471+
let services = AllZoneRequests::read_from(log, &ledger).await?;
470472
let mut existing_zones = self.inner.zones.lock().await;
471473

472474
// Initialize and DNS and NTP services first as they are required
@@ -535,11 +537,11 @@ impl ServiceManager {
535537

536538
pub async fn load_storage_services(&self) -> Result<(), Error> {
537539
let log = &self.inner.log;
538-
let services = AllZoneRequests::read_from(
539-
log,
540-
&self.storage_services_ledger_path()?,
541-
)
542-
.await?;
540+
let ledger = self.storage_services_ledger_path()?;
541+
if !ledger.exists() {
542+
return Ok(());
543+
}
544+
let services = AllZoneRequests::read_from(log, &ledger).await?;
543545
let mut existing_zones = self.inner.dataset_zones.lock().await;
544546
self.initialize_services_locked(
545547
&mut existing_zones,
@@ -558,6 +560,7 @@ impl ServiceManager {
558560
underlay_address: Ipv6Addr,
559561
rack_id: Uuid,
560562
) -> Result<(), Error> {
563+
debug!(&self.inner.log, "sled agent started"; "underlay_address" => underlay_address.to_string());
561564
self.inner
562565
.sled_info
563566
.set(SledAgentInfo {

0 commit comments

Comments
 (0)