Repository navigation
Conversation
There was a problem hiding this comment.
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/selinuxto v1.14.1 (including API additions/deprecations and internal refactors). - CRI SELinux label store updated to use
ReserveLabelV2and 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
Reservenow returns an error ifReserverfails, but there isn’t a test asserting that behavior (and thatlevelsis 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.
| @@ -50,7 +50,9 @@ func (c *criService) initPlatform() (err error) { | |||
| log.L.Warn("Selinux is not supported") | |||
| } | |||
| if r := c.config.SelinuxCategoryRange; r > 0 { | |||
There was a problem hiding this comment.
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.
|
Failure looks legit; |
Switch away from deprecated functionality. Signed-off-by: Kir Kolyshkin <[email protected]>
|
Rebased; fixed most review comments. |
|
Carrying this one in #13395 |
Switch away from deprecated functionality.