Add --keep-ownership option to add/copy commands to keep file ownership.#3767
Add --keep-ownership option to add/copy commands to keep file ownership.#3767r10r wants to merge 1 commit intocontainers:mainfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: r10r The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Please confirm if this can be added - I'll then add tests and documentation as soon as possible. |
23a8c16 to
b385aa1
Compare
b385aa1 to
ed4700a
Compare
|
I dropped the commits which are not required. Simply exposing KeepOwnership is enough. |
|
You need to add a test to get this in. |
This exposes the already existing KeepOwnership flag to the copy and add CLI commands. Signed-off-by: Ruben Jenster <r.jenster@drachenfels.de>
|
A friendly reminder that this PR had no activity for 30 days. |
|
@r10r Still working on this? |
|
@rhatdan Yes, I think I'll get it done this week. |
|
@r10r Would love to see this integrated. Can you please finish it? Thank you! |
|
I tried to add the test, but I get stopped from the Vendor package: https://github.com/openshift/imagebuilder/blob/master/dispatchers.go#L199 What would be the better approach to add this feature? Create a PR to the vendor or have a fork/mirror with the changes and replace the vendor package? |
|
@Dexus You can replace imagebuilder with your own fork for testing and in the PR as well but before the PR is merged that fork has to point to actual upstream so changes has to go into upstream imagebuilder as well. |
|
@Dexus Thanks for looking at the tests. It seems there is missing some documentation right now for the checks to continue
|
|
looks like it will need much more then only this small PR. In the test it will not copy the uid/gid of the file. While it is copy the uid/gid from other images/multi step builds - but this is also by default.
Sure, but I'm currently first on the stage where I would like to make the tests working. I'm not getting problems with the docs currently :) |
|
Okay, I'm on a good way openshift/imagebuilder#227 is created and will updated once I'm having a green lights from tests. |
|
@r10r I'm not able to create a PR for your fork repository, is it okay, when I create a new PR or will you merge my repository into yours? https://github.com/Dexus-Forks/buildah/tree/copy-keep-ownership go.mod needs to add a replace for |
What type of PR is this?
What this PR does / why we need it:
This new flag is required if you want to keep file ownership when using
buildah copyorbuildah addto copy localcontent into a container.
How to verify it
Copy a single file:
expected output
Copy a folder.
expected output
Which issue(s) this PR fixes:
None
Special notes for your reviewer:
Tests and documentation follow.
Does this PR introduce a user-facing change?