containers

package
v0.23.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2026 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContainerLogsHttpPath string = "/apis/usvc-dev.developer.microsoft.com/v1/containers/%s/log"
	ContainerHttpPath     string = "/apis/usvc-dev.developer.microsoft.com/v1/containers/%s"
)

Variables

View Source
var (
	ErrUnmatched         = errors.New("error")
	ErrUnmarshalling     = errors.New("error unmarshalling object")
	ErrNotFound          = errors.New("object not found")
	ErrAlreadyExists     = errors.New("object already exists")
	ErrCouldNotAllocate  = errors.New("object could not allocate required resources")
	ErrRuntimeNotHealthy = errors.New("runtime is not healthy")
	ErrObjectInUse       = errors.New("object is in use")
	ErrIncomplete        = errors.New("not all requested objects were returned")
	DanglingFilterTrue   = true
	DanglingFilterFalse  = false
)

Functions

func AddCertificateToTar

func AddCertificateToTar(tarWriter *usvc_io.TarWriter, basePath string, owner int32, group int32, umask fs.FileMode, certificate apiv1.FileSystemEntry, modTime time.Time, hashes []string, log logr.Logger) (string, error)

func AddDirectoryToTar

func AddDirectoryToTar(tarWriter *usvc_io.TarWriter, basePath string, owner int32, group int32, umask fs.FileMode, directory apiv1.FileSystemEntry, modTime time.Time, log logr.Logger) error

func AddFileToTar

func AddFileToTar(tarWriter *usvc_io.TarWriter, basePath string, owner int32, group int32, umask fs.FileMode, file apiv1.FileSystemEntry, modTime time.Time, log logr.Logger) error

func AddSymlinkToTar

func AddSymlinkToTar(tarWriter *usvc_io.TarWriter, basePath string, owner int32, group int32, umask fs.FileMode, symlink apiv1.FileSystemEntry, modTime time.Time, log logr.Logger) error

func ExpectCliStrings

func ExpectCliStrings(b *bytes.Buffer, expected []string) error

func NormalizeCliErrors

func NormalizeCliErrors(errBuf *bytes.Buffer, errorMatches ...ErrorMatch) error

NormalizeCliErrors takes an error buffer containing CLI output and attempts to normalize any lines that match the provided error patterns into a well-defined error. It returns a final error containing the normalized errors (or nil if there were no non-empty lines returned).

Types

type BuildImage

type BuildImage interface {
	// Build a new container image. If successful, the ID of the image is returned.
	BuildImage(ctx context.Context, options BuildImageOptions) error
}

type BuildImageOptions

type BuildImageOptions struct {
	IidFile string
	Pull    bool

	*apiv1.ContainerBuildContext

	StreamCommandOptions
	TimeoutOption
}

type CachedRuntimeStatusUsage

type CachedRuntimeStatusUsage string
const CachedRuntimeStatusAllowed CachedRuntimeStatusUsage = "cachedResultAllowed"
const IgnoreCachedRuntimeStatus CachedRuntimeStatusUsage = "ignoreCachedResult"

type ConnectNetwork

type ConnectNetwork interface {
	ConnectNetwork(ctx context.Context, options ConnectNetworkOptions) error
}

type ConnectNetworkOptions

type ConnectNetworkOptions struct {
	// The name or ID of the network to connect to
	Network string

	// The name or ID of a container to connect to the network
	Container string

	// The alias to use for the container on the network
	Aliases []string
}

type ContainerDiagnostics

type ContainerDiagnostics struct {
	// Container runtime client version
	ClientVersion string `json:"clientVersion,omitempty"`

	// Container runtime server version
	ServerVersion string `json:"serverVersion,omitempty"`
}

type ContainerHealthcheck

