Skip to content

oci: deprecate SetCapabilities, and some minor cleanups/fixes#50461

Merged
thaJeztah merged 3 commits intomoby:masterfrom
thaJeztah:oci_containerd
Jul 21, 2025
Merged

oci: deprecate SetCapabilities, and some minor cleanups/fixes#50461
thaJeztah merged 3 commits intomoby:masterfrom
thaJeztah:oci_containerd

Conversation

@thaJeztah
Copy link
Member

oci: sort defaultLinuxMaskedPaths

oci: fix godoc for SetCapabilities, TweakCapabilities

TweakCapabilities takes privileged into account, but SetCapabilities
does not, so fix the GoDoc.

oci: deprecate SetCapabilities

rewrite daemon.WithCapabilities using c8d's oci.WithCapabilities.

- Human readable description for the release notes

Go SDK: oci: deprecate SetCapabilities, and some minor cleanups/fixes

- A picture of a cute animal (not mandatory but encouraged)

@thaJeztah thaJeztah added this to the 29.0.0 milestone Jul 21, 2025
@thaJeztah thaJeztah added status/2-code-review impact/deprecation kind/refactor PR's that refactor, or clean-up code impact/go-sdk Noteworthy (compatibility changes) in the Go SDK area/go-sdk labels Jul 21, 2025
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
TweakCapabilities takes privileged into account, but SetCapabilities
does not, so fix the GoDoc.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
rewrite daemon.WithCapabilities using c8d's oci.WithCapabilities.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah merged commit 94866b1 into moby:master Jul 21, 2025
177 checks passed
@thaJeztah thaJeztah deleted the oci_containerd branch July 21, 2025 20:08
// capabilities in the basics capabilities list.
// capabilities in the basics capabilities list. All capabilities are added
// if privileged is true.
func TweakCapabilities(basics, adds, drops []string, privileged bool) ([]string, error) {
Copy link
Member Author

Choose a reason for hiding this comment

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

@austinvazquez We can probably reimplement this using WithXXX functions from containerd; there's some small bits that I think are missing;

  • I don't think containerd exposes the DefaultCapabilities
  • Containerd's code doesn't use ALL (for "all capabilities"), which we use to allow the user to specify "all" capabilities, except for XYZ.

I need to give it another look though, but would be nice if we could consume more of these options from containerd instead of replicating the same things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/go-sdk impact/deprecation impact/go-sdk Noteworthy (compatibility changes) in the Go SDK kind/refactor PR's that refactor, or clean-up code status/2-code-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants