Documentation ¶
Index ¶
- Constants
- Variables
- func AddressFamiliesMatchConfig(ipv4, ipv6 bool, flag int) (int, bool)
- func AlignInterfacesWithParams(obj *metalv1alpha4.NetworkSwitch)
- func ApplyInterfaceParams(obj *metalv1alpha4.NetworkSwitch, config *metalv1alpha4.SwitchConfig)
- func ApplyInterfacesFromInventory(obj *metalv1alpha4.NetworkSwitch, inventory *metalv1alpha4.Inventory)
- func CalculateASN(loopbacks []*metalv1alpha4.IPAddressSpec) (uint32, error)
- func ComputeAFFlag(ipv4, ipv6 bool, flag int) int
- func ComputeLayer(obj *metalv1alpha4.NetworkSwitch, list *metalv1alpha4.NetworkSwitchList)
- func CreateSampleObject(ctx context.Context, c client.Client, obj client.Object, raw []byte) error
- func GetComputedIPs(obj *metalv1alpha4.NetworkSwitch, name string, ...) ([]*metalv1alpha4.IPAddressSpec, []*ipamv1alpha1.SubnetSpec, error)
- func GetCrdPath(crdPackageScheme interface{}) (string, error)
- func GetExtraIPs(obj *metalv1alpha4.NetworkSwitch, name string) ([]*metalv1alpha4.IPAddressSpec, error)
- func GetPeerData(interfaces map[string]*metalv1alpha4.InterfaceSpec, portDesc, portID string) *metalv1alpha4.InterfaceSpec
- func GetSelectorFromIPAMSpec(obj *metalv1alpha4.NetworkSwitch, spec *metalv1alpha4.IPAMSelectionSpec) (*metav1.LabelSelector, error)
- func GetTestSamples(path string) ([]string, error)
- func GetTotalAddressesCount(ports map[string]*metalv1alpha4.InterfaceSpec, ...) *resource.Quantity
- func GetWebhookPath(crdPackageScheme interface{}) (string, error)
- func IPAMSelectorMatchLabels(obj *metalv1alpha4.NetworkSwitch, sel *metalv1alpha4.IPAMSelectionSpec, ...) bool
- func InheritInterfaceParams(obj *metalv1alpha4.NetworkSwitch, list *metalv1alpha4.NetworkSwitchList)
- func MetadataChanged(objOld, objNew *metalv1alpha4.NetworkSwitch) bool
- func NeighborIsSwitch(nicData *metalv1alpha4.InterfaceSpec) bool
- func ObjectChanged(objOld, objNew *metalv1alpha4.NetworkSwitch) bool
- func ParseInterfaceNameFromSubnet(name string) string
- func RequestIPs(peerNICData *metalv1alpha4.InterfaceSpec) []*metalv1alpha4.IPAddressSpec
- func ResultingLabels(obj *metalv1alpha4.NetworkSwitch, ...) (map[string]string, error)
- func SetRole(in *metalv1alpha4.NetworkSwitch)
- func SpecChanged(objOld, objNew *metalv1alpha4.NetworkSwitch) bool
- func StatusChanged(objOld, objNew *metalv1alpha4.NetworkSwitch) bool
- func SwitchConfigSelectorInvalid(obj *metalv1alpha4.NetworkSwitch) bool
- func UpdateSwitchConfigSelector(obj *metalv1alpha4.NetworkSwitch)
- type StateUpdateEvent
- type StateUpdateFunction
- type StateUpdateResult
- func Initialize(obj *metalv1alpha4.NetworkSwitch, _ *SwitchEnvironment) *StateUpdateResult
- func NewStateUpdateResult() *StateUpdateResult
- func SetStateReady(obj *metalv1alpha4.NetworkSwitch, _ *SwitchEnvironment) *StateUpdateResult
- func UpdateASN(obj *metalv1alpha4.NetworkSwitch, _ *SwitchEnvironment) *StateUpdateResult
- func UpdateConfigRef(obj *metalv1alpha4.NetworkSwitch, env *SwitchEnvironment) *StateUpdateResult
- func UpdateInterfaces(obj *metalv1alpha4.NetworkSwitch, env *SwitchEnvironment) *StateUpdateResult
- func UpdateLayerAndRole(obj *metalv1alpha4.NetworkSwitch, env *SwitchEnvironment) *StateUpdateResult
- func UpdateLoopbacks(obj *metalv1alpha4.NetworkSwitch, env *SwitchEnvironment) *StateUpdateResult
- func UpdateNeighbors(obj *metalv1alpha4.NetworkSwitch, env *SwitchEnvironment) *StateUpdateResult
- func UpdatePortParameters(obj *metalv1alpha4.NetworkSwitch, env *SwitchEnvironment) *StateUpdateResult
- func UpdateSubnets(obj *metalv1alpha4.NetworkSwitch, env *SwitchEnvironment) *StateUpdateResult
- func UpdateSwitchPortIPs(obj *metalv1alpha4.NetworkSwitch, env *SwitchEnvironment) *StateUpdateResult
- func (in *StateUpdateResult) SetCondition(value string) *StateUpdateResult
- func (in *StateUpdateResult) SetError(value error) *StateUpdateResult
- func (in *StateUpdateResult) SetMessage(value string) *StateUpdateResult
- func (in *StateUpdateResult) SetReason(value string) *StateUpdateResult
- func (in *StateUpdateResult) ToEvent() auxiliary.Event
- func (in *StateUpdateResult) Unwrap() (string, string, string, error)
- type SwitchEnvironment
- type SwitchEnvironmentSvc
- func (in *SwitchEnvironmentSvc) GetEnvironment(ctx context.Context, obj *metalv1alpha4.NetworkSwitch) *SwitchEnvironment
- func (in *SwitchEnvironmentSvc) GetInventory(ctx context.Context, obj *metalv1alpha4.NetworkSwitch) *metalv1alpha4.Inventory
- func (in *SwitchEnvironmentSvc) GetLoopbacks(ctx context.Context, obj *metalv1alpha4.NetworkSwitch, ...) *ipamv1alpha1.IPList
- func (in *SwitchEnvironmentSvc) GetSubnets(ctx context.Context, obj *metalv1alpha4.NetworkSwitch, ...) *ipamv1alpha1.SubnetList
- func (in *SwitchEnvironmentSvc) GetSwitchConfig(ctx context.Context, obj *metalv1alpha4.NetworkSwitch) *metalv1alpha4.SwitchConfig
- func (in *SwitchEnvironmentSvc) GetSwitchPortsSubnets(ctx context.Context, obj *metalv1alpha4.NetworkSwitch, ...) *ipamv1alpha1.SubnetList
- func (in *SwitchEnvironmentSvc) GetSwitches(ctx context.Context, obj *metalv1alpha4.NetworkSwitch) *metalv1alpha4.NetworkSwitchList
- func (in *SwitchEnvironmentSvc) ListIPAMObjects(ctx context.Context, obj *metalv1alpha4.NetworkSwitch, ...) error
- type SwitchStateWriter
- func (in *SwitchStateWriter) Environment() *SwitchEnvironment
- func (in *SwitchStateWriter) RegisterStateFunc(f StateUpdateFunction) *SwitchStateWriter
- func (in *SwitchStateWriter) SetEnvironment(env *SwitchEnvironment) *SwitchStateWriter
- func (in *SwitchStateWriter) WriteCondition(o auxiliary.ObjectWithConditions, res auxiliary.Result)
- func (in *SwitchStateWriter) WriteEvent(src runtime.Object, e auxiliary.Event)
- func (in *SwitchStateWriter) WriteState(o client.Object) auxiliary.Result
Constants ¶
View Source
const LLDPCapabilityStation metalv1alpha4.LLDPCapabilities = "Station"
Variables ¶
View Source
var ( // fixme: SONiC switches consider nic's ipv6 address to be a subnet if it is the first (index 0) // address if nic's subnet, which cause an issue with ip address removal. Hence ipv6 address // index should be configurable (cmd flag, spec field and whatnot) BaseIPv4AddressIndex int = 1 BaseIPv6AddressIndex int = 0 )
View Source
var PatchOpts *client.SubResourcePatchOptions = &client.SubResourcePatchOptions{ PatchOptions: client.PatchOptions{ Force: ptr.To(true), FieldManager: constants.SwitchManager, }, }
Functions ¶
func AlignInterfacesWithParams ¶
func AlignInterfacesWithParams(obj *metalv1alpha4.NetworkSwitch)
func ApplyInterfaceParams ¶
func ApplyInterfaceParams(obj *metalv1alpha4.NetworkSwitch, config *metalv1alpha4.SwitchConfig)
func ApplyInterfacesFromInventory ¶
func ApplyInterfacesFromInventory(obj *metalv1alpha4.NetworkSwitch, inventory *metalv1alpha4.Inventory)
func CalculateASN ¶
func CalculateASN(loopbacks []*metalv1alpha4.IPAddressSpec) (uint32, error)
func ComputeAFFlag ¶ added in v0.11.2
func ComputeLayer ¶
func ComputeLayer(obj *metalv1alpha4.NetworkSwitch, list *metalv1alpha4.NetworkSwitchList)
func CreateSampleObject ¶
func GetComputedIPs ¶
func GetComputedIPs( obj *metalv1alpha4.NetworkSwitch, name string, data *metalv1alpha4.InterfaceSpec, ) ([]*metalv1alpha4.IPAddressSpec, []*ipamv1alpha1.SubnetSpec, error)
func GetCrdPath ¶
func GetExtraIPs ¶
func GetExtraIPs(obj *metalv1alpha4.NetworkSwitch, name string) ([]*metalv1alpha4.IPAddressSpec, error)
func GetPeerData ¶
func GetPeerData( interfaces map[string]*metalv1alpha4.InterfaceSpec, portDesc, portID string) *metalv1alpha4.InterfaceSpec
func GetSelectorFromIPAMSpec ¶
func GetSelectorFromIPAMSpec( obj *metalv1alpha4.NetworkSwitch, spec *metalv1alpha4.IPAMSelectionSpec, ) (*metav1.LabelSelector, error)
func GetTestSamples ¶
func GetTotalAddressesCount ¶
func GetTotalAddressesCount( ports map[string]*metalv1alpha4.InterfaceSpec, af ipamv1alpha1.SubnetAddressType) *resource.Quantity
func GetWebhookPath ¶
func IPAMSelectorMatchLabels ¶ added in v0.11.2
func IPAMSelectorMatchLabels( obj *metalv1alpha4.NetworkSwitch, sel *metalv1alpha4.IPAMSelectionSpec, lbl map[string]string, ) bool
func InheritInterfaceParams ¶
func InheritInterfaceParams(obj *metalv1alpha4.NetworkSwitch, list *metalv1alpha4.NetworkSwitchList)
func MetadataChanged ¶
func MetadataChanged(objOld, objNew *metalv1alpha4.NetworkSwitch) bool
func NeighborIsSwitch ¶
func NeighborIsSwitch(nicData *metalv1alpha4.InterfaceSpec) bool
func ObjectChanged ¶
func ObjectChanged(objOld, objNew *metalv1alpha4.NetworkSwitch) bool
func RequestIPs ¶
func RequestIPs(peerNICData *metalv1alpha4.InterfaceSpec) []*metalv1alpha4.IPAddressSpec
func ResultingLabels ¶
func ResultingLabels( obj *metalv1alpha4.NetworkSwitch, objectSelectors, globalSelectors *metalv1alpha4.IPAMSelectionSpec, ) (map[string]string, error)
func SetRole ¶
func SetRole(in *metalv1alpha4.NetworkSwitch)
func SpecChanged ¶
func SpecChanged(objOld, objNew *metalv1alpha4.NetworkSwitch) bool
func StatusChanged ¶
func StatusChanged(objOld, objNew *metalv1alpha4.NetworkSwitch) bool
func SwitchConfigSelectorInvalid ¶
func SwitchConfigSelectorInvalid(obj *metalv1alpha4.NetworkSwitch) bool
func UpdateSwitchConfigSelector ¶
func UpdateSwitchConfigSelector(obj *metalv1alpha4.NetworkSwitch)
Types ¶
type StateUpdateEvent ¶
type StateUpdateEvent struct {
// contains filtered or unexported fields
}
func NewStateUpdateEvent ¶
func NewStateUpdateEvent(eventType, reason, message string) *StateUpdateEvent
type StateUpdateFunction ¶
type StateUpdateFunction func(*metalv1alpha4.NetworkSwitch, *SwitchEnvironment) *StateUpdateResult
type StateUpdateResult ¶
type StateUpdateResult struct {
// contains filtered or unexported fields
}
func Initialize ¶
func Initialize(obj *metalv1alpha4.NetworkSwitch, _ *SwitchEnvironment) *StateUpdateResult
func NewStateUpdateResult ¶
func NewStateUpdateResult() *StateUpdateResult
func SetStateReady ¶
func SetStateReady(obj *metalv1alpha4.NetworkSwitch, _ *SwitchEnvironment) *StateUpdateResult
func UpdateASN ¶
func UpdateASN(obj *metalv1alpha4.NetworkSwitch, _ *SwitchEnvironment) *StateUpdateResult
func UpdateConfigRef ¶
func UpdateConfigRef(obj *metalv1alpha4.NetworkSwitch, env *SwitchEnvironment) *StateUpdateResult
func UpdateInterfaces ¶
func UpdateInterfaces(obj *metalv1alpha4.NetworkSwitch, env *SwitchEnvironment) *StateUpdateResult
func UpdateLayerAndRole ¶
func UpdateLayerAndRole(obj *metalv1alpha4.NetworkSwitch, env *SwitchEnvironment) *StateUpdateResult
func UpdateLoopbacks ¶
func UpdateLoopbacks(obj *metalv1alpha4.NetworkSwitch, env *SwitchEnvironment) *StateUpdateResult
func UpdateNeighbors ¶
func UpdateNeighbors(obj *metalv1alpha4.NetworkSwitch, env *SwitchEnvironment) *StateUpdateResult
func UpdatePortParameters ¶
func UpdatePortParameters(obj *metalv1alpha4.NetworkSwitch, env *SwitchEnvironment) *StateUpdateResult
func UpdateSubnets ¶
func UpdateSubnets(obj *metalv1alpha4.NetworkSwitch, env *SwitchEnvironment) *StateUpdateResult
func UpdateSwitchPortIPs ¶
func UpdateSwitchPortIPs(obj *metalv1alpha4.NetworkSwitch, env *SwitchEnvironment) *StateUpdateResult
func (*StateUpdateResult) SetCondition ¶
func (in *StateUpdateResult) SetCondition(value string) *StateUpdateResult
func (*StateUpdateResult) SetError ¶
func (in *StateUpdateResult) SetError(value error) *StateUpdateResult
func (*StateUpdateResult) SetMessage ¶
func (in *StateUpdateResult) SetMessage(value string) *StateUpdateResult
func (*StateUpdateResult) SetReason ¶
func (in *StateUpdateResult) SetReason(value string) *StateUpdateResult
func (*StateUpdateResult) ToEvent ¶
func (in *StateUpdateResult) ToEvent() auxiliary.Event
type SwitchEnvironment ¶
type SwitchEnvironment struct { Inventory *metalv1alpha4.Inventory Switches *metalv1alpha4.NetworkSwitchList Config *metalv1alpha4.SwitchConfig LoopbackIPs *ipamv1alpha1.IPList SouthSubnets *ipamv1alpha1.SubnetList SwitchPortSubnets *ipamv1alpha1.SubnetList }
type SwitchEnvironmentSvc ¶
type SwitchEnvironmentSvc struct { client.Client Log logr.Logger Env *SwitchEnvironment }
func NewSwitchEnvironmentSvc ¶
func NewSwitchEnvironmentSvc(cl client.Client, log logr.Logger) *SwitchEnvironmentSvc
func (*SwitchEnvironmentSvc) GetEnvironment ¶
func (in *SwitchEnvironmentSvc) GetEnvironment(ctx context.Context, obj *metalv1alpha4.NetworkSwitch) *SwitchEnvironment
func (*SwitchEnvironmentSvc) GetInventory ¶
func (in *SwitchEnvironmentSvc) GetInventory( ctx context.Context, obj *metalv1alpha4.NetworkSwitch, ) *metalv1alpha4.Inventory
func (*SwitchEnvironmentSvc) GetLoopbacks ¶
func (in *SwitchEnvironmentSvc) GetLoopbacks( ctx context.Context, obj *metalv1alpha4.NetworkSwitch, cfg *metalv1alpha4.SwitchConfig, ) *ipamv1alpha1.IPList
func (*SwitchEnvironmentSvc) GetSubnets ¶
func (in *SwitchEnvironmentSvc) GetSubnets( ctx context.Context, obj *metalv1alpha4.NetworkSwitch, cfg *metalv1alpha4.SwitchConfig, ) *ipamv1alpha1.SubnetList
func (*SwitchEnvironmentSvc) GetSwitchConfig ¶
func (in *SwitchEnvironmentSvc) GetSwitchConfig( ctx context.Context, obj *metalv1alpha4.NetworkSwitch, ) *metalv1alpha4.SwitchConfig
func (*SwitchEnvironmentSvc) GetSwitchPortsSubnets ¶
func (in *SwitchEnvironmentSvc) GetSwitchPortsSubnets( ctx context.Context, obj *metalv1alpha4.NetworkSwitch, cfg *metalv1alpha4.SwitchConfig, ) *ipamv1alpha1.SubnetList
func (*SwitchEnvironmentSvc) GetSwitches ¶
func (in *SwitchEnvironmentSvc) GetSwitches( ctx context.Context, obj *metalv1alpha4.NetworkSwitch, ) *metalv1alpha4.NetworkSwitchList
func (*SwitchEnvironmentSvc) ListIPAMObjects ¶
func (in *SwitchEnvironmentSvc) ListIPAMObjects( ctx context.Context, obj *metalv1alpha4.NetworkSwitch, params *metalv1alpha4.IPAMSelectionSpec, list client.ObjectList, ) error
type SwitchStateWriter ¶
type SwitchStateWriter struct {
// contains filtered or unexported fields
}
func NewSwitchStateWriter ¶
func NewSwitchStateWriter( rec record.EventRecorder, ) *SwitchStateWriter
func (*SwitchStateWriter) Environment ¶
func (in *SwitchStateWriter) Environment() *SwitchEnvironment
func (*SwitchStateWriter) RegisterStateFunc ¶
func (in *SwitchStateWriter) RegisterStateFunc(f StateUpdateFunction) *SwitchStateWriter
func (*SwitchStateWriter) SetEnvironment ¶
func (in *SwitchStateWriter) SetEnvironment(env *SwitchEnvironment) *SwitchStateWriter
func (*SwitchStateWriter) WriteCondition ¶
func (in *SwitchStateWriter) WriteCondition(o auxiliary.ObjectWithConditions, res auxiliary.Result)
func (*SwitchStateWriter) WriteEvent ¶
func (in *SwitchStateWriter) WriteEvent(src runtime.Object, e auxiliary.Event)
func (*SwitchStateWriter) WriteState ¶
func (in *SwitchStateWriter) WriteState(o client.Object) auxiliary.Result
Click to show internal directories.
Click to hide internal directories.