Skip to content

Commit

Permalink
make BlueprintOrCollection* methods pub
Browse files Browse the repository at this point in the history
  • Loading branch information
jgallagher committed Apr 21, 2024
1 parent b7919d4 commit b7fe215
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ mod tests {
assert_eq!(sled_modified.zones_modified().count(), 1);
let modified_zone =
sled_modified.zones_modified().next().unwrap();
assert_eq!(modified_zone.zone_before.id, existing_zone_id);
assert_eq!(modified_zone.zone_before.id(), existing_zone_id);
} else {
assert_eq!(sled_id, control_sled_id);

Expand Down
16 changes: 8 additions & 8 deletions nexus/types/src/deployment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1089,7 +1089,7 @@ pub enum BlueprintOrCollectionZonesConfig {
}

impl BlueprintOrCollectionZonesConfig {
fn sort(&mut self) {
pub fn sort(&mut self) {
match self {
BlueprintOrCollectionZonesConfig::Collection(z) => {
z.zones.sort_unstable_by_key(zone_sort_key)
Expand All @@ -1098,14 +1098,14 @@ impl BlueprintOrCollectionZonesConfig {
}
}

fn generation(&self) -> Generation {
pub fn generation(&self) -> Generation {
match self {
BlueprintOrCollectionZonesConfig::Collection(z) => z.generation,
BlueprintOrCollectionZonesConfig::Blueprint(z) => z.generation,
}
}

fn zones(
pub fn zones(
&self,
) -> Box<dyn Iterator<Item = BlueprintOrCollectionZoneConfig> + '_> {
match self {
Expand Down Expand Up @@ -1168,21 +1168,21 @@ impl From<BlueprintZoneConfig> for BlueprintOrCollectionZoneConfig {
}

impl BlueprintOrCollectionZoneConfig {
fn id(&self) -> OmicronZoneUuid {
pub fn id(&self) -> OmicronZoneUuid {
match self {
BlueprintOrCollectionZoneConfig::Collection(z) => z.id(),
BlueprintOrCollectionZoneConfig::Blueprint(z) => z.id(),
}
}

fn kind(&self) -> ZoneKind {
pub fn kind(&self) -> ZoneKind {
match self {
BlueprintOrCollectionZoneConfig::Collection(z) => z.kind(),
BlueprintOrCollectionZoneConfig::Blueprint(z) => z.kind(),
}
}

fn disposition(&self) -> BlueprintZoneDisposition {
pub fn disposition(&self) -> BlueprintZoneDisposition {
match self {
// All zones from inventory collection are assumed to be in-service.
BlueprintOrCollectionZoneConfig::Collection(_) => {
Expand All @@ -1192,7 +1192,7 @@ impl BlueprintOrCollectionZoneConfig {
}
}

fn underlay_address(&self) -> Ipv6Addr {
pub fn underlay_address(&self) -> Ipv6Addr {
match self {
BlueprintOrCollectionZoneConfig::Collection(z) => {
z.underlay_address
Expand All @@ -1201,7 +1201,7 @@ impl BlueprintOrCollectionZoneConfig {
}
}

fn is_zone_type_equal(&self, other: &BlueprintZoneType) -> bool {
pub fn is_zone_type_equal(&self, other: &BlueprintZoneType) -> bool {
match self {
BlueprintOrCollectionZoneConfig::Collection(z) => {
// BlueprintZoneType contains more information than
Expand Down

0 comments on commit b7fe215

Please sign in to comment.