Documentation
¶
Index ¶
- Constants
- type ContainerdRuntime
- func (r *ContainerdRuntime) Close() error
- func (r *ContainerdRuntime) CreateContainer(ctx context.Context, task *types.Task) (string, error)
- func (r *ContainerdRuntime) CreateContainerWithMounts(ctx context.Context, task *types.Task, secretsPath string, ...) (string, error)
- func (r *ContainerdRuntime) CreateContainerWithSecrets(ctx context.Context, task *types.Task, secretsPath string) (string, error)
- func (r *ContainerdRuntime) DeleteContainer(ctx context.Context, containerID string) error
- func (r *ContainerdRuntime) GetContainerIP(ctx context.Context, containerID string) (string, error)
- func (r *ContainerdRuntime) GetContainerLogs(ctx context.Context, containerID string) (io.ReadCloser, error)
- func (r *ContainerdRuntime) GetContainerStatus(ctx context.Context, containerID string) (types.TaskState, error)
- func (r *ContainerdRuntime) IsRunning(ctx context.Context, containerID string) bool
- func (r *ContainerdRuntime) ListContainers(ctx context.Context) ([]string, error)
- func (r *ContainerdRuntime) PullImage(ctx context.Context, imageRef string) error
- func (r *ContainerdRuntime) StartContainer(ctx context.Context, containerID string) error
- func (r *ContainerdRuntime) StopContainer(ctx context.Context, containerID string, timeout time.Duration) error
Constants ¶
const ( // DefaultNamespace is the containerd namespace for Warren DefaultNamespace = "warren" // DefaultSocketPath is the default containerd socket DefaultSocketPath = "/run/containerd/containerd.sock" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContainerdRuntime ¶
type ContainerdRuntime struct {
// contains filtered or unexported fields
}
ContainerdRuntime implements container runtime using containerd
func NewContainerdRuntime ¶
func NewContainerdRuntime(socketPath string) (*ContainerdRuntime, error)
NewContainerdRuntime creates a new containerd runtime client
func (*ContainerdRuntime) Close ¶
func (r *ContainerdRuntime) Close() error
Close closes the containerd client connection
func (*ContainerdRuntime) CreateContainer ¶
CreateContainer creates a container from a task specification
func (*ContainerdRuntime) CreateContainerWithMounts ¶
func (r *ContainerdRuntime) CreateContainerWithMounts(ctx context.Context, task *types.Task, secretsPath string, volumeMounts []specs.Mount, resolvConfPath string) (string, error)
CreateContainerWithMounts creates a container with secret and volume mounts
func (*ContainerdRuntime) CreateContainerWithSecrets ¶
func (r *ContainerdRuntime) CreateContainerWithSecrets(ctx context.Context, task *types.Task, secretsPath string) (string, error)
CreateContainerWithSecrets creates a container with secret tmpfs mounts (deprecated, use CreateContainerWithMounts)
func (*ContainerdRuntime) DeleteContainer ¶
func (r *ContainerdRuntime) DeleteContainer(ctx context.Context, containerID string) error
DeleteContainer removes a container and its snapshot
func (*ContainerdRuntime) GetContainerIP ¶
GetContainerIP returns the IP address of a container
func (*ContainerdRuntime) GetContainerLogs ¶
func (r *ContainerdRuntime) GetContainerLogs(ctx context.Context, containerID string) (io.ReadCloser, error)
GetContainerLogs streams container logs (simplified implementation)
func (*ContainerdRuntime) GetContainerStatus ¶
func (r *ContainerdRuntime) GetContainerStatus(ctx context.Context, containerID string) (types.TaskState, error)
GetContainerStatus returns the status of a container
func (*ContainerdRuntime) IsRunning ¶
func (r *ContainerdRuntime) IsRunning(ctx context.Context, containerID string) bool
IsRunning checks if a container is currently running
func (*ContainerdRuntime) ListContainers ¶
func (r *ContainerdRuntime) ListContainers(ctx context.Context) ([]string, error)
ListContainers returns all containers in the Warren namespace
func (*ContainerdRuntime) PullImage ¶
func (r *ContainerdRuntime) PullImage(ctx context.Context, imageRef string) error
PullImage pulls a container image from a registry
func (*ContainerdRuntime) StartContainer ¶
func (r *ContainerdRuntime) StartContainer(ctx context.Context, containerID string) error
StartContainer starts a container and returns its runtime ID
func (*ContainerdRuntime) StopContainer ¶
func (r *ContainerdRuntime) StopContainer(ctx context.Context, containerID string, timeout time.Duration) error
StopContainer stops a running container