Repository navigation
cri: tolerate wrapped ENOTSUP during relabel - #14207
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Add regression coverage for wrapped ENOTSUP and other relabel errors.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
Updates CRI relabel handling to tolerate wrapped syscall.ENOTSUP errors while preserving other relabel failures.
Changes:
- Uses
errors.Isto inspect wrapped errors. - Continues propagating unrelated relabel failures.
| File | Summary |
|---|---|
internal/cri/opts/spec_linux_opts.go |
Handles wrapped unsupported-filesystem errors during SELinux relabeling. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| if mount.GetSelinuxRelabel() { | ||
| ENOTSUP := syscall.Errno(0x5f) // Linux specific error code, this branch will not execute on non Linux platforms. | ||
| if err := label.Relabel(src, mountLabel, false); err != nil && err != ENOTSUP { | ||
| if err := checkRelabelError(label.Relabel(src, mountLabel, false)); err != nil { |
There was a problem hiding this comment.
I think we can inline the ENOTSUP check, the test is probably overkill.
543ced4 to
1432576
Compare
label.Relabel can return a PathError wrapping ENOTSUP. Use errors.Is so the existing unsupported-filesystem tolerance also handles wrapped errors. Signed-off-by: Nan Liu <[email protected]>
1432576 to
f42cf45
Compare
|
/cherry-pick release/2.4 |
|
@cpuguy83: new pull request created: #14210 DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
@cpuguy83: new pull request created: #14211 DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
@cpuguy83: new pull request created: #14212 DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |


label.Relabelcan return an*os.PathErrorwrappingsyscall.ENOTSUPwhen the source filesystem does not support SELinux extended attributes. The existing direct comparison only recognizes an unwrapped errno, so CRI container creation fails instead of tolerating the unsupported relabel operation.Tested with:
GOTOOLCHAIN=auto go test ./internal/cri/optsGOTOOLCHAIN=auto make check