type ContainerHealthcheck struct {
	// The command to run for the health check
	Command []string

	// The interval between health checks
	Interval time.Duration

	// The maximum time to wait for the health check to complete
	Timeout time.Duration

	// The number of failures before the container is considered unhealthy
	Retries int32

	// The duration after the container starts before failures count against health check retry failures
	StartPeriod time.Duration

	// The interval between health checks during the start period
	StartInterval time.Duration
}

type ContainerLogSource

type ContainerLogSource interface {
	// Starts capturing container logs to the provided writers
	CaptureContainerLogs(ctx context.Context, container string, stdout usvc_io.WriteSyncerCloser, stderr usvc_io.WriteSyncerCloser, options StreamContainerLogsOptions) error
}

type ContainerOrchestrator

type ContainerOrchestrator interface {
	// Is this the default orchestrator?
	IsDefault() bool

	// Get the name of the runtime
	Name() string

	// Get the container machine host name for the runtime
	ContainerHost() string

	// Start running background checks for the runtime status
	EnsureBackgroundStatusUpdates(ctx context.Context)

	// Get container runtime diagnostic information
	GetDiagnostics

	CreateContainer
	StartContainers
	RunContainer
	ListContainers
	InspectContainers
	StopContainers
	RemoveContainers
	ExecContainers
	CreateFiles

	// Subscribes to events about container state changes
	// When the subscription is cancelled, the channel will be closed
	WatchContainers(sink chan<- EventMessage) (*pubsub.Subscription[EventMessage], error)

	ContainerLogSource
	VolumeOrchestrator
	ImageOrchestrator
	NetworkOrchestrator
	RuntimeStatusChecker
}

Represents portion of container orchestrator functionality that is related to container management

type ContainerRuntimeStatus

type ContainerRuntimeStatus struct {
	Installed bool
	Running   bool
	Error     string
}

func (ContainerRuntimeStatus) IsHealthy

func (crs ContainerRuntimeStatus) IsHealthy() bool

type ContainerStatus

type ContainerStatus string
const (
	ContainerStatusCreated    ContainerStatus = "created"
	ContainerStatusRunning    ContainerStatus = "running"
	ContainerStatusPaused     ContainerStatus = "paused"
	ContainerStatusRestarting ContainerStatus = "restarting"
	ContainerStatusRemoving   ContainerStatus = "removing"
	ContainerStatusExited     ContainerStatus = "exited"
	ContainerStatusDead       ContainerStatus = "dead"
)

Reference: https://github.com/moby/moby/blob/master/api/swagger.yaml (search for 'ContainerState' object definition, Status property)

type CreateContainer

type CreateContainer interface {
	// Create (but do not start) a container. If successful, the ID of the container is returned.
	CreateContainer(ctx context.Context, options CreateContainerOptions) (string, error)
}

type CreateContainerOptions

type CreateContainerOptions struct {
	// Name of the container. If empty, the container orchestrator will provide a default name for the new container.
	//
	// Note: There is also ContainerSpec.ContainerName, but we need to have the ability
	//       to use specific container name even if ContainerSpec.ContainerName is not set,
	//       so this is why this property exist.
	//       Container orchestrator implementations should use only Name property at creation time
	//       and not rely on ContainerSpec.ContainerName.
	Name string

	// Name or ID of a network to connect to _at creation time_.
	// If not set, the container will be connected to default network.
	//
	// Note: ContainerSpec.Networks specifies which networks the container will be connected to eventually,
	//       but that property should not be used at creation time.
	Network string

	// Network aliases to use for the container _at creation time_.
	// This is only valid if Network is also specified.
	//
	// Note: ContainerSpec.Networks can include network alias information, but that applies to networks
	//	     that the container will be connected to eventually, and not at creation time.
	NetworkAliases []string

	// Healthcheck configuration for the container
	// This is currently only used for testing purposes
	Healthcheck ContainerHealthcheck

	StreamCommandOptions
	TimeoutOption

	apiv1.ContainerSpec
}

type CreateFiles

