Skip to content

Commit a898517

Browse files
committed
[zone bundle] Fix boolean logic to find snapshots
1 parent c8449e2 commit a898517

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

sled-agent/src/zone_bundle.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,12 @@ fn initialize_zfs_resources(log: &Logger) -> Result<(), BundleError> {
7171
let zb_snapshots =
7272
Zfs::list_snapshots().unwrap().into_iter().filter(|snap| {
7373
// Check for snapshots named how we expect to create them.
74-
if snap.snap_name != ZONE_ROOT_SNAPSHOT_NAME
75-
|| !snap.snap_name.starts_with(ARCHIVE_SNAPSHOT_PREFIX)
76-
{
74+
let is_root_snapshot = snap.snap_name == ZONE_ROOT_SNAPSHOT_NAME;
75+
let is_archive_snapshot =
76+
snap.snap_name.starts_with(ARCHIVE_SNAPSHOT_PREFIX);
77+
let is_zone_bundle_snapshot =
78+
is_root_snapshot || is_archive_snapshot;
79+
if !is_zone_bundle_snapshot {
7780
return false;
7881
}
7982

0 commit comments

Comments
 (0)