mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-09-05 00:42:54 +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:
@@ -1,4 +1,4 @@
|
|||||||
FROM linuxkit/alpine:9bcf61f605ef0ce36cc94d59b8eac307862de6e1 AS mirror
|
FROM linuxkit/alpine:2e362f4459ba4491655061cccdd2fcc7a2de5eb3 AS mirror
|
||||||
|
|
||||||
RUN apk add --no-cache go musl-dev
|
RUN apk add --no-cache go musl-dev
|
||||||
ENV GOPATH=/go PATH=$PATH:/go/bin
|
ENV GOPATH=/go PATH=$PATH:/go/bin
|
||||||
|
@@ -70,7 +70,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
if !found {
|
if !found {
|
||||||
log.Printf("Trying CDROM")
|
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)
|
log.Printf("CDROM: Failed to create %s: %s", MountPoint, err)
|
||||||
goto ErrorOut
|
goto ErrorOut
|
||||||
}
|
}
|
||||||
@@ -157,7 +157,7 @@ func processUserData(data []byte) error {
|
|||||||
}
|
}
|
||||||
for d, val := range cm {
|
for d, val := range cm {
|
||||||
dir := path.Join(ConfigPath, d)
|
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)
|
log.Printf("Failed to create %s: %s", dir, err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user