Skip to content

Commit

Permalink
Merge pull request containers#2913 from rhatdan/overlay
Browse files Browse the repository at this point in the history
If destination does not exists, do not throw error
  • Loading branch information
openshift-merge-robot authored Jan 15, 2021
2 parents f17ccd0 + 0fcc8ff commit d10dbf3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/overlay/overlay.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,12 @@ func mountHelper(contentDir, source, dest string, _, _ int, graphOptions []strin
workDir := filepath.Join(contentDir, "work")
upperDir := filepath.Join(contentDir, "upper")
st, err := os.Stat(dest)
if err != nil {
return mount, err
if err == nil {
if err := os.Chmod(upperDir, st.Mode()); err != nil {
return mount, err
}
}
if err := os.Chmod(upperDir, st.Mode()); err != nil {
if !os.IsNotExist(err) {
return mount, err
}
overlayOptions = fmt.Sprintf("lowerdir=%s,upperdir=%s,workdir=%s,private", source, upperDir, workDir)
Expand Down

0 comments on commit d10dbf3

Please sign in to comment.