Documentation ¶
Overview ¶
Package mocks is a generated GoMock package.
Package ctr is a generated GoMock package.
Package ctr is a generated GoMock package.
Package ctr is a generated GoMock package.
Index ¶
- Constants
- Variables
- func WithCgroupsPath(container *types.Container) crtdoci.SpecOpts
- func WithCommonOptions(c *types.Container) crtdoci.SpecOpts
- func WithDevices(c *types.Container) crtdoci.SpecOpts
- func WithHooks(container *types.Container, execRoot string) crtdoci.SpecOpts
- func WithMounts(container *types.Container) crtdoci.SpecOpts
- func WithNamespaces(container *types.Container) crtdoci.SpecOpts
- func WithResources(c *types.Container) crtdoci.SpecOpts
- func WithRuntimeOpts(container *types.Container, runtimeRootPath string) containerd.NewContainerOpts
- func WithSnapshotOpts(snapshotID string, snapshotterType string) []containerd.NewContainerOpts
- func WithSpecOpts(container *types.Container, image containerd.Image, execRoot string) containerd.NewContainerOpts
- type AuthCredentials
- type ContainerAPIClient
- type ContainerExitHook
- type ContainerOpts
- func WithCtrImageVerifierConfig(imageVerifierConfig map[string]string) ContainerOpts
- func WithCtrImageVerifierType(imageVerifierType string) ContainerOpts
- func WithCtrdConnectionPath(conPath string) ContainerOpts
- func WithCtrdImageDecryptKeys(keys ...string) ContainerOpts
- func WithCtrdImageDecryptRecipients(recipients ...string) ContainerOpts
- func WithCtrdImageExpiry(expiry time.Duration) ContainerOpts
- func WithCtrdImageExpiryDisable(disable bool) ContainerOpts
- func WithCtrdLeaseID(leaseID string) ContainerOpts
- func WithCtrdMetaPath(metaPath string) ContainerOpts
- func WithCtrdNamespace(namespace string) ContainerOpts
- func WithCtrdRegistryConfigs(configs map[string]*RegistryConfig) ContainerOpts
- func WithCtrdRootExec(rootExecDir string) ContainerOpts
- func WithCtrdRuncRuntime(runcRuntime string) ContainerOpts
- type IO
- type MockIO
- func (m *MockIO) Close() error
- func (m *MockIO) EXPECT() *MockIOMockRecorder
- func (m *MockIO) InitContainerIO(dio *cio.DirectIO) (cio.IO, error)
- func (m *MockIO) Reset()
- func (m *MockIO) SetLogDriver(logDriver logger.LogDriver)
- func (m *MockIO) SetMaxBufferSize(maxBufferSize int64)
- func (m *MockIO) SetNonBlock(nonBlock bool)
- func (m *MockIO) Stream() streams.Stream
- func (m *MockIO) UseStdin() bool
- func (m *MockIO) Wait()
- type MockIOMockRecorder
- func (mr *MockIOMockRecorder) Close() *gomock.Call
- func (mr *MockIOMockRecorder) InitContainerIO(dio interface{}) *gomock.Call
- func (mr *MockIOMockRecorder) Reset() *gomock.Call
- func (mr *MockIOMockRecorder) SetLogDriver(logDriver interface{}) *gomock.Call
- func (mr *MockIOMockRecorder) SetMaxBufferSize(maxBufferSize interface{}) *gomock.Call
- func (mr *MockIOMockRecorder) SetNonBlock(nonBlock interface{}) *gomock.Call
- func (mr *MockIOMockRecorder) Stream() *gomock.Call
- func (mr *MockIOMockRecorder) UseStdin() *gomock.Call
- func (mr *MockIOMockRecorder) Wait() *gomock.Call
- type MockcontainerIOManager
- func (m *MockcontainerIOManager) ClearIO(id string) error
- func (m *MockcontainerIOManager) CloseIO(id string) error
- func (m *MockcontainerIOManager) ConfigureIO(id string, logDriver logger.LogDriver, logModeCfg *types.LogModeConfiguration) error
- func (m *MockcontainerIOManager) EXPECT() *MockcontainerIOManagerMockRecorder
- func (m *MockcontainerIOManager) ExistsIO(id string) bool
- func (m *MockcontainerIOManager) GetIO(id string) IO
- func (m *MockcontainerIOManager) InitIO(id string, withStdin bool) (IO, error)
- func (m *MockcontainerIOManager) NewCioAttach(id string) cio.Attach
- func (m *MockcontainerIOManager) NewCioCreator(withTerminal bool) cio.Creator
- func (m *MockcontainerIOManager) ResetIO(id string)
- type MockcontainerIOManagerMockRecorder
- func (mr *MockcontainerIOManagerMockRecorder) ClearIO(id interface{}) *gomock.Call
- func (mr *MockcontainerIOManagerMockRecorder) CloseIO(id interface{}) *gomock.Call
- func (mr *MockcontainerIOManagerMockRecorder) ConfigureIO(id, logDriver, logModeCfg interface{}) *gomock.Call
- func (mr *MockcontainerIOManagerMockRecorder) ExistsIO(id interface{}) *gomock.Call
- func (mr *MockcontainerIOManagerMockRecorder) GetIO(id interface{}) *gomock.Call
- func (mr *MockcontainerIOManagerMockRecorder) InitIO(id, withStdin interface{}) *gomock.Call
- func (mr *MockcontainerIOManagerMockRecorder) NewCioAttach(id interface{}) *gomock.Call
- func (mr *MockcontainerIOManagerMockRecorder) NewCioCreator(withTerminal interface{}) *gomock.Call
- func (mr *MockcontainerIOManagerMockRecorder) ResetIO(id interface{}) *gomock.Call
- type MockcontainerVerifier
- type MockcontainerVerifierMockRecorder
- type MockresourcesWatcher
- type MockresourcesWatcherMockRecorder
- type RegistryConfig
- type TLSConfig
- type VerifierType
Constants ¶
const ( // VerifierNone is a VerifierType denoting that no verification will be performed VerifierNone = VerifierType("none") // VerifierNotation is a VerifierType denoting that verification will be performed with notation VerifierNotation = VerifierType("notation") )
const (
// ContainerdClientServiceLocalID sets service local ID for containerd client.
ContainerdClientServiceLocalID = "container-management.service.local.v1.service-containerd-client"
)
Variables ¶
var ( // CtrdRuntimes contains all runtime type names CtrdRuntimes = map[types.Runtime]string{ types.RuntimeTypeV1: "runc", types.RuntimeTypeV2runscV1: "runhcs", types.RuntimeTypeV2kataV2: "kata", types.RuntimeTypeV2runcV1: "runc", types.RuntimeTypeV2runcV2: "runc", } )
Functions ¶
func WithCgroupsPath ¶
WithCgroupsPath sets the container's cgroup path
func WithCommonOptions ¶
WithCommonOptions sets common options: - hostname
func WithDevices ¶
WithDevices sets the available USB devices Package name changed also removed not needed logic and added custom code to handle the specific use case, Bosch.IO GmbH, 2020
func WithMounts ¶
WithMounts sets the network resolution files generated e.g. c.getRootResourceDir("resolv.conf"), "hostname", "hosts"
func WithNamespaces ¶
WithNamespaces sets the enabled and desired namespaces to be used for the container's isolation.
func WithResources ¶
WithResources sets container resource limitation:
func WithRuntimeOpts ¶
func WithRuntimeOpts(container *types.Container, runtimeRootPath string) containerd.NewContainerOpts
WithRuntimeOpts sets the runtime configuration for the container to be created.
func WithSnapshotOpts ¶
func WithSnapshotOpts(snapshotID string, snapshotterType string) []containerd.NewContainerOpts
WithSnapshotOpts sets the snapshotting configuration for the container to be created.
func WithSpecOpts ¶
func WithSpecOpts(container *types.Container, image containerd.Image, execRoot string) containerd.NewContainerOpts
WithSpecOpts sets the OCI specification configuration options for the container to be created.
Types ¶
type AuthCredentials ¶
AuthCredentials represents credentials for accessing container registries secured via Basic Auth.
type ContainerAPIClient ¶
type ContainerAPIClient interface { // DestroyContainer kill container and delete it DestroyContainer(ctx context.Context, container *types.Container, stopOpts *types.StopOpts, clearIOs bool) (int64, time.Time, error) // CreateContainer creates all resources needed in the underlying container management so that a container can be successfully started CreateContainer(ctx context.Context, container *types.Container, checkpointDir string) error // StartContainer starts the underlying container StartContainer(ctx context.Context, container *types.Container, checkpointDir string) (int64, error) // GetContainerStats retrieves container stats - CPU, memory, IO and PIDs number, and the time they have been measured GetContainerStats(ctx context.Context, container *types.Container) (*types.CPUStats, *types.MemoryStats, *types.IOStats, uint64, time.Time, error) // AttachContainer attaches to the container's IO AttachContainer(ctx context.Context, container *types.Container, attachConfig *streams.AttachConfig) error // PauseContainer pauses a container PauseContainer(ctx context.Context, container *types.Container) error // UnpauseContainer unpauses a container UnpauseContainer(ctx context.Context, container *types.Container) error // RestoreContainer restores the container information from the underlying container management client along with initialization of all needed resources - streams, etc. RestoreContainer(ctx context.Context, container *types.Container) error // Dispose manages stop and dispose the containers client Dispose(ctx context.Context) error // ListContainers lists all created containers ListContainers(ctx context.Context) ([]*types.Container, error) // GetContainerInfo provides detailed information about a container GetContainerInfo(ctx context.Context, id string) (*types.Container, error) // ReleaseContainerResources releases all locally allocated resources for the container by the client implementation - e.g. streams, etc. ReleaseContainerResources(ctx context.Context, container *types.Container) error // SetContainerExitHooks provides access for hooking a clearing logic to the containers resources management on exit SetContainerExitHooks(hooks ...ContainerExitHook) //UpdateContainer updates container resource limits UpdateContainer(ctx context.Context, container *types.Container, resources *types.Resources) error }
ContainerAPIClient provides access to containerd container features
type ContainerExitHook ¶
ContainerExitHook represents a hook for clearing logic to the containers resources management on exit
type ContainerOpts ¶
type ContainerOpts func(ctrOptions *ctrOpts) error
ContainerOpts represents container engine client's configuration options.
func WithCtrImageVerifierConfig ¶
func WithCtrImageVerifierConfig(imageVerifierConfig map[string]string) ContainerOpts
WithCtrImageVerifierConfig sets the image verifier config of the container client instance.
func WithCtrImageVerifierType ¶
func WithCtrImageVerifierType(imageVerifierType string) ContainerOpts
WithCtrImageVerifierType sets the image verifier type of the container client instance.
func WithCtrdConnectionPath ¶
func WithCtrdConnectionPath(conPath string) ContainerOpts
WithCtrdConnectionPath sets the address path to the containerd service communication endpoint (e.g. a local UNIX socket).
func WithCtrdImageDecryptKeys ¶
func WithCtrdImageDecryptKeys(keys ...string) ContainerOpts
WithCtrdImageDecryptKeys sets the keys for decrypting encrypted container images.
func WithCtrdImageDecryptRecipients ¶
func WithCtrdImageDecryptRecipients(recipients ...string) ContainerOpts
WithCtrdImageDecryptRecipients sets the recipients for decrypting encrypted container images.
func WithCtrdImageExpiry ¶
func WithCtrdImageExpiry(expiry time.Duration) ContainerOpts
WithCtrdImageExpiry sets images expiry time.
func WithCtrdImageExpiryDisable ¶
func WithCtrdImageExpiryDisable(disable bool) ContainerOpts
WithCtrdImageExpiryDisable disables the images' expiry management.
func WithCtrdLeaseID ¶
func WithCtrdLeaseID(leaseID string) ContainerOpts
WithCtrdLeaseID sets the lease that the container client instance will use within containerd.
func WithCtrdMetaPath ¶
func WithCtrdMetaPath(metaPath string) ContainerOpts
WithCtrdMetaPath sets meta path for the container client service to use for its storage.
func WithCtrdNamespace ¶
func WithCtrdNamespace(namespace string) ContainerOpts
WithCtrdNamespace sets the namespace that the container client instance will use within containerd.
func WithCtrdRegistryConfigs ¶
func WithCtrdRegistryConfigs(configs map[string]*RegistryConfig) ContainerOpts
WithCtrdRegistryConfigs sets the configurations for accessing the provided container registries.
func WithCtrdRootExec ¶
func WithCtrdRootExec(rootExecDir string) ContainerOpts
WithCtrdRootExec sets root executable directory that the client will use.
func WithCtrdRuncRuntime ¶
func WithCtrdRuncRuntime(runcRuntime string) ContainerOpts
WithCtrdRuncRuntime sets the container runc runtime.
type IO ¶
type IO interface { // InitContainerIO will start logger and coping data from fifo InitContainerIO(dio *cio.DirectIO) (cio.IO, error) // SetLogDriver sets log driver to the IO SetLogDriver(logDriver logger.LogDriver) // SetMaxBufferSize set the max size of buffer. SetMaxBufferSize(maxBufferSize int64) // SetNonBlock whether to cache the container's logs with buffer SetNonBlock(nonBlock bool) // Stream is used to export the stream field Stream() streams.Stream // UseStdin returns whether the STDIN stream should also be attached UseStdin() bool // Wait wait for coping-data job Wait() // Close closes the stream and the logger Close() error // Reset resets the allocated streams Reset() }
IO represents the streams and logger per identifiable process
type MockIO ¶
type MockIO struct {
// contains filtered or unexported fields
}
MockIO is a mock of IO interface.
func NewMockIO ¶
func NewMockIO(ctrl *gomock.Controller) *MockIO
NewMockIO creates a new mock instance.
func (*MockIO) EXPECT ¶
func (m *MockIO) EXPECT() *MockIOMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockIO) InitContainerIO ¶
InitContainerIO mocks base method.
func (*MockIO) SetLogDriver ¶
SetLogDriver mocks base method.
func (*MockIO) SetMaxBufferSize ¶
SetMaxBufferSize mocks base method.
func (*MockIO) SetNonBlock ¶
SetNonBlock mocks base method.
type MockIOMockRecorder ¶
type MockIOMockRecorder struct {
// contains filtered or unexported fields
}
MockIOMockRecorder is the mock recorder for MockIO.
func (*MockIOMockRecorder) Close ¶
func (mr *MockIOMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close.
func (*MockIOMockRecorder) InitContainerIO ¶
func (mr *MockIOMockRecorder) InitContainerIO(dio interface{}) *gomock.Call
InitContainerIO indicates an expected call of InitContainerIO.
func (*MockIOMockRecorder) Reset ¶
func (mr *MockIOMockRecorder) Reset() *gomock.Call
Reset indicates an expected call of Reset.
func (*MockIOMockRecorder) SetLogDriver ¶
func (mr *MockIOMockRecorder) SetLogDriver(logDriver interface{}) *gomock.Call
SetLogDriver indicates an expected call of SetLogDriver.
func (*MockIOMockRecorder) SetMaxBufferSize ¶
func (mr *MockIOMockRecorder) SetMaxBufferSize(maxBufferSize interface{}) *gomock.Call
SetMaxBufferSize indicates an expected call of SetMaxBufferSize.
func (*MockIOMockRecorder) SetNonBlock ¶
func (mr *MockIOMockRecorder) SetNonBlock(nonBlock interface{}) *gomock.Call
SetNonBlock indicates an expected call of SetNonBlock.
func (*MockIOMockRecorder) Stream ¶
func (mr *MockIOMockRecorder) Stream() *gomock.Call
Stream indicates an expected call of Stream.
func (*MockIOMockRecorder) UseStdin ¶
func (mr *MockIOMockRecorder) UseStdin() *gomock.Call
UseStdin indicates an expected call of UseStdin.
func (*MockIOMockRecorder) Wait ¶
func (mr *MockIOMockRecorder) Wait() *gomock.Call
Wait indicates an expected call of Wait.
type MockcontainerIOManager ¶
type MockcontainerIOManager struct {
// contains filtered or unexported fields
}
MockcontainerIOManager is a mock of containerIOManager interface.
func NewMockcontainerIOManager ¶
func NewMockcontainerIOManager(ctrl *gomock.Controller) *MockcontainerIOManager
NewMockcontainerIOManager creates a new mock instance.
func (*MockcontainerIOManager) ClearIO ¶
func (m *MockcontainerIOManager) ClearIO(id string) error
ClearIO mocks base method.
func (*MockcontainerIOManager) CloseIO ¶
func (m *MockcontainerIOManager) CloseIO(id string) error
CloseIO mocks base method.
func (*MockcontainerIOManager) ConfigureIO ¶
func (m *MockcontainerIOManager) ConfigureIO(id string, logDriver logger.LogDriver, logModeCfg *types.LogModeConfiguration) error
ConfigureIO mocks base method.
func (*MockcontainerIOManager) EXPECT ¶
func (m *MockcontainerIOManager) EXPECT() *MockcontainerIOManagerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockcontainerIOManager) ExistsIO ¶
func (m *MockcontainerIOManager) ExistsIO(id string) bool
ExistsIO mocks base method.
func (*MockcontainerIOManager) GetIO ¶
func (m *MockcontainerIOManager) GetIO(id string) IO
GetIO mocks base method.
func (*MockcontainerIOManager) InitIO ¶
func (m *MockcontainerIOManager) InitIO(id string, withStdin bool) (IO, error)
InitIO mocks base method.
func (*MockcontainerIOManager) NewCioAttach ¶
func (m *MockcontainerIOManager) NewCioAttach(id string) cio.Attach
NewCioAttach mocks base method.
func (*MockcontainerIOManager) NewCioCreator ¶
func (m *MockcontainerIOManager) NewCioCreator(withTerminal bool) cio.Creator
NewCioCreator mocks base method.
func (*MockcontainerIOManager) ResetIO ¶
func (m *MockcontainerIOManager) ResetIO(id string)
ResetIO mocks base method.
type MockcontainerIOManagerMockRecorder ¶
type MockcontainerIOManagerMockRecorder struct {
// contains filtered or unexported fields
}
MockcontainerIOManagerMockRecorder is the mock recorder for MockcontainerIOManager.
func (*MockcontainerIOManagerMockRecorder) ClearIO ¶
func (mr *MockcontainerIOManagerMockRecorder) ClearIO(id interface{}) *gomock.Call
ClearIO indicates an expected call of ClearIO.
func (*MockcontainerIOManagerMockRecorder) CloseIO ¶
func (mr *MockcontainerIOManagerMockRecorder) CloseIO(id interface{}) *gomock.Call
CloseIO indicates an expected call of CloseIO.
func (*MockcontainerIOManagerMockRecorder) ConfigureIO ¶
func (mr *MockcontainerIOManagerMockRecorder) ConfigureIO(id, logDriver, logModeCfg interface{}) *gomock.Call
ConfigureIO indicates an expected call of ConfigureIO.
func (*MockcontainerIOManagerMockRecorder) ExistsIO ¶
func (mr *MockcontainerIOManagerMockRecorder) ExistsIO(id interface{}) *gomock.Call
ExistsIO indicates an expected call of ExistsIO.
func (*MockcontainerIOManagerMockRecorder) GetIO ¶
func (mr *MockcontainerIOManagerMockRecorder) GetIO(id interface{}) *gomock.Call
GetIO indicates an expected call of GetIO.
func (*MockcontainerIOManagerMockRecorder) InitIO ¶
func (mr *MockcontainerIOManagerMockRecorder) InitIO(id, withStdin interface{}) *gomock.Call
InitIO indicates an expected call of InitIO.
func (*MockcontainerIOManagerMockRecorder) NewCioAttach ¶
func (mr *MockcontainerIOManagerMockRecorder) NewCioAttach(id interface{}) *gomock.Call
NewCioAttach indicates an expected call of NewCioAttach.
func (*MockcontainerIOManagerMockRecorder) NewCioCreator ¶
func (mr *MockcontainerIOManagerMockRecorder) NewCioCreator(withTerminal interface{}) *gomock.Call
NewCioCreator indicates an expected call of NewCioCreator.
func (*MockcontainerIOManagerMockRecorder) ResetIO ¶
func (mr *MockcontainerIOManagerMockRecorder) ResetIO(id interface{}) *gomock.Call
ResetIO indicates an expected call of ResetIO.
type MockcontainerVerifier ¶
type MockcontainerVerifier struct {
// contains filtered or unexported fields
}
MockcontainerVerifier is a mock of containerVerifier interface.
func NewMockcontainerVerifier ¶
func NewMockcontainerVerifier(ctrl *gomock.Controller) *MockcontainerVerifier
NewMockcontainerVerifier creates a new mock instance.
func (*MockcontainerVerifier) EXPECT ¶
func (m *MockcontainerVerifier) EXPECT() *MockcontainerVerifierMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockcontainerVerifierMockRecorder ¶
type MockcontainerVerifierMockRecorder struct {
// contains filtered or unexported fields
}
MockcontainerVerifierMockRecorder is the mock recorder for MockcontainerVerifier.
func (*MockcontainerVerifierMockRecorder) Verify ¶
func (mr *MockcontainerVerifierMockRecorder) Verify(arg0, arg1 interface{}) *gomock.Call
Verify indicates an expected call of Verify.
type MockresourcesWatcher ¶
type MockresourcesWatcher struct {
// contains filtered or unexported fields
}
MockresourcesWatcher is a mock of resourcesWatcher interface.
func NewMockresourcesWatcher ¶
func NewMockresourcesWatcher(ctrl *gomock.Controller) *MockresourcesWatcher
NewMockresourcesWatcher creates a new mock instance.
func (*MockresourcesWatcher) Dispose ¶
func (m *MockresourcesWatcher) Dispose()
Dispose mocks base method.
func (*MockresourcesWatcher) EXPECT ¶
func (m *MockresourcesWatcher) EXPECT() *MockresourcesWatcherMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockresourcesWatcherMockRecorder ¶
type MockresourcesWatcherMockRecorder struct {
// contains filtered or unexported fields
}
MockresourcesWatcherMockRecorder is the mock recorder for MockresourcesWatcher.
func (*MockresourcesWatcherMockRecorder) Dispose ¶
func (mr *MockresourcesWatcherMockRecorder) Dispose() *gomock.Call
Dispose indicates an expected call of Dispose.
func (*MockresourcesWatcherMockRecorder) Watch ¶
func (mr *MockresourcesWatcherMockRecorder) Watch(resourceID, duration, expiredHandler interface{}) *gomock.Call
Watch indicates an expected call of Watch.
type RegistryConfig ¶
type RegistryConfig struct { IsInsecure bool Credentials *AuthCredentials Transport *TLSConfig }
RegistryConfig represents a single registry's access configuration.
type VerifierType ¶
type VerifierType string
VerifierType image verifier type - possible values are none and notation, when set to none image signatures wil not be verified.
Source Files ¶
- ctr_client_api.go
- ctr_client_opts.go
- ctr_tls_util.go
- ctr_verifier.go
- ctr_verifier_mock.go
- ctr_verifier_notation.go
- ctrd_cache.go
- ctrd_checkpoint.go
- ctrd_cio.go
- ctrd_cio_cache.go
- ctrd_cio_mgr.go
- ctrd_cio_mgr_internal.go
- ctrd_cio_mgr_mock.go
- ctrd_cio_mock.go
- ctrd_client.go
- ctrd_client_init.go
- ctrd_client_internal.go
- ctrd_container_create_opts.go
- ctrd_decrypt_mgr.go
- ctrd_log_mgr.go
- ctrd_metrics_util.go
- ctrd_oci_linux.go
- ctrd_registries_resolver.go
- ctrd_resource_watcher.go
- ctrd_resource_watcher_mock.go
- ctrd_spi.go
- ctrd_spi_containers.go
- ctrd_spi_events.go
- ctrd_spi_images.go
- ctrd_spi_internal.go
- ctrd_spi_snapshots.go