mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-20 17:49:10 +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:
parent
aef63caa36
commit
f021bb8aaa
@ -1,4 +1,4 @@
|
||||
FROM linuxkit/alpine:9bcf61f605ef0ce36cc94d59b8eac307862de6e1 AS mirror
|
||||
FROM linuxkit/alpine:2e362f4459ba4491655061cccdd2fcc7a2de5eb3 AS mirror
|
||||
|
||||
RUN apk add --no-cache go musl-dev
|
||||
ENV GOPATH=/go PATH=$PATH:/go/bin
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user