package sandbox
import "github.com/containerd/cri/pkg/store/sandbox"
Index ¶
- Variables
- type Metadata
- func (c *Metadata) MarshalJSON() ([]byte, error)
- func (c *Metadata) UnmarshalJSON(data []byte) error
- type NetNS
- func LoadNetNS(path string) (*NetNS, error)
- func NewNetNS() (*NetNS, error)
- func (n *NetNS) GetPath() string
- func (n *NetNS) Remove() error
- type Sandbox
- type Store
Variables ¶
ErrClosedNetNS is the error returned when network namespace is closed.
Types ¶
type Metadata ¶
type Metadata struct { // ID is the sandbox id. ID string // Name is the sandbox name. Name string // Config is the CRI sandbox config. Config *runtime.PodSandboxConfig // NetNSPath is the network namespace used by the sandbox. NetNSPath string }
Metadata is the unversioned sandbox metadata.
func (*Metadata) MarshalJSON ¶
MarshalJSON encodes Metadata into bytes in json format.
func (*Metadata) UnmarshalJSON ¶
UnmarshalJSON decodes Metadata from bytes.
type NetNS ¶
NetNS holds network namespace for sandbox
func LoadNetNS ¶
LoadNetNS loads existing network namespace. It returns ErrClosedNetNS if the network namespace has already been closed.
func NewNetNS ¶
NewNetNS creates a network namespace for the sandbox
func (*NetNS) GetPath ¶
GetPath returns network namespace path for sandbox container
func (*NetNS) Remove ¶
Remove removes network namepace if it exists and not closed. Remove is idempotent, meaning it might be invoked multiple times and provides consistent result.
type Sandbox ¶
type Sandbox struct { // Metadata is the metadata of the sandbox, it is immutable after created. Metadata // Container is the containerd sandbox container client Container containerd.Container // CNI network namespace client NetNS *NetNS }
Sandbox contains all resources associated with the sandbox. All methods to mutate the internal state are thread safe.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store stores all sandboxes.
func NewStore ¶
func NewStore() *Store
NewStore creates a sandbox store.
func (*Store) Add ¶
Add a sandbox into the store.
func (*Store) Delete ¶
Delete deletes the sandbox with specified id.
func (*Store) Get ¶
Get returns the sandbox with specified id. Returns nil if the sandbox doesn't exist.
func (*Store) List ¶
List lists all sandboxes.
Source Files ¶
metadata.go netns.go sandbox.go
- Version
- v1.0.0-alpha.1
- Published
- Oct 31, 2017
- Platform
- js/wasm
- Imports
- 13 packages
- Last checked
- 4 hours ago –
Tools for package owners.