feat: ADD/COPY --link support for buildah
What type of PR is this?
/kind feature
What this PR does / why we need it:
This patch implements the --link functionality for COPY and ADD instructions, enabling the creation of cachable layers that can be reused independently across builds.
When specified, content is staged separately and archived into an independent layer with computed digest, allowing cache reuse even when underlying base layers change.
Follows Buildkit --link specifications while maintaining compatibility with existing COPY/ADD behavior.
How to verify it
bats tests/bud.bats
Which issue(s) this PR fixes:
Fixes #4325
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Yes, COPY --link and ADD --link instructions now fully support layered build caching.
Ephemeral COPR build failed. @containers/packit-build please check.
Ephemeral COPR build failed. @containers/packit-build please check.
Can you rebase onto the main branch and squash your commits?
The "user-facing change" section is the kind of text which would be reproduced verbatim in the release notes for a release (for example, if we started scripting, digging the descriptions of the merged PRs, and snipping out just the bit with the "```release-note" header), so it should describe the change instead of alluding to it.
I found a couple of nits that should be tweaked. @nalind @2004joshua do you think this is close to getting merged this week? We had a delivery date of next Monday.
LGTM
@containers/buildah-maintainers PTAL
A couple of tests look to be hiccuping, restarting.
/approve /lgtm
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: 2004joshua, rhatdan
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [rhatdan]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment