mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-09-04 16:30:52 +00:00
pkg: In the metadata package, don't error if a dir exists
Use os.Mkdirall() instead of os.Mkdir() as it does not error if the path already exists. This enables specifying a default config file with the image and then over writing it with metadata. While at it, also update to the latest alpine base image. Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
This commit is contained in:
@@ -70,7 +70,7 @@ func main() {
|
||||
}
|
||||
if !found {
|
||||
log.Printf("Trying CDROM")
|
||||
if err := os.Mkdir(MountPoint, 0755); err != nil {
|
||||
if err := os.MkdirAll(MountPoint, 0755); err != nil {
|
||||
log.Printf("CDROM: Failed to create %s: %s", MountPoint, err)
|
||||
goto ErrorOut
|
||||
}
|
||||
@@ -157,7 +157,7 @@ func processUserData(data []byte) error {
|
||||
}
|
||||
for d, val := range cm {
|
||||
dir := path.Join(ConfigPath, d)
|
||||
if err := os.Mkdir(dir, 0755); err != nil {
|
||||
if err := os.MkdirAll(dir, 0755); err != nil {
|
||||
log.Printf("Failed to create %s: %s", dir, err)
|
||||
continue
|
||||
}
|
||||
|
Reference in New Issue
Block a user