Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump cgroups and containernetworking/plugins version #3903

Merged
merged 1 commit into from
Sep 25, 2023
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
2 changes: 1 addition & 1 deletion agent/config/config_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package config

import (
"github.com/containerd/cgroups"
"github.com/containerd/cgroups/v3"
)

func init() {
Expand Down
2 changes: 1 addition & 1 deletion agent/engine/engine_unix_integ_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import (
"github.com/aws/amazon-ecs-agent/ecs-agent/utils/ttime"
"github.com/aws/aws-sdk-go/aws"

"github.com/containerd/cgroups"
"github.com/containerd/cgroups/v3"
sdkClient "github.com/docker/docker/client"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down
4 changes: 2 additions & 2 deletions agent/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ require (
github.com/aws/aws-sdk-go v1.36.0
github.com/awslabs/go-config-generator-for-fluentd-and-fluentbit v0.0.0-20210308162251-8959c62cb8f9
github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575
github.com/containerd/cgroups v1.0.4
github.com/containerd/cgroups/v3 v3.0.2
github.com/containernetworking/cni v1.1.2
github.com/containernetworking/plugins v0.9.1
github.com/containernetworking/plugins v1.1.1
github.com/deniswernert/udev v0.0.0-20170418162847-a12666f7b5a1
github.com/docker/docker v20.10.24+incompatible
github.com/docker/go-connections v0.4.0
Expand Down
7 changes: 4 additions & 3 deletions agent/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ github.com/containerd/cgroups v0.0.0-20200710171044-318312a37340/go.mod h1:s5q4S
github.com/containerd/cgroups v0.0.0-20200824123100-0b889c03f102/go.mod h1:s5q4SojHctfxANBDvMeIaIovkq29IP48TKAxnhYRxvo=
github.com/containerd/cgroups v0.0.0-20210114181951-8a68de567b68/go.mod h1:ZJeTFisyysqgcCdecO57Dj79RfL0LNeGiFUqLYQRYLE=
github.com/containerd/cgroups v1.0.1/go.mod h1:0SJrPIenamHDcZhEcJMNBB85rHcUsw4f25ZfBiPYRkU=
github.com/containerd/cgroups v1.0.4 h1:jN/mbWBEaz+T1pi5OFtnkQ+8qnmEbAr1Oo1FRm5B0dA=
github.com/containerd/cgroups v1.0.4/go.mod h1:nLNQtsF7Sl2HxNebu77i1R0oDlhiTG+kO4JTrUzo6IA=
github.com/containerd/cgroups/v3 v3.0.2 h1:f5WFqIVSgo5IZmtTT3qVBo6TzI1ON6sycSBKkymb9L0=
github.com/containerd/cgroups/v3 v3.0.2/go.mod h1:JUgITrzdFqp42uI2ryGA+ge0ap/nxzYgkGmIcetmErE=
github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw=
github.com/containerd/console v0.0.0-20181022165439-0650fd9eeb50/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw=
github.com/containerd/console v0.0.0-20191206165004-02ecf6a7291e/go.mod h1:8Pf4gM6VEbTNRIT26AyyU7hxdQU3MvAvxVI0sc00XBE=
Expand Down Expand Up @@ -208,8 +208,9 @@ github.com/containernetworking/cni v0.8.1/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ
github.com/containernetworking/cni v1.1.2 h1:wtRGZVv7olUHMOqouPpn3cXJWpJgM6+EUl31EQbXALQ=
github.com/containernetworking/cni v1.1.2/go.mod h1:sDpYKmGVENF3s6uvMvGgldDWeG8dMxakj/u+i9ht9vw=
github.com/containernetworking/plugins v0.8.6/go.mod h1:qnw5mN19D8fIwkqW7oHHYDHVlzhJpcY6TQxn/fUyDDM=
github.com/containernetworking/plugins v0.9.1 h1:FD1tADPls2EEi3flPc2OegIY1M9pUa9r2Quag7HMLV8=
github.com/containernetworking/plugins v0.9.1/go.mod h1:xP/idU2ldlzN6m4p5LmGiwRDjeJr6FLK6vuiUwoH7P8=
github.com/containernetworking/plugins v1.1.1 h1:+AGfFigZ5TiQH00vhR8qPeSatj53eNGz0C1d3wVYlHE=
github.com/containernetworking/plugins v1.1.1/go.mod h1:Sr5TH/eBsGLXK/h71HeLfX19sZPp3ry5uHSkI4LPxV8=
github.com/containers/ocicrypt v1.0.1/go.mod h1:MeJDzk1RJHv89LjsH0Sp5KTY3ZYkjXO/C+bKAeWFIrc=
github.com/containers/ocicrypt v1.1.0/go.mod h1:b8AOe0YR67uU8OqfVNcznfFpAzu3rdgUV4GP9qXPfu4=
github.com/containers/ocicrypt v1.1.1/go.mod h1:Dm55fwWm1YZAjYRaJ94z2mfZikIyIN4B0oB3dj3jFxY=
Expand Down
6 changes: 3 additions & 3 deletions agent/taskresource/cgroup/cgroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ import (
"github.com/aws/amazon-ecs-agent/agent/api/task/status"
"github.com/aws/amazon-ecs-agent/agent/config"
"github.com/aws/amazon-ecs-agent/agent/taskresource"
control "github.com/aws/amazon-ecs-agent/agent/taskresource/cgroup/control"
"github.com/aws/amazon-ecs-agent/agent/taskresource/cgroup/control"
resourcestatus "github.com/aws/amazon-ecs-agent/agent/taskresource/status"
"github.com/aws/amazon-ecs-agent/agent/utils/ioutilwrapper"
"github.com/cihub/seelog"
"github.com/containerd/cgroups"
specs "github.com/opencontainers/runtime-spec/specs-go"
cgroups "github.com/containerd/cgroups/v3/cgroup1"
"github.com/opencontainers/runtime-spec/specs-go"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion agent/taskresource/cgroup/cgroup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"github.com/aws/amazon-ecs-agent/agent/taskresource/cgroup/control/mock_control"
resourcestatus "github.com/aws/amazon-ecs-agent/agent/taskresource/status"
mock_ioutilwrapper "github.com/aws/amazon-ecs-agent/agent/utils/ioutilwrapper/mocks"
"github.com/containerd/cgroups"
cgroups "github.com/containerd/cgroups/v3/cgroup1"
specs "github.com/opencontainers/runtime-spec/specs-go"
"github.com/stretchr/testify/assert"

Expand Down
12 changes: 6 additions & 6 deletions agent/taskresource/cgroup/control/cgroup_controller_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import (

"github.com/aws/amazon-ecs-agent/agent/config"
"github.com/aws/amazon-ecs-agent/agent/taskresource/cgroup/control/factory"
specs "github.com/opencontainers/runtime-spec/specs-go"
"github.com/opencontainers/runtime-spec/specs-go"

"github.com/cihub/seelog"
"github.com/containerd/cgroups"
cgroups "github.com/containerd/cgroups/v3/cgroup1"
"github.com/pkg/errors"
)

Expand Down Expand Up @@ -57,7 +57,7 @@ func (c *control) Create(cgroupSpec *Spec) error {
}

seelog.Debugf("Creating cgroup cgroupPath=%s", cgroupSpec.Root)
_, err = c.New(cgroups.V1, cgroups.StaticPath(cgroupSpec.Root), cgroupSpec.Specs)
_, err = c.New(cgroups.Default, cgroups.StaticPath(cgroupSpec.Root), cgroupSpec.Specs)
if err != nil {
return fmt.Errorf("cgroup create: unable to create controller: v1: %s", err)
}
Expand All @@ -69,7 +69,7 @@ func (c *control) Create(cgroupSpec *Spec) error {
func (c *control) Remove(cgroupPath string) error {
seelog.Debugf("Removing cgroup cgroupPath=%s", cgroupPath)

controller, err := c.Load(cgroups.V1, cgroups.StaticPath(cgroupPath))
controller, err := c.Load(cgroups.Default, cgroups.StaticPath(cgroupPath))
if err != nil {
// use the %w verb to wrap the error to be unwrapped by errors.Is()
return fmt.Errorf("cgroup remove: unable to obtain controller: %w", err)
Expand All @@ -87,15 +87,15 @@ func (c *control) Remove(cgroupPath string) error {
func (c *control) Exists(cgroupPath string) bool {
seelog.Debugf("Checking existence of cgroup cgroupPath=%s", cgroupPath)

controller, err := c.Load(cgroups.V1, cgroups.StaticPath(cgroupPath))
controller, err := c.Load(cgroups.Default, cgroups.StaticPath(cgroupPath))
if err != nil || controller == nil {
return false
}

return true
}

// Init is used to setup the cgroup root for ecs
// Init is used to set up the cgroup root for ecs
func (c *control) Init() error {
seelog.Debugf("Creating root ecs cgroup cgroupPath=%s", config.DefaultTaskCgroupV1Prefix)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (

"github.com/aws/amazon-ecs-agent/agent/config"
"github.com/cihub/seelog"
cgroupsv2 "github.com/containerd/cgroups/v2"
cgroupsv2 "github.com/containerd/cgroups/v3/cgroup2"
)

const (
Expand Down
8 changes: 4 additions & 4 deletions agent/taskresource/cgroup/control/factory/factory_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
package factory

import (
"github.com/containerd/cgroups"
specs "github.com/opencontainers/runtime-spec/specs-go"
cgroups "github.com/containerd/cgroups/v3/cgroup1"
"github.com/opencontainers/runtime-spec/specs-go"
)

// CgroupFactory wraps around the global functions exposed by the cgroups library
Expand All @@ -34,10 +34,10 @@ type GlobalCgroupFactory struct{}

// Load is used to load the cgroup hierarchy based off the cgroup path
func (c *GlobalCgroupFactory) Load(hierarchy cgroups.Hierarchy, path cgroups.Path) (cgroups.Cgroup, error) {
return cgroups.Load(hierarchy, path)
return cgroups.Load(path, cgroups.WithHiearchy(hierarchy))
}

// New is used to create a new cgroup hierarchy
func (c *GlobalCgroupFactory) New(hierarchy cgroups.Hierarchy, path cgroups.Path, specs *specs.LinuxResources) (cgroups.Cgroup, error) {
return cgroups.New(hierarchy, path, specs)
return cgroups.New(path, specs, cgroups.WithHiearchy(hierarchy))
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@

package factory

//go:generate mockgen -destination=mock/mock_cgroups_linux.go -copyright_file=../../../../../scripts/copyright_file github.com/containerd/cgroups Cgroup
//go:generate mockgen -destination=mock/mock_cgroups_linux.go -copyright_file=../../../../../scripts/copyright_file github.com/containerd/cgroups/v3/cgroup1 Cgroup
//go:generate mockgen -destination=mock_factory/mock_cgroup_factory_linux.go -copyright_file=../../../../../scripts/copyright_file github.com/aws/amazon-ecs-agent/agent/taskresource/cgroup/control/factory CgroupFactory

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 0 additions & 46 deletions agent/vendor/github.com/containerd/cgroups/Protobuild.toml

This file was deleted.

Loading