Skip to content

Commit

Permalink
chore: fix audit issue
Browse files Browse the repository at this point in the history
  • Loading branch information
nixpig committed Dec 27, 2024
1 parent f09e0fb commit a31f9a1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cgroups/cgroupsv1.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,15 @@ func AddV1(
func DeleteV2(containerID string) error {
cg, err := cgroup2.LoadSystemd("/", fmt.Sprintf("%s.slice", containerID))
if err != nil {
return fmt.Errorf("load cgroups (id: %s): ", containerID, err)
return fmt.Errorf("load cgroups (id: %s): %w", containerID, err)
}

if err := cg.Kill(); err != nil {
return fmt.Errorf("kill cgroups processes (id: %s): %w", containerID, err)
}

if err := cg.DeleteSystemd(); err != nil {
return fmt.Errorf("delete cgroups (id: %s): %w", err)
return fmt.Errorf("delete cgroups (id: %s): %w", containerID, err)
}

return nil
Expand Down

0 comments on commit a31f9a1

Please sign in to comment.