zfs_exporter icon indicating copy to clipboard operation
zfs_exporter copied to clipboard

Add pools ignore in exclude option

Open cmp168 opened this issue 2 years ago • 7 comments

cmp168 avatar Feb 28 '24 12:02 cmp168

What if pool and dataset names overlap? I suspect this probably needs to be a separate flag, but could be convinced otherwise.

pdf avatar Feb 28 '24 12:02 pdf

Separate via regexp in docs used ^rpool

cmp168 avatar Feb 28 '24 13:02 cmp168

What if I want to exclude the dataset rpool, but not the pool rpool?

pdf avatar Feb 29 '24 00:02 pdf

--exclude='^(.+)/rpool/(.+)$' or /rpool, first '/' imposible in pool name

cmp168 avatar Feb 29 '24 07:02 cmp168

The top-level dataset name and the pool name cannot be differentiated - there are no slashes, and dataset names are never preceeded by a slash:

$ zfs list -o name rpool
NAME
rpool

$ zpool list -o name rpool
NAME
rpool

pdf avatar Feb 29 '24 07:02 pdf

aha, not bug is feature)). But for always valid result need more what 12 string changes, default dataset name in pool with not default name unlikely, maybe replace if c.excludes.MatchString(p) { to if c.excludes.MatchString("pool:" + p) { and use --exclude=pool:rpool, but i not sure is good idea

cmp168 avatar Feb 29 '24 07:02 cmp168

maybe replace if c.excludes.MatchString(p) { to if c.excludes.MatchString("pool:" + p) { and use --exclude=pool:rpool, but i not sure is good idea

I guess you could do it this way, but simpler and more discoverable to just add a separate flag.

pdf avatar Apr 13 '24 23:04 pdf