mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-30 23:37:45 +00:00
cgroups: Fix "." parent cgroup special case
ef642fe890
added a special case to avoid
moving cgroups that are on the "default" slice in case of deletion.
However, this special check should be done in the Parent() method
instead, which ensures that the default resource controller ID is
returned, instead of ".".
Fixes: #11599
Signed-off-by: Fabiano Fidêncio <fidencio@northflank.com>
This commit is contained in:
parent
63f6dcdeb9
commit
08d2ba1969
@ -31,7 +31,7 @@ const (
|
||||
)
|
||||
|
||||
func RenameCgroupPath(path string) (string, error) {
|
||||
if path == "" {
|
||||
if path == "" || path == "." {
|
||||
path = DefaultResourceControllerID
|
||||
}
|
||||
|
||||
|
@ -2546,10 +2546,8 @@ func (s *Sandbox) resourceControllerDelete() error {
|
||||
}
|
||||
|
||||
resCtrlParent := sandboxController.Parent()
|
||||
if resCtrlParent != "." {
|
||||
if err := sandboxController.MoveTo(resCtrlParent); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := sandboxController.MoveTo(resCtrlParent); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := sandboxController.Delete(); err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user