mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-13 11:25:19 +00:00
Merge pull request #26029 from luxas/mkdir_all
kubelet: Use MkdirAll instead of Mkdir
This commit is contained in:
@@ -25,7 +25,7 @@ import (
|
||||
// OSInterface collects system level operations that need to be mocked out
|
||||
// during tests.
|
||||
type OSInterface interface {
|
||||
Mkdir(path string, perm os.FileMode) error
|
||||
MkdirAll(path string, perm os.FileMode) error
|
||||
Symlink(oldname string, newname string) error
|
||||
Stat(path string) (os.FileInfo, error)
|
||||
Remove(path string) error
|
||||
@@ -40,8 +40,8 @@ type OSInterface interface {
|
||||
type RealOS struct{}
|
||||
|
||||
// MkDir will will call os.Mkdir to create a directory.
|
||||
func (RealOS) Mkdir(path string, perm os.FileMode) error {
|
||||
return os.Mkdir(path, perm)
|
||||
func (RealOS) MkdirAll(path string, perm os.FileMode) error {
|
||||
return os.MkdirAll(path, perm)
|
||||
}
|
||||
|
||||
// Symlink will call os.Symlink to create a symbolic link.
|
||||
|
||||
@@ -41,7 +41,7 @@ func NewFakeOS() *FakeOS {
|
||||
}
|
||||
|
||||
// Mkdir is a fake call that just returns nil.
|
||||
func (FakeOS) Mkdir(path string, perm os.FileMode) error {
|
||||
func (FakeOS) MkdirAll(path string, perm os.FileMode) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user