Create site overlay directory
-Fixes: #1690 Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
committed by
Christian Goll
parent
5517a26c6f
commit
38791c74ad
@@ -4,6 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/containers/storage/drivers/copy"
|
||||
@@ -67,6 +68,11 @@ func (overlay Overlay) CloneSiteOverlay() (siteOverlay Overlay, err error) {
|
||||
if siteOverlay.Exists() {
|
||||
return siteOverlay, fmt.Errorf("site overlay already exists: %s", siteOverlay.Name())
|
||||
}
|
||||
if !util.IsDir(filepath.Dir(overlay.Path())) {
|
||||
if err := os.MkdirAll(filepath.Dir(overlay.Path()), 0755); err != nil {
|
||||
return siteOverlay, err
|
||||
}
|
||||
}
|
||||
err = copy.DirCopy(overlay.Path(), siteOverlay.Path(), copy.Content, true)
|
||||
return siteOverlay, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user