Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions sled-agent/src/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,27 @@ impl OmicronZoneType {
*address,
))
}

/// Does this zone require time synchronization before it is initialized?"
///
/// This function is somewhat conservative - the set of services
/// that can be launched before timesync has completed is intentionally kept
/// small, since it would be easy to add a service that expects time to be
/// reasonably synchronized.
pub fn requires_timesync(&self) -> bool {
match self {
// These zones can be initialized and started before time has been
// synchronized. For the NTP zones, this should be self-evident --
// we need the NTP zone to actually perform time synchronization!
//
// The DNS zone is a bit of an exception here, since the NTP zone
// itself may rely on DNS lookups as a dependency.
OmicronZoneType::BoundaryNtp { .. }
| OmicronZoneType::InternalNtp { .. }
| OmicronZoneType::InternalDns { .. } => false,
_ => true,
}
}
}

impl crate::smf_helper::Service for OmicronZoneType {
Expand Down
Loading