libct/specconv: use maps.Clone

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin
2025-03-28 18:47:56 -07:00
parent 7a58d8231f
commit 0fc2338d59
+2 -5
View File
@@ -5,6 +5,7 @@ package specconv
import (
"errors"
"fmt"
"maps"
"os"
"path/filepath"
"sort"
@@ -916,11 +917,7 @@ func CreateCgroupConfig(opts *CreateOpts, defaultDevs []*devices.Device) (*cgrou
}
}
if len(r.Unified) > 0 {
// copy the map
c.Resources.Unified = make(map[string]string, len(r.Unified))
for k, v := range r.Unified {
c.Resources.Unified[k] = v
}
c.Resources.Unified = maps.Clone(r.Unified)
}
}
}