client

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PodMountsDir is the directory where pod volumes are mounted.
	// It is createdinside the cache directory.
	PodMountsDir = "mounts"

	// Timeout for executing post-start command.
	//
	// @note: While pre-stop hook timeout is suppored by simply setting terminationGracePeriodSeconds,
	// as of now k8s does not support setting custom timeout for post-start command at all.
	// Setting this constant as default for now (usually post-start should be something lite anyway).
	PostStartCommandTimeout = 10 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type VirtualizationGroup

type VirtualizationGroup struct {
	MacOSVirtualMachine resource.VirtualMachine
	Containers          []resource.Container
}

VirtualizationGroup represents a group of macOS virtual machines and containers.

type VzClientAPIs

type VzClientAPIs struct {
	MacOSClient     *rm.MacOSClient
	ContainerClient rm.ContainersClient // Optional
	// contains filtered or unexported fields
}

VzClientAPIs is a concrete implementation of VzClientInterface, using MacOSClient and ContainerClient.

func NewVzClientAPIs

func NewVzClientAPIs(ctx context.Context, eventRecorder event.EventRecorder, networkInterfaceIdentifier, cachePath string, dockerCl *docker.Client) (client *VzClientAPIs)

NewVzClientAPIs initializes and returns a new VzClientAPIs instance.

func (*VzClientAPIs) AttachToContainer

func (c *VzClientAPIs) AttachToContainer(ctx context.Context, namespace, podName, containerName string, attach api.AttachIO) (err error)

AttachToContainer attaches to a specified container.

func (*VzClientAPIs) CreateVirtualizationGroup

func (c *VzClientAPIs) CreateVirtualizationGroup(ctx context.Context, pod *corev1.Pod, serviceAccountToken string, configMaps map[string]*corev1.ConfigMap) (err error)

CreateVirtualizationGroup creates a new virtualization group based on the provided Kubernetes pod.

func (*VzClientAPIs) DeleteVirtualizationGroup

func (c *VzClientAPIs) DeleteVirtualizationGroup(ctx context.Context, namespace, name string, gracePeriod int64) (err error)

DeleteVirtualizationGroup deletes an existing virtualization group specified by namespace and name.

func (*VzClientAPIs) ExecuteContainerCommand

func (c *VzClientAPIs) ExecuteContainerCommand(ctx context.Context, namespace, podName, containerName string, cmd []string, attach api.AttachIO) (err error)

ExecuteContainerCommand executes a command inside a specified container.

func (*VzClientAPIs) GetContainerLogs

func (c *VzClientAPIs) GetContainerLogs(ctx context.Context, namespace, podName, containerName string, opts api.ContainerLogOpts) (in io.ReadCloser, err error)

GetContainerLogs retrieves the logs of a specified container in the virtualization group.

func (*VzClientAPIs) GetVirtualizationGroup

func (c *VzClientAPIs) GetVirtualizationGroup(ctx context.Context, namespace, name string) (vg *VirtualizationGroup, err error)

GetVirtualizationGroup retrieves the details of a specified virtualization group.

func (*VzClientAPIs) GetVirtualizationGroupListResult

func (c *VzClientAPIs) GetVirtualizationGroupListResult(ctx context.Context) (l map[types.NamespacedName]*VirtualizationGroup, err error)

GetVirtualizationGroupListResult retrieves a list of all virtualization groups.

type VzClientInterface

type VzClientInterface interface {
	CreateVirtualizationGroup(ctx context.Context, pod *corev1.Pod, serviceAccountToken string, configMaps map[string]*corev1.ConfigMap) error
	DeleteVirtualizationGroup(ctx context.Context, namespace, name string, gracePeriod int64) error
	GetVirtualizationGroup(ctx context.Context, namespace, name string) (*VirtualizationGroup, error)
	GetVirtualizationGroupListResult(ctx context.Context) (map[types.NamespacedName]*VirtualizationGroup, error)
	GetContainerLogs(ctx context.Context, namespace, podName, containerName string, opts api.ContainerLogOpts) (io.ReadCloser, error)
	ExecuteContainerCommand(ctx context.Context, namespace, podName, containerName string, cmd []string, attach api.AttachIO) error
	AttachToContainer(ctx context.Context, namespace, podName, containerName string, attach api.AttachIO) error
}

VzClientInterface defines the methods that a VzClient implementation should provide.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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