Documentation
¶
Index ¶
- Variables
- func NewFakeNodeNetworkConfigSpec(requestedIPCount int) nnc.NodeNetworkConfigSpec
- func NewFakeScalar(releaseThreshold, requestThreshold, batchSize int) nnc.Scaler
- type HTTPServiceFake
- func (fake *HTTPServiceFake) GetAllocatedIPConfigs() []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) SetNumberOfAllocatedIPs(desiredAllocatedIPCount 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) (int, string)
- type IPAMPoolMonitorFake
- func (ipm *IPAMPoolMonitorFake) GetStateSnapshot() cns.IpamPoolMonitorStateSnapshot
- func (ipm *IPAMPoolMonitorFake) Reconcile() error
- func (ipm *IPAMPoolMonitorFake) Start(ctx context.Context, poolMonitorRefreshMilliseconds int) error
- func (ipm *IPAMPoolMonitorFake) Update(scalar nnc.Scaler, spec nnc.NodeNetworkConfigSpec) error
- 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 ImdsClientTest
- func (imdsClient *ImdsClientTest) GetNetworkContainerInfoFromHost(networkContainerID string, primaryAddress string, authToken string, ...) (*imdsclient.ContainerVersion, error)
- func (imdsClient *ImdsClientTest) GetNetworkContainerInfoFromHostWithoutToken() int
- func (imdsClient *ImdsClientTest) GetPrimaryInterfaceInfoFromHost() (*imdsclient.InterfaceInfo, error)
- func (imdsClient *ImdsClientTest) GetPrimaryInterfaceInfoFromMemory() (*imdsclient.InterfaceInfo, error)
- type NMAgentClientTest
- type RequestControllerFake
- func (rc *RequestControllerFake) CarveIPConfigsAndAddToStatusAndCNS(numberOfIPConfigs int) []cns.IPConfigurationStatus
- func (rc *RequestControllerFake) Init(context.Context) error
- func (rc *RequestControllerFake) IsStarted() bool
- func (rc *RequestControllerFake) Reconcile() error
- func (rc *RequestControllerFake) Start(context.Context) error
- func (rc *RequestControllerFake) UpdateCRDSpec(_ context.Context, desiredSpec nnc.NodeNetworkConfigSpec) error
- type StringStack
Constants ¶
This section is empty.
Variables ¶
var ( HostPrimaryIpTest = "10.0.0.4" HostSubnetTest = "10.0.0.0/24" )
Functions ¶
func NewFakeNodeNetworkConfigSpec ¶ added in v1.1.8
func NewFakeNodeNetworkConfigSpec(requestedIPCount int) nnc.NodeNetworkConfigSpec
func NewFakeScalar ¶ added in v1.1.8
Types ¶
type HTTPServiceFake ¶
type HTTPServiceFake struct { IPStateManager IPStateManager PoolMonitor cns.IPAMPoolMonitor }
func NewHTTPServiceFake ¶
func NewHTTPServiceFake() *HTTPServiceFake
func (*HTTPServiceFake) GetAllocatedIPConfigs ¶ added in v1.1.8
func (fake *HTTPServiceFake) GetAllocatedIPConfigs() []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) SetNumberOfAllocatedIPs ¶ added in v1.1.8
func (fake *HTTPServiceFake) SetNumberOfAllocatedIPs(desiredAllocatedIPCount 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) (int, string)
type IPAMPoolMonitorFake ¶ added in v1.1.8
type IPAMPoolMonitorFake struct { FakeMinimumIps int FakeMaximumIps int FakeIpsNotInUseCount int FakecachedNNC nnc.NodeNetworkConfig }
func NewIPAMPoolMonitorFake ¶ added in v1.1.8
func NewIPAMPoolMonitorFake() *IPAMPoolMonitorFake
func (*IPAMPoolMonitorFake) GetStateSnapshot ¶ added in v1.2.9
func (ipm *IPAMPoolMonitorFake) GetStateSnapshot() cns.IpamPoolMonitorStateSnapshot
func (*IPAMPoolMonitorFake) Reconcile ¶ added in v1.1.8
func (ipm *IPAMPoolMonitorFake) Reconcile() error
func (*IPAMPoolMonitorFake) Start ¶ added in v1.1.8
func (ipm *IPAMPoolMonitorFake) Start(ctx context.Context, poolMonitorRefreshMilliseconds int) error
func (*IPAMPoolMonitorFake) Update ¶ added in v1.1.8
func (ipm *IPAMPoolMonitorFake) Update(scalar nnc.Scaler, spec nnc.NodeNetworkConfigSpec) error
type IPStateManager ¶
type IPStateManager struct { PendingProgramIPConfigState map[string]cns.IPConfigurationStatus AvailableIPConfigState map[string]cns.IPConfigurationStatus AllocatedIPConfigState 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 ImdsClientTest ¶ added in v1.1.8
type ImdsClientTest struct { }
ImdsClient can be used to connect to VM Host agent in Azure.
func NewFakeImdsClient ¶ added in v1.1.8
func NewFakeImdsClient() *ImdsClientTest
func (*ImdsClientTest) GetNetworkContainerInfoFromHost ¶ added in v1.1.8
func (imdsClient *ImdsClientTest) GetNetworkContainerInfoFromHost(networkContainerID string, primaryAddress string, authToken string, apiVersion string) (*imdsclient.ContainerVersion, error)
GetNetworkContainerInfoFromHost - Mock implementation to return Container version info.
func (*ImdsClientTest) GetNetworkContainerInfoFromHostWithoutToken ¶ added in v1.1.9
func (imdsClient *ImdsClientTest) GetNetworkContainerInfoFromHostWithoutToken() int
GetNetworkContainerInfoFromHostWithoutToken - Mock implementation to return host NMAgent NC version Set it as 0 which is the same as default initial NC version for testing purpose
func (*ImdsClientTest) GetPrimaryInterfaceInfoFromHost ¶ added in v1.1.8
func (imdsClient *ImdsClientTest) GetPrimaryInterfaceInfoFromHost() (*imdsclient.InterfaceInfo, error)
GetPrimaryInterfaceInfoFromHost - Mock implementation to return Host interface info
func (*ImdsClientTest) GetPrimaryInterfaceInfoFromMemory ¶ added in v1.1.8
func (imdsClient *ImdsClientTest) GetPrimaryInterfaceInfoFromMemory() (*imdsclient.InterfaceInfo, error)
GetPrimaryInterfaceInfoFromMemory - Mock implementation to return host interface info
type NMAgentClientTest ¶ added in v1.2.2
type NMAgentClientTest struct { }
NMAgentClientTest can be used to query to VM Host info.
func NewFakeNMAgentClient ¶ added in v1.2.2
func NewFakeNMAgentClient() *NMAgentClientTest
NewFakeNMAgentClient return a mock implemetation of NMAgentClient
func (*NMAgentClientTest) GetNcVersionListWithOutToken ¶ added in v1.2.2
func (nmagentclient *NMAgentClientTest) GetNcVersionListWithOutToken(ncNeedUpdateList []string) map[string]int
GetNcVersionListWithOutToken is mock implementation to return nc version list.
type RequestControllerFake ¶
type RequestControllerFake struct {
// contains filtered or unexported fields
}
func NewRequestControllerFake ¶
func NewRequestControllerFake(cnsService *HTTPServiceFake, scalar nnc.Scaler, subnetAddressSpace string, numberOfIPConfigs int) *RequestControllerFake
func (*RequestControllerFake) CarveIPConfigsAndAddToStatusAndCNS ¶
func (rc *RequestControllerFake) CarveIPConfigsAndAddToStatusAndCNS(numberOfIPConfigs int) []cns.IPConfigurationStatus
func (*RequestControllerFake) IsStarted ¶
func (rc *RequestControllerFake) IsStarted() bool
func (*RequestControllerFake) Reconcile ¶
func (rc *RequestControllerFake) Reconcile() error
func (*RequestControllerFake) UpdateCRDSpec ¶ added in v1.1.8
func (rc *RequestControllerFake) UpdateCRDSpec(_ context.Context, desiredSpec nnc.NodeNetworkConfigSpec) error
type StringStack ¶
type StringStack struct {
// contains filtered or unexported fields
}
func NewStack ¶
func NewStack() *StringStack
func (*StringStack) Pop ¶
func (stack *StringStack) Pop() (string, error)
func (*StringStack) Push ¶
func (stack *StringStack) Push(v string)