type CreateFiles interface {
	// Create files/folders in the container based on the provided structure
	CreateFiles(ctx context.Context, options CreateFilesOptions) error
}

type CreateFilesOptions

type CreateFilesOptions struct {
	// The container (name/id) to copy the file to
	Container string

	// Time the file was modified/created
	ModTime time.Time

	// The base path in the container under which the files and folders will be created
	Destination string

	// The default owner ID for created files (defaults to 0 for root)
	DefaultOwner int32

	// The default group ID for created files (defaults to 0 for root)
	DefaultGroup int32

	// The umask for created files and folders without explicit permissions set (defaults to 022)
	Umask fs.FileMode

	// The specific entries to create in the container (must have at least one item)
	Entries []apiv1.FileSystemEntry
}

type CreateNetwork

type CreateNetwork interface {
	CreateNetwork(ctx context.Context, options CreateNetworkOptions) (string, error)
}

type CreateNetworkOptions

type CreateNetworkOptions struct {
	// Name of the network
	Name string

	// Is IPv6 enabled
	IPv6 bool

	// Labels to apply to the network
	Labels map[string]string
}

type CreateVolume

type CreateVolume interface {
	// Creates a new container volume.
	CreateVolume(ctx context.Context, options CreateVolumeOptions) error
}

type CreateVolumeOptions

type CreateVolumeOptions struct {
	// Name of the volume to create
	Name string
}

type DisconnectNetwork

type DisconnectNetwork interface {
	DisconnectNetwork(ctx context.Context, options DisconnectNetworkOptions) error
}

type DisconnectNetworkOptions

type DisconnectNetworkOptions struct {
	// The name or ID of the network to disconnect from
	Network string

	// The name or ID of a container to disconnect from the network
	Container string

	// Force disconnect from the network
	Force bool
}

type ErrorMatch

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

func NewCliErrorMatch

func NewCliErrorMatch(regex *regexp.Regexp, err ...error) ErrorMatch

func (ErrorMatch) MaxObjects

func (em ErrorMatch) MaxObjects(maxObjects int) ErrorMatch

type EventAction

type EventAction string
const (
	EventActionAttach       EventAction = "attach"
	EventActionCommit       EventAction = "commit"
	EventActionCopy         EventAction = "copy"
	EventActionCreate       EventAction = "create"
	EventActionDestroy      EventAction = "destroy"
	EventActionDetach       EventAction = "detach"
	EventActionDie          EventAction = "die"
	EventActionDied         EventAction = "died" // Podman-specific - doesn't adhere to the standard event types
	EventActionExecCreate   EventAction = "exec_create"
	EventActionExecDetach   EventAction = "exec_detach"
	EventActionExecStart    EventAction = "exec_start"
	EventActionExecDie      EventAction = "exec_die"
	EventActionExport       EventAction = "export"
	EventActionHealthStatus EventAction = "health_status"
	EventActionKill         EventAction = "kill"
	EventActionOom          EventAction = "oom"
	EventActionPause        EventAction = "pause"
	EventActionRename       EventAction = "rename"
	EventActionResize       EventAction = "resize"
	EventActionRestart      EventAction = "restart"
	EventActionStart        EventAction = "start"
	EventActionStop         EventAction = "stop"
	EventActionTop          EventAction = "top"
	EventActionUnpause      EventAction = "unpause"
	EventActionUpdate       EventAction = "update"
	EventActionPrune        EventAction = "prune"
	EventActionConnect      EventAction = "connect"
	EventActionDisconnect   EventAction = "disconnect"
)

Types of events reported for containers See https://github.com/moby/moby/blob/master/api/swagger.yaml, search for "Containers report these events"

type EventActor

type EventActor struct {
	// The ID of the object that was associated with the event.
	ID string `json:"ID,omitempty"`
}

type EventMessage

