Skip to content

quadlet: support tarball extraction for install command#28136

Open
Veector40 wants to merge 1 commit intocontainers:mainfrom
Veector40:feature-quadlet-tarball
Open

quadlet: support tarball extraction for install command#28136
Veector40 wants to merge 1 commit intocontainers:mainfrom
Veector40:feature-quadlet-tarball

Conversation

@Veector40
Copy link
Copy Markdown
Contributor

Currently, podman quadlet install only supports individual files or directories. This PR implements support for installing Quadlet applications packaged as tar archives, satisfying a recent feature request.

Changes:

  • Archive Detection: Automatically detects .tar, .tar.gz, and .tgz files for both local paths and remote HTTP/HTTPS URLs.
  • Secure Extraction: Implements a dedicated extraction utility with path-traversal protection (Zip Slip prevention) to ensure files are only written within a controlled temporary directory.
  • Application Grouping: Extracted tarballs are treated as a Quadlet "App," meaning all units inside the archive are tracked together via a .app asset file for easy management and removal.
  • BATS Integration: Added a comprehensive system test in 253-podman-quadlet.bats that verifies both standard and compressed tarball installation, listing, and clean removal.

Fixes: #28117

Checklist

  • Certify you wrote the patch or otherwise have the right to pass it on as an open-source patch by signing all commits.
  • Referenced issues using Fixes: #28117 in commit message.
  • Tests have been added/updated.
  • Documentation has been updated (feature matches existing description of URL support).
  • All commits pass make validatepr (format/lint checks).
  • [Release note] entered in the section below.

Does this PR introduce a user-facing change?

The `podman quadlet install` command now supports installing Quadlet files packaged inside `.tar`, `.tar.gz`, and `.tgz` archives from local paths or remote URLs.

Copy link
Copy Markdown
Member

@Honny1 Honny1 left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution! I have a few suggestions for improvement. We might want to consider avoiding staging everything in a temporary directory. Instead, we could stream entries from the tarball directly to a reader based variant of installQuadlet. This is a bit outside the scope of the original issue, but it's worth considering during this refactor.

Comment thread pkg/domain/infra/abi/quadlet.go Outdated
Comment thread pkg/domain/infra/abi/quadlet.go Outdated
Comment thread pkg/domain/infra/abi/quadlet.go
Comment thread test/system/253-podman-quadlet.bats
@Veector40 Veector40 force-pushed the feature-quadlet-tarball branch from 23213d6 to 3922957 Compare February 25, 2026 16:15
@Veector40
Copy link
Copy Markdown
Contributor Author

Thanks for the great feedback, @Honny1! I've updated the PR to address your suggestions:

  • Refactored extraction: I dropped the manual extractTarball function and switched to using go.podman.io/storage/pkg/archive for robust archive manipulation as you rightfully suggested.

  • Code deduplication:I unified the logic for URL and local path handling to reduce redundancy. The extraction and installation flow is now wrapped in an anonymous function to ensure defer cleanups happen reliably per loop iteration.

  • Simplified tests: I trimmed down the BATS test to a single standard .tar test, since the archive package natively handles compression detection and we don't need to reinvent the wheel by testing .tar.gz and .tgz separately at this layer.

Let me know if you'd like anything else to be amended

@Honny1
Copy link
Copy Markdown
Member

Honny1 commented Feb 26, 2026

Before I do a second round of review, please ensure the CI passes.

@Veector40 Veector40 force-pushed the feature-quadlet-tarball branch from 3922957 to cdb8754 Compare February 26, 2026 09:57
Currently, podman quadlet install only supports individual files or directories. This implements support for installing Quadlet applications packaged as tar archives.

Changes:
- Detects .tar, .tar.gz, and .tgz files.
- Uses go.podman.io/storage/pkg/archive for robust extraction.
- Unifies URL and local path handling.
- Groups extracted units under a single .app asset for easy tracking/removal.

Fixes: containers#28117
Signed-off-by: Victor Koycheff <victorkoycheff@gmail.com>
@Veector40 Veector40 force-pushed the feature-quadlet-tarball branch from cdb8754 to b0f9839 Compare February 26, 2026 10:03
@axel7083
Copy link
Copy Markdown
Contributor

axel7083 commented Mar 6, 2026

Hey @Veector40 I'm the author of the issue you are trying to solve (#28117).

It has been a week, and I was wondering if you are still planning to work on this issue? Otherwise I'm interested in taking over the issue 👍

@victorrobotxt
Copy link
Copy Markdown

Ofc, it's all yours. In case you need a review or anything, let me know

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 6, 2026

A friendly reminder that this PR had no activity for 30 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

podman quadlet install <file/url> should support tarball

4 participants