Skip to content

Commit

Permalink
overlay: pass diffOutput to generateComposeFsBlob
Browse files Browse the repository at this point in the history
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
  • Loading branch information
giuseppe committed Jul 6, 2023
1 parent 4731f0f commit 4f9add7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion drivers/overlay/composefs_notsupported.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ package overlay

import (
"fmt"

graphdriver "github.com/containers/storage/drivers"
)

func composeFsSupported() bool {
return false
}

func generateComposeFsBlob(toc []byte, composefsDir string) error {
func generateComposeFsBlob(toc []byte, composefsDir string, diffOutput *graphdriver.DriverWithDifferOutput) error {
return fmt.Errorf("composefs is not supported")
}

Expand Down
3 changes: 2 additions & 1 deletion drivers/overlay/composefs_supported.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"syscall"
"unsafe"

graphdriver "github.com/containers/storage/drivers"
"github.com/containers/storage/pkg/loopback"
"github.com/sirupsen/logrus"
"golang.org/x/sys/unix"
Expand Down Expand Up @@ -79,7 +80,7 @@ func getErofsBlob(dataDir string) string {
return filepath.Join(dataDir, "erofs.blob")
}

func generateComposeFsBlob(toc []byte, composefsDir string) error {
func generateComposeFsBlob(toc []byte, composefsDir string, diffOutput *graphdriver.DriverWithDifferOutput) error {
_ = os.MkdirAll(composefsDir, 0o700)
destFile := getErofsBlob(composefsDir)
writerJson, err := getComposeFsHelper()
Expand Down
2 changes: 1 addition & 1 deletion drivers/overlay/overlay.go
Original file line number Diff line number Diff line change
Expand Up @@ -2070,7 +2070,7 @@ func (d *Driver) ApplyDiffFromStagingDirectory(id, parent, stagingDirectory stri
logrus.Warningf("%s", err)
}
toc := diffOutput.BigData[zstdChunkedManifest]
if err := generateComposeFsBlob(toc, d.getComposefsData(id)); err != nil {
if err := generateComposeFsBlob(toc, d.getComposefsData(id), diffOutput); err != nil {
return err
}
}
Expand Down

0 comments on commit 4f9add7

Please sign in to comment.