Skip to content

Commit

Permalink
integrate buildah
Browse files Browse the repository at this point in the history
Signed-off-by: david.bao <[email protected]>
  • Loading branch information
justadogistaken committed Aug 13, 2022
1 parent 2a89fa5 commit 131b45b
Show file tree
Hide file tree
Showing 2,621 changed files with 342,127 additions and 18,816 deletions.
1 change: 0 additions & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ on:
branches: "*"
paths-ignore:
- 'docs/**'
- 'vendor/**'
- '*.md'
- '*.yml'
jobs:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ jobs:
uses: actions/setup-go@v2
with:
go-version: '1.16'

- name: Install deps
run: |
sudo apt-get install -y libgpgme-dev libbtrfs-dev libdevmapper-dev
- name: Set env
shell: bash
env:
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ Here are some dependents with specific version:

* golang : v1.14
* golangci-lint: 1.39.0
* gpgme(brew install gpgme)

When you develop the Sealer project at the local environment, you should use subcommands of Makefile to help yourself to check and build the latest version of Sealer. For the convenience of developers, we use the docker to build Sealer. It can reduce problems of the developing environment.

Expand Down
31 changes: 12 additions & 19 deletions apply/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,17 @@ package apply

import (
"fmt"

common2 "github.com/sealerio/sealer/pkg/define/options"

"os"
"path/filepath"

"github.com/sealerio/sealer/apply/driver"
"github.com/sealerio/sealer/common"
"github.com/sealerio/sealer/pkg/clusterfile"
"github.com/sealerio/sealer/pkg/filesystem"
"github.com/sealerio/sealer/pkg/image"
"github.com/sealerio/sealer/pkg/image/store"
"github.com/sealerio/sealer/pkg/imageengine"
v2 "github.com/sealerio/sealer/types/api/v2"
)

Expand Down Expand Up @@ -57,24 +59,22 @@ func NewApplierFromFile(path string) (driver.Interface, error) {
}
path = filepath.Join(pa, path)
}

Clusterfile, err := clusterfile.NewClusterFile(path)
if err != nil {
return nil, err
}
imgSvc, err := image.NewImageService()
if err != nil {
return nil, err
}

mounter, err := filesystem.NewClusterImageMounter()
imageEngine, err := imageengine.NewImageEngine(common2.EngineGlobalConfigurations{})
if err != nil {
return nil, err
}

is, err := store.NewDefaultImageStore()
mounter, err := filesystem.NewClusterImageMounter(imageEngine)
if err != nil {
return nil, err
}

cluster := Clusterfile.GetCluster()
if cluster.Name == "" {
return nil, fmt.Errorf("cluster name cannot be empty, make sure %s file is correct", path)
Expand All @@ -85,9 +85,8 @@ func NewApplierFromFile(path string) (driver.Interface, error) {
return &driver.Applier{
ClusterDesired: &cluster,
ClusterFile: Clusterfile,
ImageManager: imgSvc,
ImageEngine: imageEngine,
ClusterImageMounter: mounter,
ImageStore: is,
}, nil
}

Expand All @@ -102,25 +101,19 @@ func NewDefaultApplier(cluster *v2.Cluster) (driver.Interface, error) {
if cluster.Name == "" {
return nil, fmt.Errorf("cluster name cannot be empty")
}
imgSvc, err := image.NewImageService()
if err != nil {
return nil, err
}

mounter, err := filesystem.NewClusterImageMounter()
imageEngine, err := imageengine.NewImageEngine(common2.EngineGlobalConfigurations{})
if err != nil {
return nil, err
}

is, err := store.NewDefaultImageStore()
mounter, err := filesystem.NewClusterImageMounter(imageEngine)
if err != nil {
return nil, err
}

return &driver.Applier{
ClusterDesired: cluster,
ImageManager: imgSvc,
ImageEngine: imageEngine,
ClusterImageMounter: mounter,
ImageStore: is,
}, nil
}
Loading

0 comments on commit 131b45b

Please sign in to comment.