Skip to content

Commit

Permalink
add SledFilter::Decommissioned
Browse files Browse the repository at this point in the history
  • Loading branch information
jgallagher committed May 8, 2024
1 parent 24b8a34 commit 6418c3e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions nexus/types/src/deployment/planning_input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,14 @@ pub enum SledFilter {
/// fetch "all sleds regardless of current policy or state".
Commissioned,

/// All sleds that we previously part of the control plane cluster but have
/// been decommissioned.
///
/// Any sleds matching this filter are expected to no longer be present.
/// This filter is only useful for historical or debugging purposes, such as
/// listing decommissioned sleds via `omdb`.
Decommissioned,

/// Sleds that are eligible for discretionary services.
Discretionary,

Expand Down Expand Up @@ -312,6 +320,7 @@ impl SledPolicy {
provision_policy: SledProvisionPolicy::Provisionable,
} => match filter {
SledFilter::Commissioned => true,
SledFilter::Decommissioned => false,
SledFilter::Discretionary => true,
SledFilter::InService => true,
SledFilter::QueryDuringInventory => true,
Expand All @@ -322,6 +331,7 @@ impl SledPolicy {
provision_policy: SledProvisionPolicy::NonProvisionable,
} => match filter {
SledFilter::Commissioned => true,
SledFilter::Decommissioned => false,
SledFilter::Discretionary => false,
SledFilter::InService => true,
SledFilter::QueryDuringInventory => true,
Expand All @@ -330,6 +340,7 @@ impl SledPolicy {
},
SledPolicy::Expunged => match filter {
SledFilter::Commissioned => true,
SledFilter::Decommissioned => true,
SledFilter::Discretionary => false,
SledFilter::InService => false,
SledFilter::QueryDuringInventory => false,
Expand Down Expand Up @@ -360,6 +371,7 @@ impl SledState {
match self {
SledState::Active => match filter {
SledFilter::Commissioned => true,
SledFilter::Decommissioned => false,
SledFilter::Discretionary => true,
SledFilter::InService => true,
SledFilter::QueryDuringInventory => true,
Expand All @@ -368,6 +380,7 @@ impl SledState {
},
SledState::Decommissioned => match filter {
SledFilter::Commissioned => false,
SledFilter::Decommissioned => true,
SledFilter::Discretionary => false,
SledFilter::InService => false,
SledFilter::QueryDuringInventory => false,
Expand Down

0 comments on commit 6418c3e

Please sign in to comment.