Documentation ¶
Index ¶
- Constants
- func RegisterItems(log *base.LogObject, registry *reconciler.DefaultRegistry, ...) error
- type Adapter
- type AdapterConfigurator
- func (c *AdapterConfigurator) Create(ctx context.Context, item depgraph.Item) error
- func (c *AdapterConfigurator) Delete(ctx context.Context, item depgraph.Item) error
- func (c *AdapterConfigurator) Modify(_ context.Context, _, _ depgraph.Item) (err error)
- func (c *AdapterConfigurator) NeedsRecreate(oldItem, newItem depgraph.Item) (recreate bool)
- type Arp
- type ArpConfigurator
- func (c *ArpConfigurator) Create(ctx context.Context, item depgraph.Item) error
- func (c *ArpConfigurator) Delete(ctx context.Context, item depgraph.Item) error
- func (c *ArpConfigurator) Modify(ctx context.Context, oldItem, newItem depgraph.Item) (err error)
- func (c *ArpConfigurator) NeedsRecreate(oldItem, newItem depgraph.Item) (recreate bool)
- type Bond
- type BondConfigurator
- func (c *BondConfigurator) Create(ctx context.Context, item depgraph.Item) error
- func (c *BondConfigurator) Delete(ctx context.Context, item depgraph.Item) error
- func (c *BondConfigurator) Modify(ctx context.Context, oldItem, newItem depgraph.Item) (err error)
- func (c *BondConfigurator) NeedsRecreate(oldItem, newItem depgraph.Item) (recreate bool)
- type LocalIPRule
- type LocalIPRuleConfigurator
- func (c *LocalIPRuleConfigurator) Create(ctx context.Context, item depgraph.Item) error
- func (c *LocalIPRuleConfigurator) Delete(ctx context.Context, item depgraph.Item) error
- func (c *LocalIPRuleConfigurator) Modify(_ context.Context, _, _ depgraph.Item) (err error)
- func (c *LocalIPRuleConfigurator) NeedsRecreate(oldItem, newItem depgraph.Item) (recreate bool)
- type Route
- type RouteConfigurator
- func (c *RouteConfigurator) Create(ctx context.Context, item depgraph.Item) error
- func (c *RouteConfigurator) Delete(ctx context.Context, item depgraph.Item) error
- func (c *RouteConfigurator) Modify(ctx context.Context, oldItem, newItem depgraph.Item) (err error)
- func (c *RouteConfigurator) NeedsRecreate(oldItem, newItem depgraph.Item) (recreate bool)
- type SrcIPRule
- type SrcIPRuleConfigurator
- func (c *SrcIPRuleConfigurator) Create(ctx context.Context, item depgraph.Item) error
- func (c *SrcIPRuleConfigurator) Delete(ctx context.Context, item depgraph.Item) error
- func (c *SrcIPRuleConfigurator) Modify(_ context.Context, _, _ depgraph.Item) (err error)
- func (c *SrcIPRuleConfigurator) NeedsRecreate(oldItem, newItem depgraph.Item) (recreate bool)
- type Vlan
- type VlanConfigurator
- func (c *VlanConfigurator) Create(ctx context.Context, item depgraph.Item) error
- func (c *VlanConfigurator) Delete(ctx context.Context, item depgraph.Item) error
- func (c *VlanConfigurator) Modify(_ context.Context, _, _ depgraph.Item) (err error)
- func (c *VlanConfigurator) NeedsRecreate(oldItem, newItem depgraph.Item) (recreate bool)
- type WifiConfig
- type Wlan
- type WlanConfigurator
- func (c *WlanConfigurator) Create(ctx context.Context, item depgraph.Item) error
- func (c *WlanConfigurator) Delete(ctx context.Context, item depgraph.Item) error
- func (c *WlanConfigurator) Modify(ctx context.Context, oldItem, newItem depgraph.Item) error
- func (c *WlanConfigurator) NeedsRecreate(oldItem, newItem depgraph.Item) (recreate bool)
Constants ¶
const ( // LocalIPRuleTypename : typename for singleton item representing IP rule for local RT. LocalIPRuleTypename = "Local-IP-Rule" // SrcIPRuleTypename : typename for source-based IP rules. SrcIPRuleTypename = "Src-IP-Rule" )
Variables ¶
This section is empty.
Functions ¶
func RegisterItems ¶
func RegisterItems(log *base.LogObject, registry *reconciler.DefaultRegistry, monitor netmonitor.NetworkMonitor) error
RegisterItems : register all configurators implemented by this package.
Types ¶
type Adapter ¶
type Adapter struct { // LogicalLabel : Note that the adapter and the underlying interface share // the same logical label. Inside EVE both are wrapped by a single NetworkPortConfig. LogicalLabel string // IfName : Name of the interface (as assigned by the OS) to which the adapter // is attached. IfName string // L2Type : link type of the underlying interface. // L2LinkTypeNone is used if adapter is directly attached to a physical interface. L2Type types.L2LinkType }
Adapter : Network adapter (in the EVE's API also known as SystemAdapter).
func (Adapter) Dependencies ¶
func (a Adapter) Dependencies() (deps []depgraph.Dependency)
Dependencies returns underlying lower-layer adapter as the dependency (unless this is physical interface at the lowest layer).
type AdapterConfigurator ¶
type AdapterConfigurator struct { Log *base.LogObject NetworkMonitor netmonitor.NetworkMonitor }
AdapterConfigurator implements Configurator interface (libs/reconciler) for network adapters.
func (*AdapterConfigurator) Create ¶
Create creates a bridge, makes the interface its slave and moves ifName and MAC address of the interface to this bridge.
func (*AdapterConfigurator) Delete ¶
Delete undoes Create - i.e. moves MAC address and ifName back to the interface and removes the bridge.
func (*AdapterConfigurator) NeedsRecreate ¶
func (c *AdapterConfigurator) NeedsRecreate(oldItem, newItem depgraph.Item) (recreate bool)
NeedsRecreate returns true - Modify is not implemented.
type Arp ¶
type Arp struct { // AdapterLL : logical label of the associated adapter. AdapterLL string AdapterIfName string IPAddr net.IP HwAddr net.HardwareAddr }
Arp : static ARP entry.
func (Arp) Dependencies ¶
func (a Arp) Dependencies() (deps []depgraph.Dependency)
Dependencies returns the underlying adapter as the only dependency.
type ArpConfigurator ¶
ArpConfigurator implements Configurator interface (libs/reconciler) for static ARP entries.
func (*ArpConfigurator) NeedsRecreate ¶
func (c *ArpConfigurator) NeedsRecreate(oldItem, newItem depgraph.Item) (recreate bool)
NeedsRecreate returns true - Modify is not implemented.
type Bond ¶
type Bond struct { types.BondConfig // LogicalLabel : logical label used for the Bond interface. LogicalLabel string // IfName : name of the Bond interface in the OS. IfName string // AggregatedIfNames : interface names of PhysicalIO network adapters aggregated // by this bond. AggregatedIfNames []string // Usage : How is the bond being used. // A change in the usage will trigger bond recreate. Usage genericitems.IOUsage // IOUsageBondAggrIf is not applicable }
Bond : Bond interface.
func (Bond) Dependencies ¶
func (b Bond) Dependencies() (deps []depgraph.Dependency)
Dependencies lists all aggregated interfaces as dependencies.
type BondConfigurator ¶
type BondConfigurator struct { Log *base.LogObject NetworkMonitor netmonitor.NetworkMonitor }
BondConfigurator implements Configurator interface (libs/reconciler) for bond interfaces.
func (*BondConfigurator) NeedsRecreate ¶
func (c *BondConfigurator) NeedsRecreate(oldItem, newItem depgraph.Item) (recreate bool)
NeedsRecreate returns true if Bond attributes or Usage have changed. The set of aggregated interfaces can be changed without recreating Bond.
type LocalIPRule ¶
type LocalIPRule struct {
Priority int
}
LocalIPRule : singleton item representing IP rule for local RT This is for both IPv4 and IPv6.
func (LocalIPRule) Dependencies ¶
func (r LocalIPRule) Dependencies() (deps []depgraph.Dependency)
Dependencies returns nothing.
func (LocalIPRule) Equal ¶
func (r LocalIPRule) Equal(other depgraph.Item) bool
Equal only compares the priority to check if it changed.
func (LocalIPRule) Name ¶
func (r LocalIPRule) Name() string
Name returns a constant string - LocalIPRule is a singleton.
func (LocalIPRule) String ¶
func (r LocalIPRule) String() string
String describes the Local IP rule (priority).
type LocalIPRuleConfigurator ¶
LocalIPRuleConfigurator implements Configurator interface (libs/reconciler) for local IP Rule.
func (*LocalIPRuleConfigurator) Create ¶
Create modifies the priority of the (automatically created) local IP rule.
func (*LocalIPRuleConfigurator) Delete ¶
Delete always returns error. NIM never reverts back to the original priority of the local IP rule.
func (*LocalIPRuleConfigurator) NeedsRecreate ¶
func (c *LocalIPRuleConfigurator) NeedsRecreate(oldItem, newItem depgraph.Item) (recreate bool)
NeedsRecreate is not relevant here - neither Modify nor Delete should ever be called for this item.
type Route ¶
type Route struct { netlink.Route // AdapterIfName : name of the interface associated with the route. // Should match with Route.LinkIndex. // Empty if this route is referencing unmanaged link. AdapterIfName string // AdapterLL : logical label of the associated interface. // Empty if this route is referencing unmanaged link. AdapterLL string // True if this route is referencing link not managed by EVE. // It is used by DPC Reconciler to install routes for the bridge cni0 created // and used by Flannel CNI. // Later this will likely go away as we find cleaner solution for integration // between EVE and (possibly any) CNI plugin. UnmanagedLink bool }
Route : Network route.
func (Route) Dependencies ¶
func (r Route) Dependencies() (deps []depgraph.Dependency)
Dependencies of a network route are:
- the "via" adapter must exist and be UP
- the "via" adapter must have an IP address assigned from the subnet of the route gateway.
type RouteConfigurator ¶
RouteConfigurator implements Configurator interface (libs/reconciler) for network routes.
func (*RouteConfigurator) NeedsRecreate ¶
func (c *RouteConfigurator) NeedsRecreate(oldItem, newItem depgraph.Item) (recreate bool)
NeedsRecreate returns true - Modify is not implemented.
type SrcIPRule ¶
type SrcIPRule struct { // AdapterLL : Adapter's logical label. AdapterLL string AdapterIfName string IPAddr net.IP Priority int }
SrcIPRule : IP rule for source-based IP routing.
func (SrcIPRule) Dependencies ¶
func (r SrcIPRule) Dependencies() (deps []depgraph.Dependency)
Dependencies lists the referenced adapter as the only dependency. This dependency is not actually necessary. IP rule can be configured even if the adapter is missing.
type SrcIPRuleConfigurator ¶
type SrcIPRuleConfigurator struct { Log *base.LogObject NetworkMonitor netmonitor.NetworkMonitor }
SrcIPRuleConfigurator implements Configurator interface (libs/reconciler) for IP Rules.
func (*SrcIPRuleConfigurator) NeedsRecreate ¶
func (c *SrcIPRuleConfigurator) NeedsRecreate(oldItem, newItem depgraph.Item) (recreate bool)
NeedsRecreate returns true - Modify is not implemented.
type Vlan ¶
type Vlan struct { // LogicalLabel : logical label used for the VLAN sub-interface. LogicalLabel string // IfName : name of the VLAN sub-interface in the OS. IfName string // ParentLL : Logical label of the parent port. ParentLL string // ParentIfName : name of the parent interface in the OS. ParentIfName string // ParentL2Type : link type of the parent interface (bond or physical). ParentL2Type types.L2LinkType // VLAN ID. ID uint16 }
Vlan : VLAN sub-interface.
func (Vlan) Dependencies ¶
func (v Vlan) Dependencies() (deps []depgraph.Dependency)
Dependencies lists the parent adapter as the only dependency.
type VlanConfigurator ¶
type VlanConfigurator struct { Log *base.LogObject NetworkMonitor netmonitor.NetworkMonitor }
VlanConfigurator implements Configurator interface (libs/reconciler) for VLAN sub-interfaces.
func (*VlanConfigurator) NeedsRecreate ¶
func (c *VlanConfigurator) NeedsRecreate(oldItem, newItem depgraph.Item) (recreate bool)
NeedsRecreate always returns true - Modify is not implemented.
type WifiConfig ¶
type WifiConfig struct { types.WifiConfig Credentials types.EncryptionBlock }
WifiConfig : WiFi configuration.
func (WifiConfig) String ¶
func (wc WifiConfig) String() string
String describes WifiConfig without revealing any sensitive info.
type Wlan ¶
type Wlan struct { Config []WifiConfig // EnableRF : Enable or disable radio transmission. EnableRF bool }
Wlan : WLAN (WiFi) configuration (for WPA supplicant and rfkill). Note that currently only one WiFi adapter per device is supported.
func (Wlan) Dependencies ¶
func (w Wlan) Dependencies() (deps []depgraph.Dependency)
Dependencies returns nothing. Configurator for this config item only installs wpa_supplicant.conf and that has no dependencies.
type WlanConfigurator ¶
WlanConfigurator implements Configurator interface (libs/reconciler) for wpa_supplicant.conf.
func (*WlanConfigurator) NeedsRecreate ¶
func (c *WlanConfigurator) NeedsRecreate(oldItem, newItem depgraph.Item) (recreate bool)
NeedsRecreate returns false - Modify can apply any change.