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) Merge(_ types.Device)
- 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) Merge ¶
func (d DummyDevice) Merge(_ types.Device)
Merge is a no-op for DummyDevice: its KernelIfName always mirrors Name and is never derived from live host state, so nothing can be lost on rescan.
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) RestoreDevice ¶
func (mgr *DummyManager) RestoreDevice(data []byte) (types.Device, error)
func (*DummyManager) Run ¶
Run publishes the synthesised dummy devices once, then blocks until ctx is cancelled. Dummy devices are static — derived purely from config — so a single publish at startup is sufficient.
func (*DummyManager) Type ¶
func (mgr *DummyManager) Type() types.DeviceManagerType