-
Notifications
You must be signed in to change notification settings - Fork 30
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
feat(list_snap): zfs listsnap
CLI
#295
Conversation
Signed-off-by: Vitta <vitta@mayadata.io>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It isn't clear to me why we're adding a new command, when zfs list -t snapshot
already exists
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good. one minor comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good.
Signed-off-by: Vitta <vitta@mayadata.io>
incorporated review comments |
Signed-off-by: Vitta <vitta@mayadata.io>
Signed-off-by: Vitta <vitta@mayadata.io>
Signed-off-by: Vitta <vitta@mayadata.io>
Signed-off-by: Vitta <vitta@mayadata.io>
Signed-off-by: Vitta <vitta@mayadata.io>
@vishnuitta can you update the PR description with the modified output? |
PR description already have modified output |
This command caches the response. As the control plane triggers the request very frequently (say every 30 seconds), reading from disk doesn't make sense. So, this command is introduced to cache the response and keep the in-memory data up-to-date. |
I see in the PR you have change the o/p to fprintf(stdout, "%s\n", str_val); from fprintf(stdout, "%s: %s\n", nvpair_name(elem),str_val)? |
yes.. I updated the output after changing this print in the code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changes are good
Signed-off-by: Vitta <vitta@mayadata.io>
This PR adds the
zfs listsnap <dataset>
CLI.For this command, output will be in json format as:
This will NOT list the snapshots created through 'zfs snapshot' until the zrepl is restarted. However, it lists the snapshots created through istgt iscsi target.
Even though existing
zfs list -t snapshot
gives the list of snapshots, difference with this CLI is just NOT about printing in json format. Main difference is in caching the response. This command implementation will NOT read the contents from disk for every trigger of the command. It does read from disk one time, and keeps updating it with the new snapshots name whenever istgt sends SNAP_CREATE command.Working on testcases.
Signed-off-by: Vitta vitta@mayadata.io