Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Container ¶
type Container struct { // Metadata is the metadata of the container, it is **immutable** after created. Metadata sync.RWMutex // contains filtered or unexported fields }
Container contains all resources associated with the container. All methods to mutate the internal state are thread-safe.
func NewContainer ¶
func NewContainer(config *runtime.ContainerConfig, logDirectory, sandboxID string, sandboxBundle *layout.Bundle, imageStore store.Store) (*Container, error)
NewContainer creates an internally used container type.
func (*Container) GetCRIStatus ¶
func (c *Container) GetCRIStatus() *runtime.ContainerStatus
func (*Container) ReopenContainerLog ¶
type Metadata ¶
type Metadata struct { // ID is the container id. ID string // Name is the container name. Name string // SandboxID is the sandbox id the container belongs to. SandboxID string // Config is the CRI container config. // NOTE(random-liu): Resource limits are updatable, the source // of truth for resource limits are in containerd. Config *runtime.ContainerConfig // ImageManifest is the manifest of image used by the container. ImageManifest *kii.Manifest // LogPath is the container log path. LogPath string // StopSignal is the system call signal that will be sent to the container to exit. StopSignal string // RooDirt is the root directory of the container RootDir string }
type Status ¶
type Status struct { // Pid is the init process id of the container. Pid int // CreatedAt is the created timestamp. CreatedAt int64 // StartedAt is the started timestamp. StartedAt int64 // FinishedAt is the finished timestamp. FinishedAt int64 // ExitCode is the container exit code. ExitCode int // CamelCase string explaining why container is in its current state. Reason string // Human-readable message indicating details about why container is in its // current state. Message string // Unknown indicates that the container status is not fully loaded. // This field doesn't need to be checkpointed. Unknown bool `json:"-"` // Released indicates that the container is released. Released bool // Resources has container runtime resource constraints Resources *runtime.ContainerResources }
Status is the status of a container.
func (*Status) State ¶
func (s *Status) State() runtime.ContainerState
State returns current state of the container based on the container status.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store stores all Containers.
func (*Store) Add ¶
Add a container into the store. Returns store.ErrAlreadyExist if the container already exists.
Click to show internal directories.
Click to hide internal directories.