Skip to content

deps: bump oc/selinux to v1.14.1 - #13392

Closed
kolyshkin wants to merge 1 commit into
containerd:mainfrom
kolyshkin:selinux
Closed

kolyshkin wants to merge 1 commit into
containerd:mainfrom
kolyshkin:selinux

Conversation

@kolyshkin

Copy link
Copy Markdown
Contributor

Switch away from deprecated functionality.

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.

Pull request overview

This PR bumps github.com/opencontainers/selinux to v1.14.1 (vendored) and updates containerd’s CRI integration to use the new/non-deprecated SELinux APIs (e.g., error-returning reserve calls and a setter for category range).

Changes:

  • Vendor update of github.com/opencontainers/selinux to v1.14.1 (including API additions/deprecations and internal refactors).
  • CRI SELinux label store updated to use ReserveLabelV2 and propagate reservation errors.
  • CRI platform init updated to set SELinux category range via selinux.SetCategoryRange.

Reviewed changes

Copilot reviewed 5 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
vendor/modules.txt Updates vendored module metadata for github.com/opencontainers/selinux v1.14.1.
vendor/github.com/opencontainers/selinux/pkg/pwalkdir/pwalkdir.go Vendor update: removes old build tags and updates worker loop style.
vendor/github.com/opencontainers/selinux/go-selinux/selinux.go Vendor update: adds SetCategoryRange, ReserveLabelV2, and other API changes/deprecations.
vendor/github.com/opencontainers/selinux/go-selinux/selinux_stub.go Vendor update: aligns stubs with new API signatures/behavior.
vendor/github.com/opencontainers/selinux/go-selinux/selinux_linux.go Vendor update: internal refactors, new parsing helpers, new seusers/failsafe_context logic, reservation changes.
vendor/github.com/opencontainers/selinux/go-selinux/label/label_stub.go Vendor update: removes legacy build tag line.
vendor/github.com/opencontainers/selinux/go-selinux/label/label_linux.go Vendor update: refactors option parsing and adopts ReserveLabelV2 behavior.
internal/cri/store/label/label.go Switches reserver to error-returning API and propagates errors to callers.
internal/cri/store/label/label_test.go Updates reserver mocks for new signature and adds an additional test.
internal/cri/seutil/seutil.go Switches from deprecated KVM label API to KVMContainerLabel() (error-returning).
internal/cri/server/service_linux.go Switches from deprecated global assignment to selinux.SetCategoryRange().
go.mod Bumps github.com/opencontainers/selinux dependency to v1.14.1.
go.sum Updates checksums for github.com/opencontainers/selinux v1.14.1.
Comments suppressed due to low confidence (1)

internal/cri/store/label/label.go:66

  • Reserve now returns an error if Reserver fails, but there isn’t a test asserting that behavior (and that levels is not incremented on failure). Add/extend a unit test to cover the new error path.
	}

	if _, ok := s.levels[level]; !ok {
		if err := s.Reserver(label); err != nil {
			return err
		}
	}

	s.levels[level]++
	return nil

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/cri/store/label/label.go Resolved
@@ -50,7 +50,9 @@ func (c *criService) initPlatform() (err error) {
log.L.Warn("Selinux is not supported")
}
if r := c.config.SelinuxCategoryRange; r > 0 {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is a pre-existing issue, and the change suggested could break some configurations.

In fact I'd rather deprecate c.config.SelinuxCategoryRange entirely as we can't set it to higher than 1024 anyway, and setting to lower values is rarely needed.

Comment thread internal/cri/store/label/label_test.go Resolved
@thaJeztah

Copy link
Copy Markdown
Member

Failure looks legit;

internal/cri/store/container/container.go:1: : # github.com/containerd/containerd/v2/internal/cri/store/container [github.com/containerd/containerd/v2/internal/cri/store/container.test]
  Error: internal/cri/store/container/container_test.go:168:22: cannot use func(label string) {…} (value of type func(label string)) as func(string) error value in assignment (typecheck)

Switch away from deprecated functionality.

Signed-off-by: Kir Kolyshkin <[email protected]>
Copilot AI review requested due to automatic review settings May 13, 2026 00:49
@kolyshkin

Copy link
Copy Markdown
Contributor Author

Rebased; fixed most review comments.

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.

Pull request overview

Copilot reviewed 6 out of 14 changed files in this pull request and generated no new comments.

@kolyshkin

Copy link
Copy Markdown
Contributor Author

Carrying this one in #13395

@kolyshkin kolyshkin closed this Jun 15, 2026
@github-project-automation github-project-automation Bot moved this from Needs Triage to Done in Pull Request Review Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants