Skip to content

Commit

Permalink
Merge branch 'develop' into dlpx/pr/prakashsurya/8b2a25af-7062-483d-8…
Browse files Browse the repository at this point in the history
…f4b-a373e76d4473
  • Loading branch information
Prakash Surya authored Aug 10, 2023
2 parents a1d8d60 + c30d05d commit 95ff908
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ esac

DATE=$(date --utc --iso-8601=seconds)

VMDK_FILESIZE=$(qemu-img info --output=json "$ARTIFACT_NAME.vmdk" |
jq '.["actual-size"]')
VMDK_FILESIZE=$(stat -c %s "$ARTIFACT_NAME.vmdk")
VMDK_CAPACITY=$(qemu-img info --output=json "$ARTIFACT_NAME.vmdk" |
jq '.["virtual-size"]')

Expand Down
11 changes: 11 additions & 0 deletions upgrade/upgrade-scripts/rootfs-cleanup
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ def version(rootfs: str) -> str:
]).decode("UTF-8").strip())


def exists(rootfs: str) -> bool:
return not bool(subprocess.run(["zfs", "list", rootfs]).returncode)


#
# Helper class used when sorting rootfs filesystems and snapshots. This allows
# us to use the "sorted" builtin, to build a list of all rootfs filesystems and
Expand Down Expand Up @@ -111,6 +115,13 @@ def main() -> None:
# after an upgrade (i.e. we never upgrade to a lower version).
#
for rootfs in sorted(filesystems + snapshots, key=rootfscmp)[:-2]:
#
# Skip if the snapshot or filesystem was destroyed by a previous
# iteration.
#
if not exists(rootfs):
continue

#
# In the event of a rollback, we want to be careful to not
# delete the currently running version, as well as any versions
Expand Down

0 comments on commit 95ff908

Please sign in to comment.