run

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2024 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package run provides utils for running contain/container images

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LayerToContainer

func LayerToContainer(layer v1.Layer, target *SyncTarget) error

Types

type Containersync

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

func NewContainersync

func NewContainersync(config *schema.ContainConfig) (*Containersync, error)

func (*Containersync) MatchPod

func (c *Containersync) MatchPod(pod Runpod) *RunpodContainerStatus

MatchPod assumes that a selector was applied at get, and matches on pod status if the pod is a suitable sync target or not

func (*Containersync) PodWait

func (c *Containersync) PodWait(attempt int) (*SyncTarget, error)

func (*Containersync) Run

func (c *Containersync) Run(layers ...v1.Layer) (*SyncTarget, error)

type MatchContainer added in v0.3.2

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

type Runpod

type Runpod struct {
	Metadata RunpodMetadata `json:"metadata"`
	Status   RunpodStatus   `json:"status"`
}

func PodInfo

func PodInfo(config schema.ContainConfigSync) ([]Runpod, error)

type RunpodContainerStatus

type RunpodContainerStatus struct {
	Name         string                     `json:"name"`
	Image        string                     `json:"imageID"`
	Ready        bool                       `json:"ready"`
	RestartCount int                        `json:"restartCount"`
	Started      bool                       `json:"started"`
	State        RunpodContainerStatusState `json:"state"`
}

type RunpodContainerStatusState added in v0.2.3

type RunpodContainerStatusState struct {
	Waiting    RunpodContainerStatusStateWaiting    `json:"waiting"`
	Running    RunpodContainerStatusStateRunning    `json:"running"`
	Terminated RunpodContainerStatusStateTerminated `json:"terminated"`
}

type RunpodContainerStatusStateRunning added in v0.2.3

type RunpodContainerStatusStateRunning struct {
	StartedAt string `json:"startedAt"`
}

type RunpodContainerStatusStateTerminated added in v0.2.3

type RunpodContainerStatusStateTerminated struct {
	ExitCode   int    `json:"exitCode"`
	FinishedAt string `json:"finishedAt"`
	Reason     string `json:"reason"` // for example "Completed"
	StartedAt  string `json:"startedAt"`
}

type RunpodContainerStatusStateWaiting added in v0.2.3

type RunpodContainerStatusStateWaiting struct {
	Reason string `json:"reason"`
}

type RunpodMetadata

type RunpodMetadata struct {
	Name             string `json:"name"`
	Namespace        string `json:"namespace"`
	CreatedTimestamp string `json:"creationTimestamp"`
}

type RunpodStatus

type RunpodStatus struct {
	Phase             string                  `json:"phase"`
	ContainerStatuses []RunpodContainerStatus `json:"containerStatuses"`
}

type SyncTarget

type SyncTarget struct {
	Pod       RunpodMetadata
	Container RunpodContainerStatus
}

Jump to

Keyboard shortcuts

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