Add support for symbolic chmod options#6778
Conversation
|
Ephemeral COPR build failed. @containers/packit-build please check. |
0d82f4b to
42d5139
Compare
nalind
left a comment
There was a problem hiding this comment.
Overall this looks very good to me. A couple of quibbles about using test helper functions that would shorten them, and a question about calling mode.Parse() multiple times when reading.
|
Thanks for the detailed review, @nalind! I'll fix these up tomorrow and push a fresh version. |
42d5139 to
f6861de
Compare
f6861de to
2094dca
Compare
I ended up not waiting 'til tomorrow and just doing it. Replaced a couple more I'm not sure what to do about the |
nalind
left a comment
There was a problem hiding this comment.
Please go ahead and make that change. I think we're going to want this to be rebased before merging.
57ee0cf to
c5cea6e
Compare
Done, including the rebase. I haven't tested as heavily, as the tests aren't all working on my local machine as they should, but I'll trust in the CI tests for now. |
Changes look good, but usually I expect merge commits to be dropped during a rebase. Did you |
3d13151 to
443ac4d
Compare
Oh, apologies, I said I rebased but I actually just merged main, indeed, my bad. I made a fresh branch from latest main, and cherry-picked & manually reapplied & amended my changes to it. So hopefully this is better. |
|
Much, better, thanks! |
443ac4d to
d32a6f7
Compare
|
@containers/buildah-maintainers PTAL |
|
@nickjwhite looks like you may need to rebase this. |
|
Other than a few test tweaks, and a rebase |
d32a6f7 to
85942ea
Compare
This adds an optional Chmod string option to GetOptions and PutOptions. If set, this overrides the ChmodDirs and ChmodFiles options. If unset, they continue to work as before. The --chmod option to buildah add and buildah copy works with symbolic as well as numeric arguments. Fixes containers#6066 Signed-off-by: Nick White <git@njw.name>
85942ea to
7c3cb08
Compare
|
@TomSweeneyRedHat can you take another look please? I added the extra tests you suggested and rebased, so this should be ready to go. |
|
@nickjwhite apologies for the very tardy re-review. LGTM. |
What type of PR is this?
/kind feature
What this PR does / why we need it:
This adds an optional Chmod string option to GetOptions and PutOptions. If set, this overrides the ChmodDirs and ChmodFiles options. If unset, they continue to work as before.
The --chmod option to buildah add and buildah copy works with symbolic as well as numeric arguments.
How to verify it
See extra bats tests and copier tests.
Which issue(s) this PR fixes:
Fixes #6066
Special notes for your reviewer:
Note that I'm not sure whether the extra tests in
commit_test.goadd much value over those incopier/copier_test.go, but I used them while working on this change, so I figured I'd just include them.Also I'm not sure if this is the way you want the vendored stuff to be included (I added the newly added directory after running 'make vendor') - let me know if I should do it differently.
#6732 suggested calling the new option in
GetOptions&PutOptionsChmodStr, but I choseChmodhere because I think it's shorter and clearer.Does this PR introduce a user-facing change?