@@ -22,6 +22,8 @@ import (
2222 "path/filepath"
2323 "strings"
2424
25+ "github.com/sirupsen/logrus"
26+
2527 reference2 "github.com/docker/distribution/reference"
2628 "github.com/pkg/errors"
2729 "golang.org/x/sync/errgroup"
@@ -32,6 +34,7 @@ import (
3234 "github.com/sealerio/sealer/pkg/define/application"
3335 v12 "github.com/sealerio/sealer/pkg/define/image/v1"
3436 "github.com/sealerio/sealer/pkg/image/save"
37+ "github.com/sealerio/sealer/pkg/image/types"
3538 "github.com/sealerio/sealer/pkg/rootfs"
3639 v1 "github.com/sealerio/sealer/types/api/v1"
3740 osi "github.com/sealerio/sealer/utils/os"
@@ -67,6 +70,13 @@ type Registry struct {
6770 puller save.ImageSave
6871}
6972
73+ func (r * Registry ) GetManifestList (image string ) (* types.ManifestList , error ) {
74+ // Implement the logic to get the manifest list for the given image
75+ return & types.ManifestList {
76+ Manifests : []types.Manifest {},
77+ }, nil
78+ }
79+
7080func NewRegistry (platform v1.Platform ) * Registry {
7181 ctx := context .Background ()
7282 return & Registry {
@@ -76,10 +86,6 @@ func NewRegistry(platform v1.Platform) *Registry {
7686}
7787
7888func (r * Registry ) SaveImages (rootfs string , containerImages []string ) error {
79- return r .puller .SaveImages (containerImages , filepath .Join (rootfs , common .RegistryDirName ), r .platform )
80- }
81-
82- func (r * Registry ) SaveRegistryImages (rootfs string , containerImages []string ) error {
8389 err := r .puller .SaveImages (containerImages , filepath .Join (rootfs , common .RegistryDirName ), r .platform )
8490 if err != nil {
8591 return err
@@ -99,7 +105,7 @@ func (r *Registry) replaceManifestWithSingleArch(image string) error {
99105 if err != nil {
100106 return err
101107 }
102- var singleArchManifest v1 .Manifest
108+ var singleArchManifest types .Manifest
103109 for _ , manifest := range manifestList .Manifests {
104110 if manifest .Platform .Architecture == r .platform .Architecture && manifest .Platform .OS == r .platform .OS {
105111 singleArchManifest = manifest
@@ -114,6 +120,11 @@ func (r *Registry) replaceManifestWithSingleArch(image string) error {
114120 return nil
115121}
116122
123+ func (r * Registry ) PushManifest (image string , manifest types.Manifest ) error {
124+ // Implement the logic to push the manifest for the given image
125+ return nil
126+ }
127+
117128func WrapParseStringSlice2ContainerImageList (parseFunc parseContainerImageStringSliceFunc ) func (srcPath string ) ([]* v12.ContainerImage , error ) {
118129 return func (srcPath string ) ([]* v12.ContainerImage , error ) {
119130 images , err := parseFunc (srcPath )
0 commit comments