Documentation
¶
Index ¶
- Variables
- type DesiredDevice
- func (dd *DesiredDevice) Clone() *DesiredDevice
- func (dd *DesiredDevice) GetKey() DesiredDeviceKey
- func (dd *DesiredDevice) GetStatus() reconciler.Status
- func (dd *DesiredDevice) SetStatus(s reconciler.Status) *DesiredDevice
- func (dd *DesiredDevice) TableHeader() []string
- func (dd *DesiredDevice) TableRow() []string
- func (dd *DesiredDevice) Validate() error
- type DesiredDeviceKey
- type DesiredDeviceSpec
- type DesiredVLANDeviceSpec
- type DeviceOwner
- type Initializer
- type ManagerOperations
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DesiredDeviceIndex = statedb.Index[*DesiredDevice, DesiredDeviceKey]{ Name: "id", FromObject: func(obj *DesiredDevice) index.KeySet { return index.NewKeySet(obj.GetKey().Key()) }, FromKey: DesiredDeviceKey.Key, FromString: index.FromString, Unique: true, } DesiredDeviceNameIndex = statedb.Index[*DesiredDevice, string]{ Name: "name", FromObject: func(obj *DesiredDevice) index.KeySet { return index.NewKeySet(index.String(obj.Name)) }, FromKey: index.String, FromString: index.FromString, Unique: true, } )
View Source
var Cell = cell.Module( "device-reconciler", "Reconciles desired devices to the Linux kernel links", TableCell, cell.Provide(newDeviceManager), cell.Invoke(registerReconciler), )
View Source
var (
ErrOwnerDoesNotExist = errors.New("owner does not exist")
)
View Source
var TableCell = cell.Group( cell.ProvidePrivate(newDesiredDeviceTable), cell.Provide(statedb.RWTable[*DesiredDevice].ToTable), )
Functions ¶
This section is empty.
Types ¶
type DesiredDevice ¶
type DesiredDevice struct {
Owner DeviceOwner `json:"owner" yaml:"owner"`
Name string `json:"name" yaml:"name"`
DeviceSpec DesiredDeviceSpec `json:"spec" yaml:"spec"`
// contains filtered or unexported fields
}
func (*DesiredDevice) Clone ¶
func (dd *DesiredDevice) Clone() *DesiredDevice
func (*DesiredDevice) GetKey ¶
func (dd *DesiredDevice) GetKey() DesiredDeviceKey
func (*DesiredDevice) GetStatus ¶
func (dd *DesiredDevice) GetStatus() reconciler.Status
func (*DesiredDevice) SetStatus ¶
func (dd *DesiredDevice) SetStatus(s reconciler.Status) *DesiredDevice
func (*DesiredDevice) TableHeader ¶
func (dd *DesiredDevice) TableHeader() []string
func (*DesiredDevice) TableRow ¶
func (dd *DesiredDevice) TableRow() []string
func (*DesiredDevice) Validate ¶
func (dd *DesiredDevice) Validate() error
type DesiredDeviceKey ¶
type DesiredDeviceKey struct {
Owner DeviceOwner
Name string
}
func (DesiredDeviceKey) Key ¶
func (k DesiredDeviceKey) Key() index.Key
func (*DesiredDeviceKey) MarshalBinary ¶
func (k *DesiredDeviceKey) MarshalBinary() ([]byte, error)
func (DesiredDeviceKey) String ¶
func (k DesiredDeviceKey) String() string
func (*DesiredDeviceKey) UnmarshalBinary ¶
func (k *DesiredDeviceKey) UnmarshalBinary(data []byte) error
type DesiredDeviceSpec ¶
type DesiredVLANDeviceSpec ¶
type DesiredVLANDeviceSpec struct {
Name string `json:"name" yaml:"name"`
VLANID int `json:"vlanID" yaml:"vlanID"`
MTU int `json:"mtu" yaml:"mtu"`
ParentName string `json:"parentName" yaml:"parentName"`
ParentIndex int
}
func (*DesiredVLANDeviceSpec) MarshalJSON ¶
func (d *DesiredVLANDeviceSpec) MarshalJSON() ([]byte, error)
func (*DesiredVLANDeviceSpec) MarshalYAML ¶
func (d *DesiredVLANDeviceSpec) MarshalYAML() (any, error)
func (*DesiredVLANDeviceSpec) Properties ¶
func (d *DesiredVLANDeviceSpec) Properties() string
type DeviceOwner ¶
type DeviceOwner struct {
Name string `json:"name" yaml:"name"`
}
type Initializer ¶
type Initializer struct {
// contains filtered or unexported fields
}
type ManagerOperations ¶
type ManagerOperations interface {
// UpsertDevice upserts a desired device into the desired device table.
UpsertDevice(device DesiredDevice) error
// UpsertDeviceWait upserts a desired device into the desired device table
// and waits for the device to be reconciled.
UpsertDeviceWait(device DesiredDevice, timeout time.Duration) error
// DeleteDevice deletes a desired device from the desired device table.
DeleteDevice(device DesiredDevice) error
// GetOrRegisterOwner gets or registers an owner with the given name.
GetOrRegisterOwner(name string) DeviceOwner
// RemoveOwner removes an owner and associated devices with the given owner.
RemoveOwner(owner DeviceOwner) error
// RegisterInitializer registers an initializer with the given name and returns
// the initializer to the caller.
RegisterInitializer(name string) Initializer
// FinalizeInitializer should be called by the caller with registered initializer
// once callers initial sync is completed. Once all initializers are finalized,
// the reconciler will start initial pruning.
FinalizeInitializer(initializer Initializer)
}
ManagerOperations is the interface for the desired device reconciler manager
Click to show internal directories.
Click to hide internal directories.