sandbox: make a clear dependency of cri plugins
Signed-off-by: Abel Feng <fshb1988@gmail.com>
This commit is contained in:
		| @@ -22,8 +22,10 @@ import ( | ||||
| 	fuzz "github.com/AdaLogics/go-fuzz-headers" | ||||
|  | ||||
| 	containerd "github.com/containerd/containerd/v2/client" | ||||
| 	"github.com/containerd/containerd/v2/oci" | ||||
| 	criconfig "github.com/containerd/containerd/v2/pkg/cri/config" | ||||
| 	"github.com/containerd/containerd/v2/pkg/cri/server" | ||||
| 	"github.com/containerd/containerd/v2/pkg/cri/server/base" | ||||
| 	"github.com/containerd/containerd/v2/pkg/cri/server/images" | ||||
| ) | ||||
|  | ||||
| @@ -38,12 +40,19 @@ func FuzzCRIServer(data []byte) int { | ||||
| 	} | ||||
| 	defer client.Close() | ||||
|  | ||||
| 	imageService, err := images.NewService(criconfig.Config{}, client) | ||||
| 	config := criconfig.Config{} | ||||
|  | ||||
| 	criBase := &base.CRIBase{ | ||||
| 		Config:       config, | ||||
| 		BaseOCISpecs: map[string]*oci.Spec{}, | ||||
| 	} | ||||
|  | ||||
| 	imageService, err := images.NewService(config, client) | ||||
| 	if err != nil { | ||||
| 		panic(err) | ||||
| 	} | ||||
|  | ||||
| 	c, err := server.NewCRIService(criconfig.Config{}, imageService, client, nil) | ||||
| 	c, err := server.NewCRIService(criBase, imageService, client, nil) | ||||
| 	if err != nil { | ||||
| 		panic(err) | ||||
| 	} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Abel Feng
					Abel Feng