diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1b9bb8b7..59eea0f1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -40,6 +40,11 @@ build_csi: script: | set -x VERSION=$(cat version.txt) + TAGGED=$(grep 'the version of the Vast CSI driver' charts/vastcsi/values.yaml | awk '{print $2}') + if [[ "$TAGGED" != "$VERSION" ]]; then + echo "version.txt has $VERSION, while our helm chart has $TAGGED (check charts/vastcsi/values.yaml)" + exit 5 + fi LATEST=${DOCKER_REGISTRY}/dev/vast-csi:latest if (docker pull $LATEST) ; then docker tag $LATEST vast-csi:latest # the cache-source for our subsequent build @@ -78,12 +83,11 @@ test_csi: except: null parallel: matrix: - - INSTALL_IMAGE: "4.2" - - INSTALL_IMAGE: "4.3" - - INSTALL_IMAGE: "4.4" - INSTALL_IMAGE: "4.5" - INSTALL_IMAGE: "4.6" - INSTALL_IMAGE: "4.7" + - INSTALL_IMAGE: "5.0" + - INSTALL_IMAGE: "5.1" - INSTALL_IMAGE: "prev_version" - INSTALL_IMAGE: "latest" diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e33ed0f..16984f4b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # CHANGELOG +## Version 2.3.1 +* added volume stats metrics on Node (VCSI-125) + ## Version 2.3.0 * added CLONE_VOLUME support (VCSI-83) * clone volumes from snapshots in READ_WRITE mode (VCSI-103) diff --git a/README.md b/README.md index 6d7e0a23..680bd33b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ # VAST Data CSI Driver The source-code in this repository is for informational purposes only. It is not meant to be compiled or used directly. -If you wish to use our driver with your VAST storage system, please refer to our [official documentation](https://support.vastdata.com/s/topic/0TOV40000000kXVOAY/vast-csi-driver). +If you wish to use our driver with your VAST storage system, please refer to our [official documentation](https://support.vastdata.com/s/topic/0TOV40000000TtFOAU/vast-csi-driver). diff --git a/charts/vastcsi/values.yaml b/charts/vastcsi/values.yaml index cb53ca24..b7ace75f 100644 --- a/charts/vastcsi/values.yaml +++ b/charts/vastcsi/values.yaml @@ -124,7 +124,7 @@ snapshotClass: image: csiVastPlugin: repository: vastdataorg/csi - tag: v2.3.0 + tag: v2.3.1 # the version of the Vast CSI driver imagePullPolicy: IfNotPresent csiAttacher: repository: k8s.gcr.io/sig-storage/csi-attacher diff --git a/vast_csi/server.py b/vast_csi/server.py index bdc40460..ad04aa04 100644 --- a/vast_csi/server.py +++ b/vast_csi/server.py @@ -747,7 +747,7 @@ class Node(NodeServicer, Instrumented): CAPABILITIES = [ # types.NodeCapabilityType.STAGE_UNSTAGE_VOLUME, - # types.NodeCapabilityType.GET_VOLUME_STATS, + types.NodeCapabilityType.GET_VOLUME_STATS, ] def NodeGetCapabilities(self): @@ -893,6 +893,29 @@ def NodeUnpublishVolume(self, target_path): def NodeGetInfo(self): return types.NodeInfoResp(node_id=CONF.node_id) + def NodeGetVolumeStats(self, volume_id, volume_path): + if not os.path.ismount(volume_path): + raise Abort(NOT_FOUND, f"{volume_path} is not a mountpoint") + # See http://man7.org/linux/man-pages/man2/statfs.2.html for details. + fstats = os.statvfs(volume_path) + return types.VolumeStatsResp( + usage=[ + types.VolumeUsage( + unit=types.UsageUnit.BYTES, + available=fstats.f_bavail * fstats.f_bsize, + total=fstats.f_blocks * fstats.f_bsize, + used=(fstats.f_blocks - fstats.f_bfree) * fstats.f_bsize, + ), + types.VolumeUsage( + unit=types.UsageUnit.INODES, + available=fstats.f_ffree, + total=fstats.f_files, + used=fstats.f_files - fstats.f_ffree, + ) + ] + ) + + ################################################################ # diff --git a/version.txt b/version.txt index b1d18bc4..aaf7425f 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -v2.3.0 +v2.3.1