package testing

import "github.com/containerd/containerd/pkg/cri/server/testing"

Index

Types

type FakeCNIPlugin

type FakeCNIPlugin struct {
	StatusErr error
	LoadErr   error
}

FakeCNIPlugin is a fake plugin used for test.

func NewFakeCNIPlugin

func NewFakeCNIPlugin() *FakeCNIPlugin

NewFakeCNIPlugin create a FakeCNIPlugin.

func (*FakeCNIPlugin) Check

func (f *FakeCNIPlugin) Check(ctx context.Context, id, path string, opts ...cni.NamespaceOpts) error

Check the network of PodSandbox.

func (*FakeCNIPlugin) GetConfig

func (f *FakeCNIPlugin) GetConfig() *cni.ConfigResult

GetConfig returns a copy of the CNI plugin configurations as parsed by CNI

func (*FakeCNIPlugin) Load

func (f *FakeCNIPlugin) Load(opts ...cni.Opt) error

Load loads the network config.

func (*FakeCNIPlugin) Remove

func (f *FakeCNIPlugin) Remove(ctx context.Context, id, path string, opts ...cni.NamespaceOpts) error

Remove teardown the network of PodSandbox.

func (*FakeCNIPlugin) Setup

func (f *FakeCNIPlugin) Setup(ctx context.Context, id, path string, opts ...cni.NamespaceOpts) (*cni.Result, error)

Setup setups the network of PodSandbox.

func (*FakeCNIPlugin) SetupSerially

func (f *FakeCNIPlugin) SetupSerially(ctx context.Context, id, path string, opts ...cni.NamespaceOpts) (*cni.Result, error)

SetupSerially sets up the network of PodSandbox without doing the interfaces in parallel.

func (*FakeCNIPlugin) Status

func (f *FakeCNIPlugin) Status() error

Status get the status of the plugin.

type FakeWarningService

type FakeWarningService struct {
	// contains filtered or unexported fields
}

FakeWarningService is a fake service used for test.

func NewFakeWarningService

func NewFakeWarningService() *FakeWarningService

NewFakeWarningService create a FakeWarningService.

func (*FakeWarningService) Emit

func (*FakeWarningService) GetWarnings

func (ws *FakeWarningService) GetWarnings() []deprecation.Warning

func (*FakeWarningService) Warnings

func (ws *FakeWarningService) Warnings() []warning.Warning

Source Files

fake_cni_plugin.go fake_warning_service.go

Version
v1.7.27 (latest)
Published
Mar 17, 2025
Platform
linux/amd64
Imports
4 packages
Last checked
16 hours ago

Tools for package owners.