truenas-csp
truenas-csp copied to clipboard
Scope pool/dataset lookups to root path
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'