Add --enable-snapshot-compression flag to control snapshot compression
What type of PR is this?
/kind feature
What this PR does / why we need it:
Adds --enable-snapshot-compression driver parameter to control whether gzip compression is applied when creating volume snapshots. Users storing already-compressed data can set this to false to skip redundant compression, significantly speeding up snapshot creation and restoration.
Changes:
- Add
EnableSnapshotCompressiontoDriverOptionsandDriverstructs - Add
--enable-snapshot-compressionCLI flag (default:true) - Update
CreateSnapshotto use.taror.tar.gzbased on setting - Update
copyFromSnapshotto auto-detect archive format for backward compatibility - Add Helm chart support via
controller.enableSnapshotCompression
Usage:
# Disable compression for pre-compressed data
--enable-snapshot-compression=false
# Helm values
controller:
enableSnapshotCompression: false
Which issue(s) this PR fixes:
Fixes #891
Special notes for your reviewer:
- Default
truepreserves existing behavior - Snapshot restoration auto-detects format (tries
.tar.gzfirst, then.tar) ensuring backward compatibility with existing compressed snapshots - Both Go library (
TarPack/TarUnpack) and external tar command paths updated
Does this PR introduce a user-facing change?:
Add --enable-snapshot-compression flag to control whether gzip compression is performed when creating volume snapshots. Set to false to skip compression for volumes containing already-compressed data.
Original prompt
This section details on the original issue you should resolve
<issue_title>Add a parameter to control whether compression is performed when creating volumesnapshots.</issue_title> <issue_description>Is your feature request related to a problem?/Why is this needed
I stores some large compressed files with PVCs. Creating volumesnapshot would compress those files again that is very time-consuming and the compression effect is quite limited.
Describe the solution you'd like in detail
Add a driver parameter to control whether compression is performed when creating volumesnapshots. If no compression,snapshot-controller would do
tar(untar) without-zwhen creating (restoring) a volumesnapshot.</issue_description>
Comments on the Issue (you are @copilot in this section)
- Fixes kubernetes-csi/csi-driver-nfs#998
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.
Hi @Copilot. Thanks for your PR.
I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.
Once the patch is verified, the new status will be reflected by the ok-to-test label.
I understand the commands that are listed here.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: Copilot Once this PR has been reviewed and has the lgtm label, please ask for approval from andyzhangx. For more information see the Code Review Process.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: Copilot Once this PR has been reviewed and has the lgtm label, please ask for approval from andyzhangx. For more information see the Code Review Process.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment