-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix deprecated use of hdr.Xattrs
(SA1019)
#1985
Fix deprecated use of hdr.Xattrs
(SA1019)
#1985
Conversation
bebf76f
to
6bcee99
Compare
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Honny1, rhatdan The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
6bcee99
to
475d1b5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This LGTM locally, but this is fairly critical low-level code. Could you check that the packages do have some tests that cover the changed code, please? (One possible approach would be, for each instance, to just delete the Xattr handling code, and ensure that at least one c/storage test fails. Ideally the tests that fail should go all the way between a local file and a tar stream, not just a local unit test on ReadSecurityXattrToTarHeader
or so.)
Also Cc: @nalind for expert insights.
2514d3c
to
76ad219
Compare
@mtrmac PTANL |
I’m fine with the code, but I’d like to hear an assurance that this is covered by tests. (Yes, I could go verify that myself…) |
I checked the unit tests by commenting out the parts of the code that were changed if the tests fail. The tests did not fail for the |
I’d guess that if c/storage does not test these somewhat obscure aspects of layer extraction itself, Podman is unlikely to; but triggering a Podman CI run with a modified c/storage is probably much cheaper than manual analysis, so, sure, go for it. |
pkg/archive/archive.go
Outdated
continue | ||
} | ||
if err := system.Lsetxattr(path, key, []byte(value), 0); err != nil { | ||
if err := system.Lsetxattr(path, xattr_key, []byte(value), 0); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use xattrKey
if you really need to change it
76ad219
to
b618afa
Compare
bb85554
to
0246ea4
Compare
I added an xattr to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand it correctly, with this PR we have xattr test coverage for archive.go
. Great!
I can’t see any c/storage test at all exercising compressor.ZstdCompressor
; I can’t see any for the whiteout converter either, but there it’s quite possible I have missed one.
*shrug* if that’s the case, I think it can be reasonably argued it’s not the responsibility of this PR to add missing tests to entire large features.
0246ea4
to
f0e6411
Compare
Signed-off-by: Jan Rodák <[email protected]>
f0e6411
to
965fb12
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
Thanks!
965fb12
to
1b68ac8
Compare
/lgtm |
@Honny1 the tests are failing |
1b68ac8
to
dcf95c9
Compare
Signed-off-by: Jan Rodák <[email protected]>
dcf95c9
to
f764eb9
Compare
@mtrmac The tests are passing. |
/lgtm |
This PR fixes warning deprecated use of
hdr.Xattrs
(SA1019) found bygolangci
when thestaticcheck
linter is enabled.Partially fixes: