Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 1, 2025

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 EnableSnapshotCompression to DriverOptions and Driver structs
  • Add --enable-snapshot-compression CLI flag (default: true)
  • Update CreateSnapshot to use .tar or .tar.gz based on setting
  • Update copyFromSnapshot to 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 true preserves existing behavior
  • Snapshot restoration auto-detects format (tries .tar.gz first, 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 -z when creating (restoring) a volumesnapshot.

</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Dec 1, 2025
@k8s-ci-robot
Copy link
Contributor

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.

Details

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.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Dec 1, 2025
Add a new driver parameter to control whether compression is performed when
creating volume snapshots. This addresses the feature request to skip gzip
compression when storing already-compressed data, which can significantly
speed up snapshot creation and restoration.

Changes:
- Add EnableSnapshotCompression field to DriverOptions and Driver structs
- Add --enable-snapshot-compression flag (default: true for backward compatibility)
- Update CreateSnapshot to respect compression setting
- Update copyFromSnapshot to auto-detect archive format for backward compatibility
- Update archiveName() to return .tar or .tar.gz based on compression setting
- Update Helm chart values and templates
- Update documentation
- Add unit tests for compression toggle functionality

Co-authored-by: andyzhangx <[email protected]>
@k8s-ci-robot
Copy link
Contributor

[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.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

1 similar comment
@k8s-ci-robot
Copy link
Contributor

[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.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Dec 1, 2025
Copilot AI changed the title [WIP] Add parameter to control compression for volume snapshots Add --enable-snapshot-compression flag to control snapshot compression Dec 1, 2025
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Dec 1, 2025
Copilot AI requested a review from andyzhangx December 1, 2025 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a parameter to control whether compression is performed when creating volumesnapshots.

3 participants