Documentation
¶
Index ¶
- type DummyDevice
- func (d DummyDevice) Free(cfg types.DeviceConfig) error
- func (d DummyDevice) GetAttrs() map[resourceapi.QualifiedName]resourceapi.DeviceAttribute
- func (d DummyDevice) IfName() string
- func (d DummyDevice) KernelIfName() string
- func (d DummyDevice) MarshalBinary() (data []byte, err error)
- func (d DummyDevice) Match(filter v2alpha1.CiliumNetworkDriverDeviceFilter) bool
- func (d DummyDevice) Setup(cfg types.DeviceConfig) error
- func (d *DummyDevice) UnmarshalBinary(data []byte) error
- type DummyManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DummyDevice ¶
func (DummyDevice) Free ¶
func (d DummyDevice) Free(cfg types.DeviceConfig) error
Free deletes the dummy link. This is best-effort cleanup for a device that was created by Setup but never attached to a pod (e.g. the pod failed to start after prepare): once the interface is moved into a pod netns and that netns is reaped, the kernel destroys the dummy automatically, so the root-namespace lookup here simply finds nothing and returns nil.
func (DummyDevice) GetAttrs ¶
func (d DummyDevice) GetAttrs() map[resourceapi.QualifiedName]resourceapi.DeviceAttribute
func (DummyDevice) IfName ¶
func (d DummyDevice) IfName() string
func (DummyDevice) KernelIfName ¶
func (d DummyDevice) KernelIfName() string
func (DummyDevice) MarshalBinary ¶
func (d DummyDevice) MarshalBinary() (data []byte, err error)
func (DummyDevice) Match ¶
func (d DummyDevice) Match(filter v2alpha1.CiliumNetworkDriverDeviceFilter) bool
func (DummyDevice) Setup ¶
func (d DummyDevice) Setup(cfg types.DeviceConfig) error
Setup creates the dummy link in the root network namespace. The caller (RunPodSandbox) subsequently moves it into the pod netns.
netlink.LinkAdd uses NLM_F_EXCL and is therefore not idempotent: it returns EEXIST if the interface already exists. On EEXIST we adopt the existing device when it is a dummy (e.g. a leftover from a prior, partially-completed allocation), otherwise we delete and recreate it so we never adopt a stale device of the wrong type.
func (*DummyDevice) UnmarshalBinary ¶
func (d *DummyDevice) UnmarshalBinary(data []byte) error
type DummyManager ¶
type DummyManager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager(logger *slog.Logger, cfg *v2alpha1.DummyDeviceManagerConfig) (*DummyManager, error)
func (*DummyManager) ListDevices ¶
func (mgr *DummyManager) ListDevices() ([]types.Device, error)
ListDevices advertises the dummy devices derived from configuration.
Like macvlan, dummy links are virtual devices that this driver owns: they do not exist in the kernel until a claim is allocated and Device.Setup creates one. ListDevices therefore does not scan the kernel; it synthesises Count discrete devices named dummy0..dummy<Count-1> so DRA can advertise and allocate them. The (Count+1)th claim stays Pending.
func (*DummyManager) RestoreDevice ¶
func (mgr *DummyManager) RestoreDevice(data []byte) (types.Device, error)
func (*DummyManager) Type ¶
func (mgr *DummyManager) Type() types.DeviceManagerType