Skip to content

Commit

Permalink
UPSTREAM: <carry>: kubelet/cm: use MkdirAll when creating cpuset to i…
Browse files Browse the repository at this point in the history
…gnore file exists error

Signed-off-by: Peter Hunt <pehunt@redhat.com>
  • Loading branch information
haircommander authored and soltysh committed Nov 3, 2023
1 parent 8640cb2 commit 6100405
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/kubelet/cm/cgroup_manager_linux.go
Expand Up @@ -476,7 +476,7 @@ func (m *cgroupManagerImpl) Create(cgroupConfig *CgroupConfig) error {
if path == "" {
return fmt.Errorf("Failed to find cpuset for newly created cgroup")
}
if err := os.Mkdir(path, 0o755); err != nil && !os.IsNotExist(err) {
if err := os.MkdirAll(path, 0o755); err != nil {
return fmt.Errorf("failed to create cpuset for newly created cgroup: %w", err)
}
if err := cgroups.WriteFile(path, "cpuset.sched_load_balance", "0"); err != nil {
Expand Down

0 comments on commit 6100405

Please sign in to comment.