Skip to content

Commit

Permalink
Merge pull request #225 from yuchen0cc/main
Browse files Browse the repository at this point in the history
Exclude baselayer when using mkfs
  • Loading branch information
yuchen0cc authored Sep 14, 2023
2 parents e4cc3d9 + 50da921 commit 85d30e2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
10 changes: 7 additions & 3 deletions cmd/convertor/builder/overlaybd_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,12 @@ func NewOverlayBDBuilderEngine(base *builderEngineBase) builderEngine {
Lowers: []snapshot.OverlayBDBSConfigLower{},
ResultFile: "",
}
config.Lowers = append(config.Lowers, snapshot.OverlayBDBSConfigLower{
File: overlaybdBaseLayer,
})
if !base.mkfs {
config.Lowers = append(config.Lowers, snapshot.OverlayBDBSConfigLower{
File: overlaybdBaseLayer,
})
logrus.Infof("using default baselayer")
}

overlaybdLayers := make([]overlaybdConvertResult, len(base.manifest.Layers))

Expand Down Expand Up @@ -295,6 +298,7 @@ func (e *overlaybdBuilderEngine) create(ctx context.Context, dir string, mkfs bo
opts := []string{"-s", "64"}
if mkfs {
opts = append(opts, "--mkfs")
logrus.Infof("mkfs for baselayer")
}
return utils.Create(ctx, dir, opts...)
}
Expand Down
10 changes: 7 additions & 3 deletions cmd/convertor/builder/turboOCI_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (
"github.com/opencontainers/go-digest"
specs "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
)

const (
Expand Down Expand Up @@ -60,9 +61,12 @@ func NewTurboOCIBuilderEngine(base *builderEngineBase) builderEngine {
Lowers: []snapshot.OverlayBDBSConfigLower{},
ResultFile: "",
}
config.Lowers = append(config.Lowers, snapshot.OverlayBDBSConfigLower{
File: overlaybdBaseLayer,
})
if !base.mkfs {
config.Lowers = append(config.Lowers, snapshot.OverlayBDBSConfigLower{
File: overlaybdBaseLayer,
})
logrus.Infof("using default baselayer")
}
return &turboOCIBuilderEngine{
builderEngineBase: base,
overlaybdConfig: config,
Expand Down

0 comments on commit 85d30e2

Please sign in to comment.