informers

package
v1.9.0-community Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 1, 2025 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

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

type IndexerMock struct {
	mock.Mock
	cache.Indexer
	// contains filtered or unexported fields
}

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 InformerInterface interface {
	cache.SharedInformer
	AddIndexers(indexers cache.Indexers) error
	GetIndexer() cache.Indexer
}

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

func (k *Informers) InitFromConfig(kubeconfig string, infConfig Config, opMetrics *operational.Metrics) error

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

func (o *Mock) InitFromConfig(kubeconfig string, infConfig Config, opMetrics *operational.Metrics) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL