mirror of
https://github.com/zrepl/zrepl.git
synced 2025-03-27 15:46:29 +01: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()
|
||||
rchan := make(chan ZFSListResult)
|
||||
|
||||
go ZFSListChan(ctx, rchan, properties, nil, "-r", "-t", "filesystem,volume")
|
||||
|
||||
args := []string{"-r", "-t", "filesystem,volume"}
|
||||
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)
|
||||
for r := range rchan {
|
||||
|
||||
@ -84,8 +96,6 @@ func ZFSListMappingProperties(ctx context.Context, filter DatasetFilter, propert
|
||||
return
|
||||
}
|
||||
|
||||
delete(unmatchedUserSpecifiedDatasets, path.ToString())
|
||||
|
||||
pass, filterErr := filter.Filter(path)
|
||||
if filterErr != nil {
|
||||
return nil, fmt.Errorf("error calling filter: %s", filterErr)
|
||||
|
Loading…
Reference in New Issue
Block a user