Skip to content

cri: tolerate wrapped ENOTSUP during relabel - #14207

Merged
estesp merged 1 commit into
containerd:mainfrom
liunan-ms:liunan/cri-wrapped-enotsup-relabel
Sep 23, 2026
Merged

estesp merged 1 commit into
containerd:mainfrom
liunan-ms:liunan/cri-wrapped-enotsup-relabel

Conversation

@liunan-ms

@liunan-ms liunan-ms commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

label.Relabel can return an *os.PathError wrapping syscall.ENOTSUP when 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/opts
  • GOTOOLCHAIN=auto make check

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Medium severity

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.Is to 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.

Comment thread internal/cri/opts/spec_linux_opts.go Resolved
Copilot AI review requested due to automatic review settings September 22, 2026 22:27
@kubernetes-prow kubernetes-prow Bot added size/M and removed size/XS labels Sep 22, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The requested behavior is implemented and covered by tests.

Review effort: Lite
Findings: None

Resolved since last review (1)

cpuguy83
cpuguy83 previously approved these changes Sep 22, 2026
Comment thread internal/cri/opts/spec_linux_opts.go Outdated
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 {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can inline the ENOTSUP check, the test is probably overkill.

@cpuguy83
cpuguy83 dismissed their stale review September 22, 2026 23:13

Intended to hit 'request changes'.

Copilot AI review requested due to automatic review settings September 22, 2026 23:28
@liunan-ms
liunan-ms force-pushed the liunan/cri-wrapped-enotsup-relabel branch from 543ced4 to 1432576 Compare September 22, 2026 23:28
@kubernetes-prow kubernetes-prow Bot added size/XS and removed size/M labels Sep 22, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Add the missing regression tests and address the Windows cross-platform build failure.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity

Open (1)

Comment thread internal/cri/opts/spec_linux_opts.go Resolved
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]>
@liunan-ms
liunan-ms force-pushed the liunan/cri-wrapped-enotsup-relabel branch from 1432576 to f42cf45 Compare September 22, 2026 23:33
@github-project-automation github-project-automation Bot moved this from Needs Triage to Review In Progress in Pull Request Review Sep 23, 2026
@estesp
estesp added this pull request to the merge queue Sep 23, 2026
Merged via the queue into containerd:main with commit 9eb6daf Sep 23, 2026
55 checks passed
@github-project-automation github-project-automation Bot moved this from Review In Progress to Done in Pull Request Review Sep 23, 2026
@cpuguy83

Copy link
Copy Markdown
Member

/cherry-pick release/2.4
/cherry-pick release/2.3
/cherry-pick release/2.2

@k8s-infra-cherrypick-robot

Copy link
Copy Markdown

@cpuguy83: new pull request created: #14210

Details

In response to this:

/cherry-pick release/2.4
/cherry-pick release/2.3
/cherry-pick release/2.2

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.

@k8s-infra-cherrypick-robot

Copy link
Copy Markdown

@cpuguy83: new pull request created: #14211

Details

In response to this:

/cherry-pick release/2.4
/cherry-pick release/2.3
/cherry-pick release/2.2

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.

@k8s-infra-cherrypick-robot

Copy link
Copy Markdown

@cpuguy83: new pull request created: #14212

Details

In response to this:

/cherry-pick release/2.4
/cherry-pick release/2.3
/cherry-pick release/2.2

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.

@samuelkarp samuelkarp added cherry-pick/2.2.x Change to be cherry picked to release/2.2 branch cherry-pick/2.3.x Change to be cherry picked to release/2.3 cherry-picked/2.4.x PR commits are cherry picked into release/2.4 branch cherry-picked/2.3.x PR commits are cherry picked into release/2.3 branch cherry-picked/2.2.x PR commits are cherry-picked into release/2.2 branch and removed cherry-pick/2.3.x Change to be cherry picked to release/2.3 cherry-pick/2.2.x Change to be cherry picked to release/2.2 branch labels Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-picked/2.2.x PR commits are cherry-picked into release/2.2 branch cherry-picked/2.3.x PR commits are cherry picked into release/2.3 branch cherry-picked/2.4.x PR commits are cherry picked into release/2.4 branch size/XS

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

6 participants