kubernetes

package
v0.0.31 Latest Latest
Warning

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

Go to latest
Published: May 6, 2025 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Overview

Package kubernetes provides a client for the Kubernetes runtime including creating, starting, stopping, and retrieving container information.

Index

Constants

View Source
const (
	// UnknownStatus represents an unknown container status
	UnknownStatus = "unknown"
)

Constants for container status

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client implements the Runtime interface for container operations

func NewClient

func NewClient(_ context.Context) (*Client, error)

NewClient creates a new container client

func (*Client) AttachContainer

func (c *Client) AttachContainer(ctx context.Context, containerID string) (io.WriteCloser, io.ReadCloser, error)

AttachContainer implements runtime.Runtime.

func (*Client) BuildImage added in v0.0.10

func (*Client) BuildImage(_ context.Context, _, _ string) error

BuildImage implements runtime.Runtime.

func (*Client) ContainerLogs

func (c *Client) ContainerLogs(ctx context.Context, containerID string) (string, error)

ContainerLogs implements runtime.Runtime.

func (*Client) CreateContainer

func (c *Client) CreateContainer(ctx context.Context,
	image string,
	containerName string,
	command []string,
	envVars map[string]string,
	containerLabels map[string]string,
	_ *permissions.Profile,
	transportType string,
	options *runtime.CreateContainerOptions) (string, error)

CreateContainer implements runtime.Runtime.

func (*Client) GetContainerInfo

func (c *Client) GetContainerInfo(ctx context.Context, containerID string) (runtime.ContainerInfo, error)

GetContainerInfo implements runtime.Runtime.

func (*Client) ImageExists

func (*Client) ImageExists(_ context.Context, imageName string) (bool, error)

ImageExists implements runtime.Runtime.

func (*Client) IsContainerRunning

func (c *Client) IsContainerRunning(ctx context.Context, containerID string) (bool, error)

IsContainerRunning implements runtime.Runtime.

func (*Client) ListContainers

func (c *Client) ListContainers(ctx context.Context) ([]runtime.ContainerInfo, error)

ListContainers implements runtime.Runtime.

func (*Client) PullImage

func (*Client) PullImage(_ context.Context, imageName string) error

PullImage implements runtime.Runtime.

func (*Client) RemoveContainer

func (c *Client) RemoveContainer(ctx context.Context, containerID string) error

RemoveContainer implements runtime.Runtime.

func (*Client) StopContainer

func (*Client) StopContainer(_ context.Context, _ string) error

StopContainer implements runtime.Runtime.

Jump to

Keyboard shortcuts

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