Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pools ignore in exclude option #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

cmp168
Copy link

@cmp168 cmp168 commented Feb 28, 2024

No description provided.

@pdf pdf added the enhancement New feature or request label Feb 28, 2024
@pdf
Copy link
Owner

pdf commented Feb 28, 2024

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

@cmp168
Copy link
Author

cmp168 commented Feb 28, 2024

Separate via regexp in docs used ^rpool

@pdf
Copy link
Owner

pdf commented Feb 29, 2024

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

@cmp168
Copy link
Author

cmp168 commented Feb 29, 2024

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

@pdf
Copy link
Owner

pdf commented Feb 29, 2024

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 pdf self-requested a review February 29, 2024 07:10
@cmp168
Copy link
Author

cmp168 commented Feb 29, 2024

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

@pdf
Copy link
Owner

pdf commented Apr 13, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants