truenas-csp icon indicating copy to clipboard operation
truenas-csp copied to clipboard

Scope pool/dataset lookups to root path

Open maxirus opened this issue 4 years ago • 0 comments

When looking for datasets the the CSI Driver has created, it scans the output of pool/dataset (see docs & example) which retrieves all of the datasets in TrueNAS.

Instead, these on_get methods should scope the datasets to parameters.root path given in the StorageClass.

At first look, it doesn't appear this parameter is passed down in the request (see spec) so will most likely needed to be loaded from the Secret as an env var (DEFAULT_ROOT ?). Given the above, the req paths go from pool/dataset to pool/dataset?id=${DEFAULT_ROOT}.

Example curl command: curl -X GET "https://freenas.host/api/v2.0/pool/dataset?id=tank/k8s-iscsi" -H "accept: */*" -su 'root'

maxirus avatar Feb 25 '21 03:02 maxirus