type EventMessage struct {
	// The type of the object that caused the event
	Source EventSource `json:"Type"`

	// The action that triggered the event.
	// Different types of objects have different actions associated with them.
	Action EventAction `json:"Action"`

	// Data about the object (container etc) associate with the even
	Actor EventActor `json:"Actor,omitempty"`

	// Key value attributes associated with the event
	Attributes map[string]string `json:"Attributes,omitempty"`
}

Represents a notification about a change in container orchestrator

func (*EventMessage) String

func (em *EventMessage) String() string

type EventSource

type EventSource string
const (
	EventSourceBuilder   EventSource = "builder"
	EventSourceConfig    EventSource = "config"
	EventSourceContainer EventSource = "container"
	EventSourceDaemon    EventSource = "daemon"
	EventSourceImage     EventSource = "image"
	EventSourceNetwork   EventSource = "network"
	EventSourceNode      EventSource = "node"
	EventSourcePlugin    EventSource = "plugin"
	EventSourceSecret    EventSource = "secret"
	EventSourceService   EventSource = "service"
	EventSourceVolume    EventSource = "volume"
)

type ExecContainerOptions

type ExecContainerOptions struct {
	// The container (name/id) to execute the command in
	Container string

	// The working directory for the command
	WorkingDirectory string

	// The environment variables to set
	Env []apiv1.EnvVar

	// Environment files to use to populate the environment for the command
	EnvFiles []string

	// The command to run
	Command string

	// The arguments to pass to the command
	Args []string

	StreamCommandOptions
}

type ExecContainers

type ExecContainers interface {
	// Executes a command in a running container. Returns a channel that will emit the final exit code of running the command.
	ExecContainer(ctx context.Context, options ExecContainerOptions) (<-chan int32, error)
}

type GetDiagnostics

type GetDiagnostics interface {
	GetDiagnostics(ctx context.Context) (ContainerDiagnostics, error)
}

type ImageOrchestrator

type ImageOrchestrator interface {
	InspectImages
	BuildImage
	PullImage

	RuntimeStatusChecker
}

type InspectContainers

type InspectContainers interface {
	// Inspects containers identified by given list of IDs or names.
	InspectContainers(ctx context.Context, options InspectContainersOptions) ([]InspectedContainer, error)
}

type InspectContainersOptions

type InspectContainersOptions struct {
	// List of container IDs or names to inspect
	Containers []string
}

type InspectImages

type InspectImages interface {
	// Inspect images returns a list of InspectedImage objects for the given image IDs or names.
	// This method may partially succeed, returning a subset of images that were successfully inspected,
	// and a list of errors from stderr responses or errors in unmarshalling a given image. Finally a
	// single error is returned which may indicate a failure in the operation itself (e.g. invalid arguments)
	// or a failure code from the runtime. Even if the final error is not nil, there may still be some
	// inspected images returned.
	InspectImages(ctx context.Context, options InspectImagesOptions) ([]InspectedImage, error)
}

type InspectImagesOptions

type InspectImagesOptions struct {
	// The list of image IDs or names to inspect
	Images []string
}

type InspectNetworks

type InspectNetworks interface {
	InspectNetworks(ctx context.Context, options InspectNetworksOptions) ([]InspectedNetwork, error)
}

type InspectNetworksOptions

type InspectNetworksOptions struct {
	Networks []string
}

type InspectVolumes

type InspectVolumes interface {
	// Inspects volumes identified by given list of names.
	InspectVolumes(ctx context.Context, options InspectVolumesOptions) ([]InspectedVolume, error)
}

type InspectVolumesOptions

type InspectVolumesOptions struct {
	// The list of volume names to inspect
	Volumes []string
}

type InspectedContainer

