Skip to content

Commit

Permalink
Address Dave's review comments
Browse files Browse the repository at this point in the history
Created using spr 1.3.6-beta.1
  • Loading branch information
sunshowers committed Feb 23, 2024
1 parent e88bd6d commit 33ef798
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 21 deletions.
22 changes: 4 additions & 18 deletions nexus/db-queries/src/db/datastore/sled.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,22 +137,6 @@ impl DataStore {
Ok(all_sleds)
}

#[cfg(test)]
async fn sled_fetch_by_id(
&self,
opctx: &OpContext,
sled_id: Uuid,
) -> Result<Sled, external::Error> {
use db::schema::sled::dsl;
dsl::sled
.filter(dsl::id.eq(sled_id))
.select(Sled::as_select())
.limit(1)
.get_result_async(&*self.pool_connection_authorized(opctx).await?)
.await
.map_err(|e| public_error_from_diesel(e, ErrorHandler::Server))
}

pub async fn sled_reservation_create(
&self,
opctx: &OpContext,
Expand Down Expand Up @@ -715,6 +699,7 @@ mod test {
datastore_test, sled_set_policy, sled_set_state, Expected,
IneligibleSleds,
};
use crate::db::lookup::LookupPath;
use crate::db::model::ByteCount;
use crate::db::model::SqlU32;
use anyhow::{Context, Result};
Expand Down Expand Up @@ -847,8 +832,9 @@ mod test {
);

// The sled should not have been updated.
let observed_sled_2 = datastore
.sled_fetch_by_id(&opctx, observed_sled.id())
let (_, observed_sled_2) = LookupPath::new(&opctx, &datastore)
.sled_id(observed_sled.id())
.fetch_for(authz::Action::Modify)
.await
.unwrap();
assert_eq!(
Expand Down
3 changes: 0 additions & 3 deletions nexus/deployment/src/planner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@ impl<'a> Planner<'a> {
// is fine.
let mut sleds_ineligible_for_services = BTreeSet::new();

// TODO: this code will also need to _remove_ services from expunged
// (and decommissioned?) sleds.

for (sled_id, sled_info) in &self.policy.sleds {
// Decommissioned sleds don't get any services. (This is an
// explicit match so that when more states are added, this fails to
Expand Down

0 comments on commit 33ef798

Please sign in to comment.