diff --git a/.ci/e2e-test/rawfile-driver.yaml b/.ci/e2e-test/rawfile-driver.yaml index 8397d59..ae06f0e 100644 --- a/.ci/e2e-test/rawfile-driver.yaml +++ b/.ci/e2e-test/rawfile-driver.yaml @@ -7,6 +7,7 @@ DriverInfo: SupportedFsType: ext4: btrfs: + xfs: Capabilities: persistence: true block: false diff --git a/Dockerfile b/Dockerfile index 9bada52..04b47fd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ FROM python:3.9-slim-buster WORKDIR /app/ RUN apt-get update && \ - apt-get install -y e2fsprogs btrfs-progs && \ + apt-get install -y e2fsprogs btrfs-progs xfsprogs && \ rm -rf /var/lib/apt/lists/* ENV PIP_NO_CACHE_DIR 1 diff --git a/README.md b/README.md index 681fa3d..1e71d13 100644 --- a/README.md +++ b/README.md @@ -40,8 +40,8 @@ Features - [x] `Filesystem` mode - [ ] `Block` mode - [x] Volume metrics -- [x] Supports fsTypes: `ext4`, `btrfs` -- [x] Online expansion: If fs supports it (e.g. ext4, btrfs) +- [x] Supports fsTypes: `ext4`, `btrfs`, `xfs` +- [x] Online expansion: If fs supports it (e.g. ext4, btrfs, xfs) - [ ] Online shrinking: If fs supports it (e.g. btrfs) - [ ] Offline expansion/shrinking - [ ] Ephemeral inline volume diff --git a/declarative.py b/declarative.py index bc0ab8c..ef8506e 100644 --- a/declarative.py +++ b/declarative.py @@ -46,6 +46,8 @@ def be_mounted(dev, mountpoint): run(f"mount {dev} {mountpoint}") elif fs == "btrfs": run(f"mount -o flushoncommit {dev} {mountpoint}") + elif fs == "xfs": + run(f"mount {dev} {mountpoint}") else: raise Exception(f"Unsupported fs type: {fs}") @@ -84,6 +86,8 @@ def be_formatted(dev, fs): rmdir {tmp_mnt} """ ) + elif fs == "xfs": + run(f"mkfs.xfs {device}") else: raise Exception(f"Unsupported fs type: {fs}") @@ -104,5 +108,7 @@ def be_fs_expanded(dev, path): run(f"resize2fs {dev}") elif fs == "btrfs": run(f"btrfs filesystem resize max {path}") + elif fs == "xfs": + run(f"xfs_growfs -d {dev}") else: raise Exception(f"Unsupported fsType: {fs}")