Skip to content

Commit 64c886a

Browse files
committed
Remove AddPid and simplify cgroups.AvailableControllers
Signed-off-by: Lokesh Mandvekar <[email protected]>
1 parent af91cae commit 64c886a

File tree

19 files changed

+129
-756
lines changed

19 files changed

+129
-756
lines changed

go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,3 +195,5 @@ require (
195195
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
196196
tags.cncf.io/container-device-interface/specs-go v1.0.0 // indirect
197197
)
198+
199+
replace go.podman.io/common => github.com/lsm5/container-libs/common v0.0.0-20251117194759-eef88fc173c9

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,8 @@ github.com/letsencrypt/boulder v0.0.0-20240620165639-de9c06129bec h1:2tTW6cDth2T
239239
github.com/letsencrypt/boulder v0.0.0-20240620165639-de9c06129bec/go.mod h1:TmwEoGCwIti7BCeJ9hescZgRtatxRE+A72pCoPfmcfk=
240240
github.com/linuxkit/virtsock v0.0.0-20241009230534-cb6a20cc0422 h1:XvRuyDDRvi+UDxHN/M4MW4HxjmNVMmUKQj/+AbgsYgk=
241241
github.com/linuxkit/virtsock v0.0.0-20241009230534-cb6a20cc0422/go.mod h1:JLgfq4XMVbvfNlAXla/41lZnp21O72a/wWHGJefAvgQ=
242+
github.com/lsm5/container-libs/common v0.0.0-20251117194759-eef88fc173c9 h1:50qNXd+OHTiRBJMADHmnZZbQ0gTTqNSW8GhSe0TEH/0=
243+
github.com/lsm5/container-libs/common v0.0.0-20251117194759-eef88fc173c9/go.mod h1:bWMkqGUJlUwDYe29T0L191jJY0XQZSRVzL+85kI/nd8=
242244
github.com/lufia/plan9stats v0.0.0-20240909124753-873cd0166683 h1:7UMa6KCCMjZEMDtTVdcGu0B1GmmC7QJKiCCjyTAWQy0=
243245
github.com/lufia/plan9stats v0.0.0-20240909124753-873cd0166683/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k=
244246
github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA=
@@ -471,8 +473,6 @@ go.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJr
471473
go.opentelemetry.io/otel/trace v1.38.0/go.mod h1:j1P9ivuFsTceSWe1oY+EeW3sc+Pp42sO++GHkg4wwhs=
472474
go.opentelemetry.io/proto/otlp v1.5.0 h1:xJvq7gMzB31/d406fB8U5CBdyQGw4P399D1aQWU/3i4=
473475
go.opentelemetry.io/proto/otlp v1.5.0/go.mod h1:keN8WnHxOy8PG0rQZjJJ5A2ebUoafqWp0eVQ4yIXvJ4=
474-
go.podman.io/common v0.66.1-0.20251112195944-4afce3558e66 h1:C0U9hTxFs0cG6dWb1u7/IFwv2O7NEMivyPnqh/k/9Z8=
475-
go.podman.io/common v0.66.1-0.20251112195944-4afce3558e66/go.mod h1:H5zW6J35uvTzKtELI3lf4aj1QLxFY5wry/o78adU7+Q=
476476
go.podman.io/image/v5 v5.38.1-0.20251112195944-4afce3558e66 h1:YOTQaRJjUfS+LKrw31G7pF2oY/ReOV6n0fVZez5f0Ic=
477477
go.podman.io/image/v5 v5.38.1-0.20251112195944-4afce3558e66/go.mod h1:ycRSRkCZDb+EOojdmG67HARjAojZ/ERUNbFuORg3KZU=
478478
go.podman.io/storage v1.61.1-0.20251112195944-4afce3558e66 h1:u9vVRYZwZgPY8a/yxKTI4C3uwZHMa5GjXZEDHIwe9P4=

libpod/info_linux.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func (r *Runtime) setPlatformHostInfo(info *define.HostInfo) error {
3333
// Get Map of all available controllers
3434
// FIXME: AvailableControllers should be further simplified once CGv1 removal
3535
// in container-libs is complete.
36-
availableControllers, err := cgroups.AvailableControllers(nil, true)
36+
availableControllers, err := cgroups.AvailableControllers()
3737
if err != nil {
3838
return fmt.Errorf("getting available cgroup controllers: %w", err)
3939
}

libpod/oci_conmon_linux.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -216,13 +216,9 @@ func (r *ConmonOCIRuntime) moveConmonToCgroupAndSignal(ctr *Container, cmd *exec
216216
logrus.StandardLogger().Logf(logLevel, "Failed to add conmon to systemd sandbox cgroup: %v", err)
217217
}
218218
} else {
219-
control, err := cgroups.New(cgroupPath, &cgroupResources)
219+
_, err := cgroups.New(cgroupPath, &cgroupResources)
220220
if err != nil {
221221
logrus.StandardLogger().Logf(logLevel, "Failed to add conmon to cgroupfs sandbox cgroup: %v", err)
222-
} else if err := control.AddPid(cmd.Process.Pid); err != nil {
223-
// we need to remove this defer and delete the cgroup once conmon exits
224-
// maybe need a conmon monitor?
225-
logrus.StandardLogger().Logf(logLevel, "Failed to add conmon to cgroupfs sandbox cgroup: %v", err)
226222
}
227223
}
228224
}

vendor/go.podman.io/common/pkg/cgroups/blkio_linux.go

Lines changed: 29 additions & 102 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)