Skip to content

Add zstd decompression support for overlaybd-apply - #371

Merged
BigVan merged 1 commit into
containerd:mainfrom
runloopai:adam/zstd
Nov 20, 2025
Merged

Add zstd decompression support for overlaybd-apply#371
BigVan merged 1 commit into
containerd:mainfrom
runloopai:adam/zstd

Conversation

@adam-rl

@adam-rl adam-rl commented Aug 5, 2025

Copy link
Copy Markdown
Contributor

What this PR does / why we need it: Adds support to decompress tar archives originally compressed with ZSTD in overlaybd-apply.

Please check the following list:

  • Does the affected code have corresponding tests, e.g. unit test, E2E test?
  • Does this change require a documentation update?
  • Does this introduce breaking changes that would require an announcement or bumping the major version?
  • Do all new files have an appropriate license header?

@liulanzheng
liulanzheng requested a review from BigVan August 6, 2025 08:49
Comment thread src/overlaybd/zstd/zstdfile.cpp Outdated
Comment thread src/overlaybd/zstd/zstdfile.h Outdated
${PHOTON_INCLUDE_DIR}
)

target_link_libraries(zstd_lib photon_static ${LIBZSTD})

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realized we already link zstd, no need to pull a copy from github.

}
src_file = open_gzfile_adaptor(input_path.c_str());
} else if (is_zstdfile(tarf)) {
src_file = open_zstdfile_adaptor(tarf, /*ownership=*/false);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The control flow here is a bit tricky, as we defer delete tarf. So I just make sure we don't take ownership in the zstd file adapter.

@adam-rl

adam-rl commented Aug 14, 2025

Copy link
Copy Markdown
Contributor Author

Ready for another round of review :)

@liulanzheng
liulanzheng requested a review from BigVan August 29, 2025 03:16
@BigVan

BigVan commented Nov 20, 2025

Copy link
Copy Markdown
Member

LGTM
I'm so sorry that I forgot to review this PR earlier

@BigVan
BigVan merged commit 222aa97 into containerd:main Nov 20, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants