Skip to content

Commit

Permalink
Merge pull request #1732 from sstosh/fix-image-store
Browse files Browse the repository at this point in the history
overlay: select additional image store path when using image store
  • Loading branch information
rhatdan committed Oct 18, 2023
2 parents 2cc7b10 + a5c8550 commit 8254d6f
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions drivers/overlay/overlay.go
Original file line number Diff line number Diff line change
Expand Up @@ -1003,8 +1003,10 @@ func (d *Driver) create(id, parent string, opts *graphdriver.CreateOpts, disable
}
}
if parent != "" {
parentBase, parentImageStore, _ := d.dir2(parent)
if parentImageStore != "" {
parentBase, parentImageStore, inAdditionalStore := d.dir2(parent)
// If parentBase path is additional image store, select the image contained in parentBase.
// See https://github.com/containers/podman/issues/19748
if parentImageStore != "" && !inAdditionalStore {
parentBase = parentImageStore
}
st, err := system.Stat(filepath.Join(parentBase, "diff"))
Expand Down Expand Up @@ -1079,12 +1081,13 @@ func (d *Driver) create(id, parent string, opts *graphdriver.CreateOpts, disable
}

if parent != "" {
parentDir, parentImageStore, _ := d.dir2(parent)
base := parentDir
if parentImageStore != "" {
base = parentImageStore
parentBase, parentImageStore, inAdditionalStore := d.dir2(parent)
// If parentBase path is additional image store, select the image contained in parentBase.
// See https://github.com/containers/podman/issues/19748
if parentImageStore != "" && !inAdditionalStore {
parentBase = parentImageStore
}
st, err := system.Stat(filepath.Join(base, "diff"))
st, err := system.Stat(filepath.Join(parentBase, "diff"))
if err != nil {
return err
}
Expand Down

0 comments on commit 8254d6f

Please sign in to comment.