Skip to content

Commit

Permalink
Bump cgroups and containernetworking/plugins version (#3903)
Browse files Browse the repository at this point in the history
  • Loading branch information
Realmonia committed Sep 25, 2023
1 parent 88efd34 commit 003edf0
Show file tree
Hide file tree
Showing 159 changed files with 19,376 additions and 16,982 deletions.
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 @@ -29,14 +29,14 @@ import (
apicontainer "github.com/aws/amazon-ecs-agent/agent/api/container"
"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"
apicontainerstatus "github.com/aws/amazon-ecs-agent/ecs-agent/api/container/status"
"github.com/aws/amazon-ecs-agent/ecs-agent/api/task/status"
"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

0 comments on commit 003edf0

Please sign in to comment.