Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainerToStoreUpdateFunc ¶
func ContainerToStoreUpdateFunc(u ContainerUpdateFunc) store.UpdateFunc
ContainerToStoreUpdateFunc generates a metadata store UpdateFunc from ContainerUpdateFunc.
func IsNotExistError ¶
IsNotExistError is a helper function to check whether the error returned by metadata store is not exist error.
Types ¶
type ContainerMetadata ¶
type ContainerMetadata struct { // ID is the container id. ID string // Name is the container name. Name string // SandboxID is the sandbox id the container belongs to, // also use as libvirt domain id. SandboxID string // Config is the CRI container config. Config *kubeapi.ContainerConfig // ImageRef is the reference of image used by the container. ImageRef string // CreatedAt is the created timestamp. CreatedAt int64 // StartedAt is the started timestamp. StartedAt int64 // FinishedAt is the finished timestamp. FinishedAt int64 // 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 // LogPath is path relative to sandbox's log directory for container to store logs. LogPath string }
ContainerMetadata is the unversioned container metadata.
func (*ContainerMetadata) State ¶
func (c *ContainerMetadata) State() kubeapi.ContainerState
State returns current state of the container based on the metadata.
type ContainerStore ¶
type ContainerStore interface { // Create creates a container from ContainerMetadata in the store. Create(ContainerMetadata) error // Get gets a specified container. Get(string) (*ContainerMetadata, error) // Update updates a specified container. Update(string, ContainerUpdateFunc) error // List lists all containers. List() ([]*ContainerMetadata, error) // Delete deletes the container from the store. Delete(string) error }
ContainerStore is the store for metadata of all containers.
func NewContainerStore ¶
func NewContainerStore(store store.MetadataStore) ContainerStore
NewContainerStore creates a ContainerStore from a basic MetadataStore.
type ContainerUpdateFunc ¶
type ContainerUpdateFunc func(ContainerMetadata) (ContainerMetadata, error)
ContainerUpdateFunc is the function used to update ContainerMetadata.
type SandboxMetadata ¶
type SandboxMetadata struct { // ID is the sandbox id. ID string // Name is the sandbox name. Name string // Config is the CRI sandbox config. Config *kubeapi.PodSandboxConfig // CreatedAt is the created timestamp. CreatedAt int64 // NetConfig is the cni network config used by the sandbox. NetConfig []byte // VMConfig is the vm config. VMConfig *VMMetadata // State is CRI state of sandbox State kubeapi.PodSandboxState // LogDir is where sandbox's log stores. LogDir string }
SandboxMetadata is the unversioned sandbox metadata.
type SandboxStore ¶
type SandboxStore interface { // Create creates a sandbox from SandboxMetadata in the store. Create(SandboxMetadata) error // Get gets the specified sandbox. Get(string) (*SandboxMetadata, error) // Update updates a specified sandbox. Update(string, SandboxUpdateFunc) error // List lists all sandboxes. List() ([]*SandboxMetadata, error) // Delete deletes the sandbox from the store. Delete(string) error }
SandboxStore is the store for metadata of all sandboxes.
func NewSandboxStore ¶
func NewSandboxStore(store store.MetadataStore) SandboxStore
NewSandboxStore creates a SandboxStore from a basic MetadataStore.
type SandboxUpdateFunc ¶
type SandboxUpdateFunc func(SandboxMetadata) (SandboxMetadata, error)
SandboxUpdateFunc is the function used to update SandboxMetadata.
type VMMetadata ¶
type VMMetadata struct { // CPUNum is the vcpu num of VM CPUNum int32 // Memory is the size of memory in MB Memory int32 }
VMMetadata is the vm metadata.