Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion libcontainer/configs/cgroup_deprecated.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package configs // Deprecated: use [github.com/opencontainers/cgroups].
package configs

import "github.com/opencontainers/cgroups"

// Deprecated: use [github.com/opencontainers/cgroups].
type (
Cgroup = cgroups.Cgroup
Resources = cgroups.Resources
Expand All @@ -14,12 +15,14 @@ type (
IfPrioMap = cgroups.IfPrioMap
)

// Deprecated: use [github.com/opencontainers/cgroups].
const (
Undefined = cgroups.Undefined
Frozen = cgroups.Frozen
Thawed = cgroups.Thawed
)

// Deprecated: use [github.com/opencontainers/cgroups].
var (
NewWeightDevice = cgroups.NewWeightDevice
NewThrottleDevice = cgroups.NewThrottleDevice
Expand Down
7 changes: 5 additions & 2 deletions libcontainer/configs/config.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Package configs provides various container-related configuration types
// used by libcontainer.
package configs

import (
Expand All @@ -14,6 +16,7 @@ import (
"github.com/sirupsen/logrus"
"golang.org/x/sys/unix"

"github.com/opencontainers/cgroups"
devices "github.com/opencontainers/cgroups/devices/config"
"github.com/opencontainers/runtime-spec/specs-go"
)
Expand Down Expand Up @@ -143,7 +146,7 @@ type Config struct {

// Cgroups specifies specific cgroup settings for the various subsystems that the container is
// placed into to limit the resources the container has available.
Cgroups *Cgroup `json:"cgroups"`
Cgroups *cgroups.Cgroup `json:"cgroups"`
Copy link
Member

Choose a reason for hiding this comment

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

Do we want to keep the Cgroup type on this package, then?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we want to keep the Cgroup type on this package, then?

I think we do. There are libcontainer users who might need time to switch to opencontainers/cgroups properly.

Now, Cgroup is (now) clearly marked as deprecated, hinting that they should switch, and by not removing it we're giving users time to do so.


// AppArmorProfile specifies the profile to apply to the process running in the container and is
// change at the time the process is executed.
Expand Down Expand Up @@ -456,7 +459,7 @@ type Capabilities struct {
Ambient []string `json:"Ambient,omitempty"`
}

// Deprecated: use (Hooks).Run instead.
// Deprecated: use [Hooks.Run] instead.
func (hooks HookList) RunHooks(state *specs.State) error {
for i, h := range hooks {
if err := h.Run(state); err != nil {
Expand Down