type InspectedContainer struct {
	// ID of the container
	Id string `json:"Id"`

	// Name of the container
	Name string `json:"Name,omitempty"`

	// Image reference that was used to create the container.
	Image string `json:"Image,omitempty"`

	// Container creation timestamp
	CreatedAt time.Time `json:"CreatedAt,omitempty"`

	// Container start timestamp
	StartedAt time.Time `json:"StartedAt,omitempty"`

	// Container finish timestamp (the timestamp of last exit/death)
	FinishedAt time.Time `json:"FinishedAt,omitempty"`

	// Container status
	Status ContainerStatus `json:"Status,omitempty"`

	// Error message (if any) that was reported when the container exited
	Error string `json:"Error,omitempty"`

	// Exit code
	ExitCode int32 `json:"ExitCode,omitempty"`

	// The command that is configured to health check the container (if any)
	Healthcheck []string `json:"Healthcheck,omitempty"`

	// The status of any container health checks
	Health *InspectedContainerHealth `json:"Health,omitempty"`

	// Environment variables
	Env map[string]string `json:"Env,omitempty"`

	// Launch arguments
	Args []string `json:"Args,omitempty"`

	// Container volume/bind mounts
	Mounts []apiv1.VolumeMount `json:"Mounts,omitempty"`

	// Container ports
	Ports InspectedContainerPortMapping `json:"Ports,omitempty"`

	// Container networks
	Networks []InspectedContainerNetwork `json:"Networks,omitempty"`

	// Container labels
	Labels map[string]string `json:"Labels,omitempty"`
}

type InspectedContainerHealth

type InspectedContainerHealth struct {
	// Status of the container health check
	Status string `json:"Status,omitempty"`

	// How many times the health check has failed
	FailingStreak int32 `json:"FailingStreak,omitempty"`

	// Log of health check results
	Log []InspectedContainerHealthLog `json:"Log,omitempty"`
}

Results of container health check

type InspectedContainerHealthLog

type InspectedContainerHealthLog struct {
	// The start time of the health check
	Start time.Time `json:"Start,omitempty"`
	// The time the health check completed
	End time.Time `json:"End,omitempty"`
	// The exit code of the health check
	Exit int32 `json:"Exit,omitempty"`
	// The output of the health check command
	Output string `json:"Output,omitempty"`
}

type InspectedContainerHealthcheck

type InspectedContainerHealthcheck struct {
	// The command to run for the health check
	Test []string `json:"Test,omitempty"`
}

Configuration for the container health check

type InspectedContainerHostPortConfig

type InspectedContainerHostPortConfig struct {
	HostIp   string `json:"HostIp,omitempty"`
	HostPort string `json:"HostPort,omitempty"`
}

type InspectedContainerNetwork

type InspectedContainerNetwork struct {
	// ID of the network
	Id string `json:"NetworkID"`

	// Name of the network
	Name string `json:"Name"`

	// IP address of the container on this network
	IPAddress string `json:"IPAddress,omitempty"`

	// MAC address of the container on this network
	MacAddress string `json:"MacAddress,omitempty"`

	// Gateway for the container on this network
	Gateway string `json:"Gateway,omitempty"`

	// Aliases of the container on this network
	Aliases []string `json:"Aliases,omitempty"`
}

type InspectedContainerPortMapping

type InspectedContainerPortMapping map[string][]InspectedContainerHostPortConfig

type InspectedImage

type InspectedImage struct {
	// ID of the image
	Id string `json:"Id"`

	// Labels applied to the image
	Labels map[string]string `json:"Labels,omitempty"`

	// Tags applied to the image
	Tags []string `json:"Tags,omitempty"`

	// Digest of the image
	Digest string `json:"Digest,omitempty"`
}

type InspectedNetwork

type InspectedNetwork struct {
	// The name of the network
	Name string

	// The ID of the network
	Id string

	// The network driver
	Driver string

	// Labels applied to the network
	Labels map[string]string

	// The network scope
	Scope string

	// True if IPv6 is enabled
	IPv6 bool

	// True if internal network
	Internal bool

	// True if attachable
	Attachable bool

	// True if an ingress network
	Ingress bool

	// Subnets allocated to the network
	Subnets []string

	// Gateways allocated to the network
	Gateways []string

	// IDs of connected containers
	Containers []InspectedNetworkContainer

	// Time the network was created
	CreatedAt time.Time
}

