Skip to content

Commit

Permalink
fix sealos will not use local images if there is a newer one remote (#…
Browse files Browse the repository at this point in the history
…1689)

[fix]only support buildah sdk

Signed-off-by: yyf1986 <[email protected]>

* [fix]only support buildah sdk,delete binary support code

Signed-off-by: yyf1986 <[email protected]>

Signed-off-by: yyf1986 <[email protected]>
Co-authored-by: yyf1986 <[email protected]>
  • Loading branch information
yyf1986 and yyf1986 authored Sep 5, 2022
1 parent 6f222ca commit 617e877
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 342 deletions.
112 changes: 0 additions & 112 deletions pkg/image/binary/cluster.go

This file was deleted.

159 changes: 0 additions & 159 deletions pkg/image/binary/image.go

This file was deleted.

51 changes: 0 additions & 51 deletions pkg/image/binary/registry.go

This file was deleted.

13 changes: 6 additions & 7 deletions pkg/image/buildah.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,24 @@ package image
import (
"github.com/pkg/errors"

"github.com/labring/sealos/pkg/utils/exec"
fileutil "github.com/labring/sealos/pkg/utils/file"
)

func initBuildah() (bool, error) {
func initBuildah() error {
err := buildahPolicySync()
if err != nil {
return false, errors.New("create policy.json failed")
return errors.New("create policy.json failed")
}
err = buildahStorageSync()
if err != nil {
return false, errors.New("create storage config failed")
return errors.New("create storage config failed")
}
err = buildahRegistrySync()
if err != nil {
return false, errors.New("create registry config failed")
return errors.New("create registry config failed")
}
_, ok := exec.CheckCmdIsExist("buildah")
return ok, nil
//_, ok := exec.CheckCmdIsExist("buildah")
return nil
}

func buildahPolicySync() error {
Expand Down
3 changes: 2 additions & 1 deletion pkg/image/buildah/registry/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (

"github.com/containers/buildah"
"github.com/containers/buildah/define"
"github.com/containers/buildah/pkg/parse"
"github.com/containers/common/pkg/auth"
"github.com/pkg/errors"
)
Expand Down Expand Up @@ -64,7 +65,7 @@ func (*Service) Pull(images ...string) error {
return err
}

systemContext, _ := getSystemContext(opt.tlsVerify)
systemContext, _ := parse.SystemContextFromOptions(getCmdFlag())

decConfig, err := getDecryptConfig(opt.decryptionKeys)
if err != nil {
Expand Down
Loading

0 comments on commit 617e877

Please sign in to comment.