Documentation ¶
Index ¶
- Constants
- type HTTPServiceFake
- func (fake *HTTPServiceFake) GetAssignedIPConfigs() []cns.IPConfigurationStatus
- func (fake *HTTPServiceFake) GetAvailableIPConfigs() []cns.IPConfigurationStatus
- func (fake *HTTPServiceFake) GetOption(string) interface{}
- func (fake *HTTPServiceFake) GetPendingProgramIPConfigs() []cns.IPConfigurationStatus
- func (fake *HTTPServiceFake) GetPendingReleaseIPConfigs() []cns.IPConfigurationStatus
- func (fake *HTTPServiceFake) GetPodIPConfigState() map[string]cns.IPConfigurationStatus
- func (fake *HTTPServiceFake) Init(*common.ServiceConfig) error
- func (fake *HTTPServiceFake) MarkIPAsPendingRelease(numberToMark int) (map[string]cns.IPConfigurationStatus, error)
- func (fake *HTTPServiceFake) SendNCSnapShotPeriodically(context.Context, int)
- func (fake *HTTPServiceFake) SetNodeOrchestrator(*cns.SetOrchestratorTypeRequest)
- func (fake *HTTPServiceFake) SetNumberOfAssignedIPs(assign int) error
- func (fake *HTTPServiceFake) SetOption(string, interface{})
- func (fake *HTTPServiceFake) Start(*common.ServiceConfig) error
- func (fake *HTTPServiceFake) Stop()
- func (fake *HTTPServiceFake) SyncHostNCVersion(context.Context, string, time.Duration)
- func (fake *HTTPServiceFake) SyncNodeStatus(string, string, string, json.RawMessage) (types.ResponseCode, string)
- type IPStateManager
- func (ipm *IPStateManager) AddIPConfigs(ipconfigs []cns.IPConfigurationStatus)
- func (ipm *IPStateManager) MarkIPAsPendingRelease(numberOfIPsToMark int) (map[string]cns.IPConfigurationStatus, error)
- func (ipm *IPStateManager) ReleaseIPConfig(ipconfigID string) (cns.IPConfigurationStatus, error)
- func (ipm *IPStateManager) RemovePendingReleaseIPConfigs(ipconfigNames []string)
- func (ipm *IPStateManager) ReserveIPConfig() (cns.IPConfigurationStatus, error)
- type MonitorFake
- type NMAgentClientFake
- type RequestControllerFake
- func (rc *RequestControllerFake) CarveIPConfigsAndAddToStatusAndCNS(numberOfIPConfigs int64) []cns.IPConfigurationStatus
- func (rc *RequestControllerFake) Init(context.Context) error
- func (rc *RequestControllerFake) IsStarted() bool
- func (rc *RequestControllerFake) Reconcile(removePendingReleaseIPs bool) error
- func (rc *RequestControllerFake) Start(context.Context) error
- type StringStack
- type WireserverClientFake
Constants ¶
View Source
const ( // HostPrimaryIP 10.0.0.4 HostPrimaryIP = "10.0.0.4" // HostSubnet 10.0.0.0/24 HostSubnet = "10.0.0.0/24" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPServiceFake ¶
type HTTPServiceFake struct { IPStateManager IPStateManager PoolMonitor cns.IPAMPoolMonitor }
func NewHTTPServiceFake ¶
func NewHTTPServiceFake() *HTTPServiceFake
func (*HTTPServiceFake) GetAssignedIPConfigs ¶
func (fake *HTTPServiceFake) GetAssignedIPConfigs() []cns.IPConfigurationStatus
func (*HTTPServiceFake) GetAvailableIPConfigs ¶
func (fake *HTTPServiceFake) GetAvailableIPConfigs() []cns.IPConfigurationStatus
func (*HTTPServiceFake) GetOption ¶
func (fake *HTTPServiceFake) GetOption(string) interface{}
func (*HTTPServiceFake) GetPendingProgramIPConfigs ¶
func (fake *HTTPServiceFake) GetPendingProgramIPConfigs() []cns.IPConfigurationStatus
func (*HTTPServiceFake) GetPendingReleaseIPConfigs ¶
func (fake *HTTPServiceFake) GetPendingReleaseIPConfigs() []cns.IPConfigurationStatus
func (*HTTPServiceFake) GetPodIPConfigState ¶
func (fake *HTTPServiceFake) GetPodIPConfigState() map[string]cns.IPConfigurationStatus
Return union of all state maps
func (*HTTPServiceFake) Init ¶
func (fake *HTTPServiceFake) Init(*common.ServiceConfig) error
func (*HTTPServiceFake) MarkIPAsPendingRelease ¶
func (fake *HTTPServiceFake) MarkIPAsPendingRelease(numberToMark int) (map[string]cns.IPConfigurationStatus, error)
TODO: Populate on scale down
func (*HTTPServiceFake) SendNCSnapShotPeriodically ¶
func (fake *HTTPServiceFake) SendNCSnapShotPeriodically(context.Context, int)
func (*HTTPServiceFake) SetNodeOrchestrator ¶
func (fake *HTTPServiceFake) SetNodeOrchestrator(*cns.SetOrchestratorTypeRequest)
func (*HTTPServiceFake) SetNumberOfAssignedIPs ¶
func (fake *HTTPServiceFake) SetNumberOfAssignedIPs(assign int) error
func (*HTTPServiceFake) SetOption ¶
func (fake *HTTPServiceFake) SetOption(string, interface{})
func (*HTTPServiceFake) Start ¶
func (fake *HTTPServiceFake) Start(*common.ServiceConfig) error
func (*HTTPServiceFake) Stop ¶
func (fake *HTTPServiceFake) Stop()
func (*HTTPServiceFake) SyncHostNCVersion ¶
SyncHostNCVersion will update HostVersion in containerstatus.
func (*HTTPServiceFake) SyncNodeStatus ¶
func (fake *HTTPServiceFake) SyncNodeStatus(string, string, string, json.RawMessage) (types.ResponseCode, string)
type IPStateManager ¶
type IPStateManager struct { PendingProgramIPConfigState map[string]cns.IPConfigurationStatus AvailableIPConfigState map[string]cns.IPConfigurationStatus AssignedIPConfigState map[string]cns.IPConfigurationStatus PendingReleaseIPConfigState map[string]cns.IPConfigurationStatus AvailableIPIDStack StringStack sync.RWMutex }
func NewIPStateManager ¶
func NewIPStateManager() IPStateManager
func (*IPStateManager) AddIPConfigs ¶
func (ipm *IPStateManager) AddIPConfigs(ipconfigs []cns.IPConfigurationStatus)
func (*IPStateManager) MarkIPAsPendingRelease ¶
func (ipm *IPStateManager) MarkIPAsPendingRelease(numberOfIPsToMark int) (map[string]cns.IPConfigurationStatus, error)
func (*IPStateManager) ReleaseIPConfig ¶
func (ipm *IPStateManager) ReleaseIPConfig(ipconfigID string) (cns.IPConfigurationStatus, error)
func (*IPStateManager) RemovePendingReleaseIPConfigs ¶
func (ipm *IPStateManager) RemovePendingReleaseIPConfigs(ipconfigNames []string)
func (*IPStateManager) ReserveIPConfig ¶
func (ipm *IPStateManager) ReserveIPConfig() (cns.IPConfigurationStatus, error)
type MonitorFake ¶
type MonitorFake struct { IPsNotInUseCount int64 NodeNetworkConfig *v1alpha.NodeNetworkConfig }
func (*MonitorFake) GetStateSnapshot ¶
func (f *MonitorFake) GetStateSnapshot() cns.IpamPoolMonitorStateSnapshot
func (*MonitorFake) Reconcile ¶
func (*MonitorFake) Reconcile() error
func (*MonitorFake) Update ¶
func (f *MonitorFake) Update(nnc *v1alpha.NodeNetworkConfig) error
type NMAgentClientFake ¶
type NMAgentClientFake struct {
GetNCVersionListFunc func(context.Context) (*nmagent.NetworkContainerListResponse, error)
}
NMAgentClientFake can be used to query to VM Host info.
func (*NMAgentClientFake) GetNCVersionList ¶
func (c *NMAgentClientFake) GetNCVersionList(ctx context.Context) (*nmagent.NetworkContainerListResponse, error)
GetNcVersionListWithOutToken is mock implementation to return nc version list.
type RequestControllerFake ¶
type RequestControllerFake struct { NNC *v1alpha.NodeNetworkConfig // contains filtered or unexported fields }
func NewRequestControllerFake ¶
func NewRequestControllerFake(cnsService *HTTPServiceFake, scalar v1alpha.Scaler, subnetAddressSpace string, numberOfIPConfigs int64) *RequestControllerFake
func (*RequestControllerFake) CarveIPConfigsAndAddToStatusAndCNS ¶
func (rc *RequestControllerFake) CarveIPConfigsAndAddToStatusAndCNS(numberOfIPConfigs int64) []cns.IPConfigurationStatus
func (*RequestControllerFake) IsStarted ¶
func (rc *RequestControllerFake) IsStarted() bool
func (*RequestControllerFake) Reconcile ¶
func (rc *RequestControllerFake) Reconcile(removePendingReleaseIPs bool) error
type StringStack ¶
func NewStack ¶
func NewStack() *StringStack
func (*StringStack) Pop ¶
func (stack *StringStack) Pop() (string, error)
func (*StringStack) Push ¶
func (stack *StringStack) Push(v string)
type WireserverClientFake ¶
type WireserverClientFake struct{}
func (*WireserverClientFake) GetInterfaces ¶
func (c *WireserverClientFake) GetInterfaces(ctx context.Context) (*wireserver.GetInterfacesResult, error)
Click to show internal directories.
Click to hide internal directories.