type InspectedNetworkContainer

type InspectedNetworkContainer struct {
	// ID of the container
	Id string

	// Name of the container
	Name string
}

type InspectedVolume

type InspectedVolume struct {
	Name       string            `json:"Name"`
	Driver     string            `json:"Driver,omitempty"`
	MountPoint string            `json:"Mountpoint,omitempty"`
	Scope      string            `json:"Scope,omitempty"`
	Labels     map[string]string `json:"Labels,omitempty"`
	CreatedAt  time.Time         `json:"CreatedAt,omitempty"`
}

Contains information about an existing container volume

type LabelFilter

type LabelFilter struct {
	// Key of the label to filter by
	Key string
	// Value of the label to filter by
	Value string
}

type ListContainers

type ListContainers interface {
	ListContainers(ctx context.Context, options ListContainersOptions) ([]ListedContainer, error)
}

type ListContainersFilters

type ListContainersFilters struct {
	LabelFilters []LabelFilter
}

type ListContainersOptions

type ListContainersOptions struct {
	Filters ListContainersFilters
}

type ListNetworks

type ListNetworks interface {
	ListNetworks(ctx context.Context, options ListNetworksOptions) ([]ListedNetwork, error)
}

type ListNetworksFilters

type ListNetworksFilters struct {
	LabelFilters []LabelFilter
}

type ListNetworksOptions

type ListNetworksOptions struct {
	Filters ListNetworksFilters
}

type ListedContainer

type ListedContainer struct {
	// ID of the container
	Id string `json:"Id"`

	// Name of the container
	Name string `json:"Name,omitempty"`

	// Container image name or ID
	Image string `json:"Image,omitempty"`

	// Status of the container
	Status ContainerStatus `json:"State,omitempty"`

	// Labels applied to the container
	Labels map[string]string `json:"Labels,omitempty"`

	// Connected network names or IDs
	Networks []string `json:"Networks,omitempty"`
}

type ListedNetwork

type ListedNetwork struct {
	// Driver that created the network
	Driver string

	// Network ID
	ID string

	// True if IPv6 is enabled on the network
	IPv6 bool

	// True if the network is a built-in network
	Internal bool

	// Labels applied to the network
	Labels map[string]string

	// Name of the network
	Name string
}

type NetworkOrchestrator

type NetworkOrchestrator interface {
	CreateNetwork
	RemoveNetworks
	InspectNetworks
	ConnectNetwork
	DisconnectNetwork
	ListNetworks

	// Subscribes to events about network state changes
	// When the subscription is cancelled, the channel will be closed
	WatchNetworks(sink chan<- EventMessage) (*pubsub.Subscription[EventMessage], error)

	// Get default (bridge-type) network name
	DefaultNetworkName() string

	RuntimeStatusChecker
}

type PullImage

type PullImage interface {
	// PullImage pulls a container image from a registry. If successful, the ID of the image is returned.
	PullImage(ctx context.Context, options PullImageOptions) (string, error)
}

type PullImageOptions

type PullImageOptions struct {
	// ID of the image (name + tag)
	Image string `json:"Image"`

	// Digest of the image to pull (optional)
	Digest string `json:"Digest,omitempty"`

	TimeoutOption
}

type RemoveContainers

type RemoveContainers interface {
	// Removes containers identified by given list of IDs or names.
	// Returns list of removed containers. If some containers are not found, an error will be reported,
	// but containers that were found will be removed (this is NOT an all-or-noting operation).
	RemoveContainers(ctx context.Context, options RemoveContainersOptions) ([]string, error)
}

type RemoveContainersOptions

type RemoveContainersOptions struct {
	// The list of containers to remove (by name or ID)
	Containers []string

	// If true, the containers will be removed even if they are running
	Force bool
}

