Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FDClient ¶
type FDClient struct {
// contains filtered or unexported fields
}
FDClient can be used to connect to an FDServer listening on a Unix domain socket
func NewFDClient ¶
NewFDClient returns an FDClient for specified socket path
func (*FDClient) AddFDs ¶ added in v0.9.4
AddFDs requests the FDServer to add a new file descriptor using its FDSource. It returns the CSN which is returned by FDSource's GetFDs() call
func (*FDClient) Connect ¶
Connect makes FDClient connect to its socket. You must call Connect() method to be able to use the FDClient
func (*FDClient) GetFDs ¶ added in v0.9.4
GetFDs requests file descriptors from the FDServer. It returns a list of file descriptors which is valid for current process and any associated data that was returned from FDSource's GetInfo() call
func (*FDClient) ReleaseFDs ¶ added in v0.9.4
ReleaseFDs makes FDServer to close the file descriptor and destroy any associated resources
type FDManager ¶
type FDManager interface { AddFDs(key string, data interface{}) ([]byte, error) ReleaseFDs(key string) error }
FDManager denotes an object that provides 'master'-side functionality of FDClient
type FDServer ¶
FDServer listens on a Unix domain socket, serving requests to create, destroy and obtain file descriptors. It serves the purpose of sending the file descriptors across mount namespace boundaries, as well as making it easier to work around the Go namespace problem (to be fixed in Go 1.10): https://www.weave.works/blog/linux-namespaces-and-go-don-t-mix When the Go namespace problem is resolved, it should be possible to dumb down FDServer by making it only serve GetFDs() requests, performing other actions within the process boundary.
func NewFDServer ¶
NewFDServer returns an FDServer for the specified socket path and an FDSource
type FDSource ¶
type FDSource interface { // GetFDs sets up a file descriptors based on key // and extra data. It should return the file descriptor list, // any data that should be passed back to the client // invoking AddFDs() and an error, if any. GetFDs(key string, data []byte) ([]int, []byte, error) // Release destroys (closes) the file descriptor and // any associated resources Release(key string) error // GetInfo returns the information which needs to be // propagated back the FDClient upon GetFDs() call GetInfo(key string) ([]byte, error) }
FDSource denotes an 'executive' part for FDServer which creates and destroys (closes) the file descriptors and associated resources
type GetFDPayload ¶
type GetFDPayload struct { // Description specifies pod network description for already // prepared network configuration Description *PodNetworkDesc `json:"podNetworkDesc"` // ContainerSideNetwork specifies configuration used to configure retaken // environment ContainerSideNetwork *network.ContainerSideNetwork `json:"csn"` }
GetFDPayload contains the data that are required by TapFDSource to recover the tap device that was already configured, or create a new one if CNIConfig is nil
type InterfaceDescription ¶ added in v0.9.4
type InterfaceDescription struct { Type network.InterfaceType `json:"type"` HardwareAddr net.HardwareAddr `json:"mac"` FdIndex int `json:"fdIndex"` PCIAddress string `json:"pciAddress"` }
InterfaceDescription contains interface type with additional data needed to identify it
type PodNetworkDesc ¶
type PodNetworkDesc struct { // PodId specifies the id of the pod PodId string `json:"podId"` // PodNs specifies the namespace of the pod PodNs string `json:"podNs"` // PodName specifies the name of the pod PodName string `json:"podName"` // DNS specifies DNS settings for the pod DNS *cnitypes.DNS }
PodNetworkDesc contains the data that are required by TapFDSource to set up a tap device for a VM
type TapFDSource ¶
TapFDSource sets up and tears down Virtlet VM network. It implements FDSource interface
func NewTapFDSource ¶
func NewTapFDSource(cniClient cni.CNIClient) (*TapFDSource, error)
NewTapFDSource returns a TapFDSource for the specified CNI plugin & config dir
func (*TapFDSource) GetInfo ¶
func (s *TapFDSource) GetInfo(key string) ([]byte, error)
GetInfo implements GetInfo method of FDSource interface
func (*TapFDSource) Release ¶
func (s *TapFDSource) Release(key string) error
Release implements Release method of FDSource interface