From 1aae49462db60bb2584c4cfbac1e0aa5751a9031 Mon Sep 17 00:00:00 2001 From: Travis Glenn Hansen Date: Tue, 26 Mar 2024 09:30:05 -0600 Subject: [PATCH] document restic/kopia snapshot configurations, more stringent delete checks for objectivefs Signed-off-by: Travis Glenn Hansen --- CHANGELOG.md | 25 ++++- Dockerfile | 2 +- examples/local-hostpath.yaml | 51 +++++++++- examples/lustre-client.yaml | 47 +++++++++ examples/nfs-client.yaml | 47 +++++++++ examples/objectivefs.yaml | 6 +- examples/smb-client.yaml | 47 +++++++++ package-lock.json | 113 +++++++++++---------- src/driver/controller-objectivefs/index.js | 2 + src/driver/index.js | 5 +- src/utils/objectivefs.js | 13 +++ 11 files changed, 299 insertions(+), 59 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0116251..8cdcec4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,29 @@ +# v1.9.0 + +Released 2024-03-26 + +- new `objectivefs` driver (https://objectivefs.com) support available for x86_64 and arm64 +- TrueNAS + - SCALE 24.04 support + - fix `sudo` issue during resize operations (see #295) + - fix version detection logic and default to api version 2 (see #351) + - more robust `Probe` implementation +- contaimer images + - various fixes, improvements, dep upgrades, etc + - update container images to `debian:12` (bookworm) + - bump to nodejs-lts-iron from nodejs-lts-hydrogen +- support csi v1.6.0-v1.9.0 +- allow `noop` delete operations (dangerous, only use if you _really_ know what you are doing, see #289) +- properly adhere to the `zvolDedup` and `zvolCompression` settings (see #322) +- `restic` and `kopia` support as a snapshot solution for `local-hostpath` and `*-client` drivers + # v1.8.4 Released 2023-11-09 -- allow templatized `volume_id` (dangerous, only use if you *really* know what you are doing) -- fix SCALE iscsi resize issue -- SCALE 23.10 support +- allow templatized `volume_id` (dangerous, only use if you _really_ know what you are doing) +- fix TrueNAS SCALE iscsi resize issue +- TrueNAS SCALE 23.10 support - minor improvements/fixes throughout - dependency updates diff --git a/Dockerfile b/Dockerfile index a177f01..47a2b21 100644 --- a/Dockerfile +++ b/Dockerfile @@ -88,7 +88,7 @@ ARG RESTIC_VERSION=0.16.4 ADD docker/restic-installer.sh /usr/local/sbin RUN chmod +x /usr/local/sbin/restic-installer.sh && restic-installer.sh -ARG KOPIA_VERSION=0.15.0 +ARG KOPIA_VERSION=0.16.1 ADD docker/kopia-installer.sh /usr/local/sbin RUN chmod +x /usr/local/sbin/kopia-installer.sh && kopia-installer.sh diff --git a/examples/local-hostpath.yaml b/examples/local-hostpath.yaml index 4c4a9ed..e566381 100644 --- a/examples/local-hostpath.yaml +++ b/examples/local-hostpath.yaml @@ -3,8 +3,57 @@ instance_id: local-hostpath: # generally shareBasePath and controllerBasePath should be the same for this # driver, this path should be mounted into the csi-driver container - shareBasePath: "/var/lib/csi-local-hostpath" + shareBasePath: "/var/lib/csi-local-hostpath" controllerBasePath: "/var/lib/csi-local-hostpath" dirPermissionsMode: "0777" dirPermissionsUser: 0 dirPermissionsGroup: 0 + snapshots: + # can create multiple snapshot classes each with a parameters.driver value which + # overrides the default, a single install can use all 3 simultaneously if desired + # + # available options: + # - filecopy = rsync/cp + # - restic + # - kopia + # + default_driver: filecopy + + # snapshot hostname will be set to the csiDriver.name value, in the case + # of local-hostpath the node name will be appended + # it is assumed that the repo has been created beforehand + restic: + global_flags: [] + # - --insecure-tls + + # these are added to snapshots, but are NOT used for querying/selectors by democratic-csi + # it is *HIGHLY* recommended to set the instance_id parameter when using restic, it should be a universally unique ID for every deployment + # host will be set to csi driver name + tags: [] + # - foobar + # - baz=bar + + # automatically prune when a snapshot is deleted + prune: true + + # at a minimum RESTIC_PASSWORD and RESTIC_REPOSITORY must be set, additionally + # any relevant env vars for connecting to RESTIC_REPOSITORY should be set + env: {} + # RESTIC_PASSWORD + # RESTIC_REPOSITORY + # AWS_ACCESS_KEY_ID= + # AWS_SECRET_ACCESS_KEY= + # B2_ACCOUNT_ID= + # B2_ACCOUNT_KEY= + + # snapshot hostname will be set to the csiDriver.name value, in the case + # of local-hostpath the node name will be appended + # it is assumed that the repo has been created beforehand + kopia: + # kopia repository status -t -s + config_token: + global_flags: [] + # : + tags: [] + # - "foobar:true" + env: {} diff --git a/examples/lustre-client.yaml b/examples/lustre-client.yaml index 2f7ea7c..4bf7e89 100644 --- a/examples/lustre-client.yaml +++ b/examples/lustre-client.yaml @@ -9,3 +9,50 @@ lustre: dirPermissionsMode: "0777" dirPermissionsUser: root dirPermissionsGroup: wheel + snapshots: + # can create multiple snapshot classes each with a parameters.driver value which + # overrides the default, a single install can use all 3 simultaneously if desired + # + # available options: + # - filecopy = rsync/cp + # - restic + # - kopia + # + default_driver: filecopy + + # snapshot hostname will be set to the csiDriver.name value, in the case + # it is assumed that the repo has been created beforehand + restic: + global_flags: [] + # - --insecure-tls + + # these are added to snapshots, but are NOT used for querying/selectors by democratic-csi + # it is *HIGHLY* recommended to set the instance_id parameter when using restic, it should be a universally unique ID for every deployment + # host will be set to csi driver name + tags: [] + # - foobar + # - baz=bar + + # automatically prune when a snapshot is deleted + prune: true + + # at a minimum RESTIC_PASSWORD and RESTIC_REPOSITORY must be set, additionally + # any relevant env vars for connecting to RESTIC_REPOSITORY should be set + env: {} + # RESTIC_PASSWORD + # RESTIC_REPOSITORY + # AWS_ACCESS_KEY_ID= + # AWS_SECRET_ACCESS_KEY= + # B2_ACCOUNT_ID= + # B2_ACCOUNT_KEY= + + # backup hostname will be set to the csiDriver.name value, in the case + # it is assumed that the repo has been created beforehand + kopia: + # kopia repository status -t -s + config_token: + global_flags: [] + # : + tags: [] + # - "foobar:true" + env: {} diff --git a/examples/nfs-client.yaml b/examples/nfs-client.yaml index 0f3110b..5b49e55 100644 --- a/examples/nfs-client.yaml +++ b/examples/nfs-client.yaml @@ -8,3 +8,50 @@ nfs: dirPermissionsMode: "0777" dirPermissionsUser: root dirPermissionsGroup: wheel + snapshots: + # can create multiple snapshot classes each with a parameters.driver value which + # overrides the default, a single install can use all 3 simultaneously if desired + # + # available options: + # - filecopy = rsync/cp + # - restic + # - kopia + # + default_driver: filecopy + + # snapshot hostname will be set to the csiDriver.name value, in the case + # it is assumed that the repo has been created beforehand + restic: + global_flags: [] + # - --insecure-tls + + # these are added to snapshots, but are NOT used for querying/selectors by democratic-csi + # it is *HIGHLY* recommended to set the instance_id parameter when using restic, it should be a universally unique ID for every deployment + # host will be set to csi driver name + tags: [] + # - foobar + # - baz=bar + + # automatically prune when a snapshot is deleted + prune: true + + # at a minimum RESTIC_PASSWORD and RESTIC_REPOSITORY must be set, additionally + # any relevant env vars for connecting to RESTIC_REPOSITORY should be set + env: {} + # RESTIC_PASSWORD + # RESTIC_REPOSITORY + # AWS_ACCESS_KEY_ID= + # AWS_SECRET_ACCESS_KEY= + # B2_ACCOUNT_ID= + # B2_ACCOUNT_KEY= + + # snapshot hostname will be set to the csiDriver.name value, in the case + # it is assumed that the repo has been created beforehand + kopia: + # kopia repository status -t -s + config_token: + global_flags: [] + # : + tags: [] + # - "foobar:true" + env: {} diff --git a/examples/objectivefs.yaml b/examples/objectivefs.yaml index 6d19745..bb31d61 100644 --- a/examples/objectivefs.yaml +++ b/examples/objectivefs.yaml @@ -2,7 +2,11 @@ driver: objectivefs objectivefs: # note, ALL provisioned filesystems will be created in this pool / bucket # with the same passphrase entered below - pool: ofs + # + # in general this pool should be considered as fully managed by democratic-csi + # so a dedicated pool per-cluster / deployment would be best practice + # + pool: ofscsi cli: sudoEnabled: false env: diff --git a/examples/smb-client.yaml b/examples/smb-client.yaml index f4a6646..7a5d4e0 100644 --- a/examples/smb-client.yaml +++ b/examples/smb-client.yaml @@ -8,3 +8,50 @@ smb: dirPermissionsMode: "0777" dirPermissionsUser: root dirPermissionsGroup: wheel + snapshots: + # can create multiple snapshot classes each with a parameters.driver value which + # overrides the default, a single install can use all 3 simultaneously if desired + # + # available options: + # - filecopy = rsync/cp + # - restic + # - kopia + # + default_driver: filecopy + + # snapshot hostname will be set to the csiDriver.name value, in the case + # it is assumed that the repo has been created beforehand + restic: + global_flags: [] + # - --insecure-tls + + # these are added to snapshots, but are NOT used for querying/selectors by democratic-csi + # it is *HIGHLY* recommended to set the instance_id parameter when using restic, it should be a universally unique ID for every deployment + # host will be set to csi driver name + tags: [] + # - foobar + # - baz=bar + + # automatically prune when a snapshot is deleted + prune: true + + # at a minimum RESTIC_PASSWORD and RESTIC_REPOSITORY must be set, additionally + # any relevant env vars for connecting to RESTIC_REPOSITORY should be set + env: {} + # RESTIC_PASSWORD + # RESTIC_REPOSITORY + # AWS_ACCESS_KEY_ID= + # AWS_SECRET_ACCESS_KEY= + # B2_ACCOUNT_ID= + # B2_ACCOUNT_KEY= + + # snapshot hostname will be set to the csiDriver.name value, in the case + # it is assumed that the repo has been created beforehand + kopia: + # kopia repository status -t -s + config_token: + global_flags: [] + # : + tags: [] + # - "foobar:true" + env: {} diff --git a/package-lock.json b/package-lock.json index bd38910..ea1ef0d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -117,15 +117,15 @@ } }, "node_modules/@grpc/grpc-js": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.10.1.tgz", - "integrity": "sha512-55ONqFytZExfOIjF1RjXPcVmT/jJqFzbbDqxK9jmRV4nxiYWtL9hENSW1Jfx0SdZfrvoqd44YJ/GJTqfRrawSQ==", + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.10.3.tgz", + "integrity": "sha512-qiO9MNgYnwbvZ8MK0YLWbnGrNX3zTcj6/Ef7UHu5ZofER3e2nF3Y35GaPo9qNJJ/UJQKa4KL+z/F4Q8Q+uCdUQ==", "dependencies": { - "@grpc/proto-loader": "^0.7.8", - "@types/node": ">=12.12.47" + "@grpc/proto-loader": "^0.7.10", + "@js-sdsl/ordered-map": "^4.4.2" }, "engines": { - "node": "^8.13.0 || >=10.10.0" + "node": ">=12.10.0" } }, "node_modules/@grpc/proto-loader": { @@ -178,6 +178,15 @@ "integrity": "sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==", "dev": true }, + "node_modules/@js-sdsl/ordered-map": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/@js-sdsl/ordered-map/-/ordered-map-4.4.2.tgz", + "integrity": "sha512-iUKgm52T8HOE/makSxjqoWhe95ZJA1/G1sYsGev2JDKUSS14KAgg1LHb+Ba+IPow0xflbnSkOsZcO08C7w1gYw==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/js-sdsl" + } + }, "node_modules/@kubernetes/client-node": { "version": "0.18.1", "resolved": "https://registry.npmjs.org/@kubernetes/client-node/-/client-node-0.18.1.tgz", @@ -204,14 +213,6 @@ "openid-client": "^5.3.0" } }, - "node_modules/@kubernetes/client-node/node_modules/@types/node": { - "version": "18.19.18", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.18.tgz", - "integrity": "sha512-80CP7B8y4PzZF0GWx15/gVWRrB5y/bIjNI84NK3cmQJu0WZwvmj2WMA5LcofQFVfLqqCSp545+U2LsrVzX36Zg==", - "dependencies": { - "undici-types": "~5.26.4" - } - }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -312,9 +313,9 @@ "integrity": "sha512-k4MGaQl5TGo/iipqb2UDG2UwjXziSWkh0uysQelTlJpX1qGlpUZYm8PnO4DxG1qBomtJUdYJ6qR6xdIah10JLg==" }, "node_modules/@types/node": { - "version": "20.11.20", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.20.tgz", - "integrity": "sha512-7/rR21OS+fq8IyHTgtLkDK949uzsa6n8BkziAKtPVpugIkO6D+/ooXMvzXxDnZrmtXVfjb1bKQafYpb8s89LOg==", + "version": "18.19.26", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.26.tgz", + "integrity": "sha512-+wiMJsIwLOYCvUqSdKTrfkS8mpTp+MPINe6+Np4TAGFWWRWiBQ5kSq9nZGCSPkzx9mvT+uEukzpX4MOSCydcvw==", "dependencies": { "undici-types": "~5.26.4" } @@ -465,11 +466,11 @@ "integrity": "sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg==" }, "node_modules/axios": { - "version": "1.6.7", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.7.tgz", - "integrity": "sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA==", + "version": "1.6.8", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.8.tgz", + "integrity": "sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==", "dependencies": { - "follow-redirects": "^1.15.4", + "follow-redirects": "^1.15.6", "form-data": "^4.0.0", "proxy-from-env": "^1.1.0" } @@ -490,7 +491,8 @@ "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "devOptional": true }, "node_modules/bcrypt-pbkdf": { "version": "1.0.2", @@ -504,6 +506,7 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "devOptional": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -672,7 +675,8 @@ "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "devOptional": true }, "node_modules/core-util-is": { "version": "1.0.2", @@ -1084,9 +1088,9 @@ "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==" }, "node_modules/follow-redirects": { - "version": "1.15.5", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz", - "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==", + "version": "1.15.6", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", + "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==", "funding": [ { "type": "individual", @@ -1161,7 +1165,8 @@ "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true }, "node_modules/get-caller-file": { "version": "2.0.5", @@ -1183,6 +1188,7 @@ "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -1338,6 +1344,7 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "devOptional": true, "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -1427,9 +1434,9 @@ "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==" }, "node_modules/jose": { - "version": "4.15.4", - "resolved": "https://registry.npmjs.org/jose/-/jose-4.15.4.tgz", - "integrity": "sha512-W+oqK4H+r5sITxfxpSU+MMdr/YSWGvgZMQDIsNoBDGGy4i7GBPTtvFKibQzW06n3U3TqHjhvBJsirShsEJ6eeQ==", + "version": "4.15.5", + "resolved": "https://registry.npmjs.org/jose/-/jose-4.15.5.tgz", + "integrity": "sha512-jc7BFxgKPKi94uOvEmzlSWFFe2+vASyXaKUpdQKatWAESU2MWjDfFf0fdfc83CDKcA5QecabZeNLyfhe3yKNkg==", "optional": true, "funding": { "url": "https://github.com/sponsors/panva" @@ -1629,6 +1636,7 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "devOptional": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -1749,9 +1757,9 @@ } }, "node_modules/nan": { - "version": "2.18.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.18.0.tgz", - "integrity": "sha512-W7tfG7vMOGtD30sHoZSSc/JVYiyDPEyQVso/Zz+/uQd0B0L46gtC+pHha5FFMRpil6fm/AoEcRWyOVi4+E/f8w==", + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.19.0.tgz", + "integrity": "sha512-nO1xXxfh/RWNxfd/XPfbIfFk5vgLsAxUR9y5O0cHMJu/AW9U95JLXqthYHjEp+8gQ5p96K9jUp8nbVOxCdRbtw==", "optional": true }, "node_modules/natural-compare": { @@ -1804,6 +1812,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "devOptional": true, "dependencies": { "wrappy": "1" } @@ -1817,12 +1826,12 @@ } }, "node_modules/openid-client": { - "version": "5.6.4", - "resolved": "https://registry.npmjs.org/openid-client/-/openid-client-5.6.4.tgz", - "integrity": "sha512-T1h3B10BRPKfcObdBklX639tVz+xh34O7GjofqrqiAQdm7eHsQ00ih18x6wuJ/E6FxdtS2u3FmUGPDeEcMwzNA==", + "version": "5.6.5", + "resolved": "https://registry.npmjs.org/openid-client/-/openid-client-5.6.5.tgz", + "integrity": "sha512-5P4qO9nGJzB5PI0LFlhj4Dzg3m4odt0qsJTfyEtZyOlkgpILwEioOhVVJOrS1iVH494S4Ee5OCjjg6Bf5WOj3w==", "optional": true, "dependencies": { - "jose": "^4.15.4", + "jose": "^4.15.5", "lru-cache": "^6.0.0", "object-hash": "^2.2.0", "oidc-token-hash": "^5.0.3" @@ -1915,6 +1924,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "devOptional": true, "engines": { "node": ">=0.10.0" } @@ -2171,6 +2181,7 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, "dependencies": { "glob": "^7.1.3" }, @@ -2418,9 +2429,9 @@ } }, "node_modules/tar": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.0.tgz", - "integrity": "sha512-/Wo7DcT0u5HUV486xg675HtjNd3BXZ6xDbzsCUZPt5iw8bTQ63bP0Raut3mvro9u+CUyq7YQd8Cx55fsZXxqLQ==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", + "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", "dependencies": { "chownr": "^2.0.0", "fs-minipass": "^2.0.0", @@ -2456,14 +2467,11 @@ "dev": true }, "node_modules/tmp": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", - "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", - "dependencies": { - "rimraf": "^3.0.0" - }, + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.3.tgz", + "integrity": "sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w==", "engines": { - "node": ">=8.17.0" + "node": ">=14.14" } }, "node_modules/tmp-promise": { @@ -2623,9 +2631,9 @@ } }, "node_modules/winston": { - "version": "3.11.0", - "resolved": "https://registry.npmjs.org/winston/-/winston-3.11.0.tgz", - "integrity": "sha512-L3yR6/MzZAOl0DsysUXHVjOwv8mKZ71TrA/41EIduGpOOV5LQVodqN+QdQ6BS6PJ/RdIshZhq84P/fStEZkk7g==", + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/winston/-/winston-3.13.0.tgz", + "integrity": "sha512-rwidmA1w3SE4j0E5MuIufFhyJPBDG7Nu71RkZor1p2+qHvJSZ9GYDA81AyleQcZbh/+V6HjeBdfnTZJm9rSeQQ==", "dependencies": { "@colors/colors": "^1.6.0", "@dabh/diagnostics": "^2.0.2", @@ -2637,7 +2645,7 @@ "safe-stable-stringify": "^2.3.1", "stack-trace": "0.0.x", "triple-beam": "^1.3.0", - "winston-transport": "^4.5.0" + "winston-transport": "^4.7.0" }, "engines": { "node": ">= 12.0.0" @@ -2688,7 +2696,8 @@ "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "devOptional": true }, "node_modules/ws": { "version": "8.16.0", diff --git a/src/driver/controller-objectivefs/index.js b/src/driver/controller-objectivefs/index.js index d0b1164..ac4db64 100644 --- a/src/driver/controller-objectivefs/index.js +++ b/src/driver/controller-objectivefs/index.js @@ -115,6 +115,8 @@ class ControllerObjectiveFSDriver extends CsiBaseDriver { false ); + options.pool = _.get(driver.options, "objectivefs.pool"); + return new ObjectiveFS({ ...options, env: _.get(driver.options, "objectivefs.env", {}), diff --git a/src/driver/index.js b/src/driver/index.js index caab90d..7648a3f 100644 --- a/src/driver/index.js +++ b/src/driver/index.js @@ -183,10 +183,13 @@ class CsiBaseDriver { } getDefaultObjectiveFSInstance() { + const driver = this; return registry.get( `${__REGISTRY_NS__}:default_objectivefs_instance`, () => { - return new ObjectiveFS(); + return new ObjectiveFS({ + pool: _.get(driver.options, "objectivefs.pool"), + }); } ); } diff --git a/src/utils/objectivefs.js b/src/utils/objectivefs.js index 23392d5..bdc23cf 100644 --- a/src/utils/objectivefs.js +++ b/src/utils/objectivefs.js @@ -121,6 +121,8 @@ class ObjectiveFS { env = {}; } + filesystem = await objectivefs.stripObjectStoreFromFilesystem(filesystem); + /** * delete safety checks for filesystem * @@ -136,6 +138,16 @@ class ObjectiveFS { throw new Error(`filesystem safety check failed for fs: ${filesystem}`); } + let pool = objectivefs.options.pool; + pool = await objectivefs.stripObjectStoreFromFilesystem(pool); + if (!pool) { + throw new Error(`filesystem safety check failed for fs: ${filesystem}`); + } + + if (fs_parts[0].trim() != pool.trim()) { + throw new Error(`filesystem safety check failed for fs: ${filesystem}`); + } + if (!fs_parts[1]) { throw new Error(`filesystem safety check failed for fs: ${filesystem}`); } @@ -307,6 +319,7 @@ class ObjectiveFS { const cleansedLog = `${command} ${args.join(" ")}`; console.log("executing objectivefs command: %s", cleansedLog); + //console.log(options.env); return new Promise((resolve, reject) => { let stdin;