type RemoveNetworks

type RemoveNetworks interface {
	RemoveNetworks(ctx context.Context, options RemoveNetworksOptions) ([]string, error)
}

type RemoveNetworksOptions

type RemoveNetworksOptions struct {
	// The list of networks to remove
	Networks []string

	// Force removal of the network
	Force bool
}

type RemoveVolumes

type RemoveVolumes interface {
	// Removes volumes identified by given list of volume names.
	// Returns list of removed volumes. If some volumes are not found, an error will be reported,
	// but volumes that were found will be removed (this is NOT an all-or-nothing operation).
	RemoveVolumes(ctx context.Context, options RemoveVolumesOptions) ([]string, error)
}

type RemoveVolumesOptions

type RemoveVolumesOptions struct {
	// The list of volume IDs or names to remove
	Volumes []string

	// Force removal of the volume
	Force bool
}

type RunContainer

type RunContainer interface {
	// Starts the container. If successful, the ID of the container is returned.
	RunContainer(ctx context.Context, options RunContainerOptions) (string, error)
}

type RunContainerOptions

type RunContainerOptions struct {
	CreateContainerOptions
}

type RuntimeStatusChecker

type RuntimeStatusChecker interface {
	// Check the runtime status
	CheckStatus(ctx context.Context, cacheUsage CachedRuntimeStatusUsage) ContainerRuntimeStatus
}

type StartContainers

type StartContainers interface {
	// Start one or more stopped containers. Returns list of started containers.
	StartContainers(ctx context.Context, options StartContainersOptions) ([]string, error)
}

type StartContainersOptions

type StartContainersOptions struct {
	// The list of containers to start (by name or ID)
	Containers []string

	StreamCommandOptions
}

type StopContainers

type StopContainers interface {
	// Stops containers identified by given list of IDs or names.
	// Returns list of stopped containers. If some containers are not found, an error will be reported,
	// but containers that were found will be stopped (this is NOT an all-or-noting operation).
	StopContainers(ctx context.Context, options StopContainersOptions) ([]string, error)
}

type StopContainersOptions

type StopContainersOptions struct {
	// The list of containers to stop (by name or ID)
	Containers []string

	// How many seconds to wait for the container to gracefully exit before killing it
	SecondsToKill uint
}

type StreamCommandOptions

type StreamCommandOptions struct {
	// Stream to write stdout to
	StdOutStream io.WriteCloser

	// Stream to write stderr to
	StdErrStream io.WriteCloser
}

Common options for commands that support streamed output

type StreamContainerLogsOptions

type StreamContainerLogsOptions struct {
	// Follow the logs vs. just returning the current logs at the time the command was run
	Follow bool

	// Request the container orchestrator to add timestamps to the log entries
	Timestamps bool
}

func (StreamContainerLogsOptions) Apply

func (o StreamContainerLogsOptions) Apply(args []string) []string

type TestContainerOrchestratorClient

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

func NewTestContainerOrchestratorClient

func NewTestContainerOrchestratorClient(
	lifetimeCtx context.Context,
	log logr.Logger,
	socketFilePath string,
) *TestContainerOrchestratorClient

func (*TestContainerOrchestratorClient) CaptureContainerLogs

func (*TestContainerOrchestratorClient) InspectContainers

func (*TestContainerOrchestratorClient) RemoveContainers

func (c *TestContainerOrchestratorClient) RemoveContainers(ctx context.Context, options RemoveContainersOptions) ([]string, error)

func (*TestContainerOrchestratorClient) StopContainers

type TimeoutOption

type TimeoutOption struct {
	Timeout time.Duration
}

type VolumeOrchestrator

type VolumeOrchestrator interface {
	CreateVolume
	InspectVolumes
	RemoveVolumes

	RuntimeStatusChecker
}

Represents portion of container orchestrator functionality that is related related to volume management

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL