mirror of
https://github.com/zrepl/zrepl.git
synced 2025-03-30 18:27:21 +02:00
List only configured datasets
This commit is contained in:
parent
bae2bd2601
commit
5f501fdca9
@ -68,9 +68,21 @@ func ZFSListMappingProperties(ctx context.Context, filter DatasetFilter, propert
|
|||||||
defer cancel()
|
defer cancel()
|
||||||
rchan := make(chan ZFSListResult)
|
rchan := make(chan ZFSListResult)
|
||||||
|
|
||||||
go ZFSListChan(ctx, rchan, properties, nil, "-r", "-t", "filesystem,volume")
|
args := []string{"-r", "-t", "filesystem,volume"}
|
||||||
|
|
||||||
unmatchedUserSpecifiedDatasets := filter.UserSpecifiedDatasets()
|
unmatchedUserSpecifiedDatasets := filter.UserSpecifiedDatasets()
|
||||||
|
for ds, _ := range unmatchedUserSpecifiedDatasets {
|
||||||
|
var path *DatasetPath
|
||||||
|
if path, err = NewDatasetPath(ds); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if ph, err := ZFSGetFilesystemPlaceholderState(ctx, path); err == nil && ph.FSExists {
|
||||||
|
args = append(args, ds)
|
||||||
|
delete(unmatchedUserSpecifiedDatasets, path.ToString())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
err = nil
|
||||||
|
|
||||||
|
go ZFSListChan(ctx, rchan, properties, nil, args...)
|
||||||
datasets = make([]ZFSListMappingPropertiesResult, 0)
|
datasets = make([]ZFSListMappingPropertiesResult, 0)
|
||||||
for r := range rchan {
|
for r := range rchan {
|
||||||
|
|
||||||
@ -84,8 +96,6 @@ func ZFSListMappingProperties(ctx context.Context, filter DatasetFilter, propert
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
delete(unmatchedUserSpecifiedDatasets, path.ToString())
|
|
||||||
|
|
||||||
pass, filterErr := filter.Filter(path)
|
pass, filterErr := filter.Filter(path)
|
||||||
if filterErr != nil {
|
if filterErr != nil {
|
||||||
return nil, fmt.Errorf("error calling filter: %s", filterErr)
|
return nil, fmt.Errorf("error calling filter: %s", filterErr)
|
||||||
|
Loading…
Reference in New Issue
Block a user