Documentation ¶
Overview ¶
Package resources handles creating, updating, and releasing resources on a container
Index ¶
- func ReleaseResources(ctx context.Context, r *Resources, vm *uvm.UtilityVM, all bool) error
- type ResourceCloser
- type Resources
- func (r *Resources) Add(newResources ...ResourceCloser)
- func (r *Resources) ContainerRootInUVM() string
- func (r *Resources) LcowScratchPath() string
- func (r *Resources) NetNS() string
- func (r *Resources) SetAddedNetNSToVM(addedNetNSToVM bool)
- func (r *Resources) SetContainerRootInUVM(containerRootInUVM string)
- func (r *Resources) SetCreatedNetNS(created bool)
- func (r *Resources) SetLayers(l ResourceCloser)
- func (r *Resources) SetLcowScratchPath(scratchPath string)
- func (r *Resources) SetNetNS(netNS string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReleaseResources ¶
ReleaseResources releases/frees all of the resources associated with a container. This includes Plan9 shares, vsmb mounts, pipe mounts, network endpoints, scsi mounts, vpci devices and layers. TODO: make method on Resources struct.
Types ¶
type ResourceCloser ¶
ResourceCloser is a generic interface for the releasing of a resource. If a resource implements this interface(which they all should), freeing of that resource should entail one call to <resourceName>.Release(ctx)
type Resources ¶
type Resources struct {
// contains filtered or unexported fields
}
Resources is the structure returned as part of creating a container. It holds nothing useful to clients, hence everything is lowercased. A client would use it in a call to ReleaseResources to ensure everything is cleaned up when a container exits.
func NewContainerResources ¶
NewContainerResources returns a new empty container Resources struct with the given container id
func (*Resources) Add ¶
func (r *Resources) Add(newResources ...ResourceCloser)
Add adds one or more resource closers to the resources struct to be tracked for release later on
func (*Resources) ContainerRootInUVM ¶
ContainerRootInUVM returns the containerRootInUVM for the container
func (*Resources) LcowScratchPath ¶ added in v0.10.0
func (*Resources) SetAddedNetNSToVM ¶
SetAddedNetNSToVM updates the container resource's AddedNetNSToVM value
func (*Resources) SetContainerRootInUVM ¶
SetContainerRootInUVM updates the container resource's containerRootInUVM value
func (*Resources) SetCreatedNetNS ¶
SetCreatedNetNS updates the container resource's CreatedNetNS value
func (*Resources) SetLayers ¶
func (r *Resources) SetLayers(l ResourceCloser)
SetLayers updates the container resource's image layers