Documentation
¶
Index ¶
- Constants
- func SetupStubs(ipInfo, customKeysInfo, nodes map[string]*model.ResourceMetaData) (Config, *FakeInformers)
- type Config
- type FakeInformers
- type IndexerMock
- func (m *IndexerMock) ByIndex(indexName, indexedValue string) ([]interface{}, error)
- func (m *IndexerMock) FallbackNotFound()
- func (m *IndexerMock) GetByKey(key string) (interface{}, bool, error)
- func (m *IndexerMock) MockNode(ip, name string)
- func (m *IndexerMock) MockPod(ip, mac, intf, name, namespace, nodeIP, ownerName, ownerKind string)
- func (m *IndexerMock) MockReplicaSet(name, namespace, ownerName, ownerKind string)
- func (m *IndexerMock) MockService(ip, name, namespace string)
- type InformerInterface
- type InformerMock
- type Informers
- type InformersInterface
- type Mock
Constants ¶
View Source
const ( IndexCustom = "byCustomKey" IndexIP = "byIP" )
Variables ¶
This section is empty.
Functions ¶
func SetupStubs ¶
func SetupStubs(ipInfo, customKeysInfo, nodes map[string]*model.ResourceMetaData) (Config, *FakeInformers)
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
func NewConfig ¶
func NewConfig(cfg api.NetworkTransformKubeConfig) Config
func (*Config) BuildSecondaryNetworkKeys ¶
func (k *Config) BuildSecondaryNetworkKeys(flow config.GenericMap, rule *api.K8sRule) []cni.SecondaryNetKey
type FakeInformers ¶
type FakeInformers struct { InformersInterface // contains filtered or unexported fields }
func (*FakeInformers) GetNodeByName ¶
func (f *FakeInformers) GetNodeByName(n string) (*model.ResourceMetaData, error)
func (*FakeInformers) IndexLookup ¶
func (f *FakeInformers) IndexLookup(keys []cni.SecondaryNetKey, ip string) *model.ResourceMetaData
func (*FakeInformers) InitFromConfig ¶
func (f *FakeInformers) InitFromConfig(_ string, _ Config, _ *operational.Metrics) error
type IndexerMock ¶
func SetupIndexerMocks ¶
func SetupIndexerMocks(kd *Informers) (pods, nodes, svc, rs *IndexerMock)
func (*IndexerMock) ByIndex ¶
func (m *IndexerMock) ByIndex(indexName, indexedValue string) ([]interface{}, error)
func (*IndexerMock) FallbackNotFound ¶
func (m *IndexerMock) FallbackNotFound()
func (*IndexerMock) GetByKey ¶
func (m *IndexerMock) GetByKey(key string) (interface{}, bool, error)
func (*IndexerMock) MockNode ¶
func (m *IndexerMock) MockNode(ip, name string)
func (*IndexerMock) MockPod ¶
func (m *IndexerMock) MockPod(ip, mac, intf, name, namespace, nodeIP, ownerName, ownerKind string)
func (*IndexerMock) MockReplicaSet ¶
func (m *IndexerMock) MockReplicaSet(name, namespace, ownerName, ownerKind string)
func (*IndexerMock) MockService ¶
func (m *IndexerMock) MockService(ip, name, namespace string)
type InformerInterface ¶
type InformerMock ¶
type InformerMock struct { mock.Mock InformerInterface }
func (*InformerMock) GetIndexer ¶
func (m *InformerMock) GetIndexer() cache.Indexer
type Informers ¶
type Informers struct { InformersInterface // contains filtered or unexported fields }
func (*Informers) GetNodeByName ¶
func (k *Informers) GetNodeByName(name string) (*model.ResourceMetaData, error)
func (*Informers) IndexLookup ¶
func (k *Informers) IndexLookup(potentialKeys []cni.SecondaryNetKey, ip string) *model.ResourceMetaData
func (*Informers) InitFromConfig ¶
type InformersInterface ¶
type InformersInterface interface { IndexLookup([]cni.SecondaryNetKey, string) *model.ResourceMetaData GetNodeByName(string) (*model.ResourceMetaData, error) InitFromConfig(string, Config, *operational.Metrics) error }
type Mock ¶
type Mock struct { mock.Mock InformersInterface }
func NewInformersMock ¶
func NewInformersMock() *Mock
func (*Mock) InitFromConfig ¶
Click to show internal directories.
Click to hide internal directories.