testidentity

package
v1.10.16 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DummyIdentityNotifier

type DummyIdentityNotifier struct {
	// contains filtered or unexported fields
}

func NewDummyIdentityNotifier

func NewDummyIdentityNotifier() *DummyIdentityNotifier

func (*DummyIdentityNotifier) Lock

func (d *DummyIdentityNotifier) Lock()

Lock must be held during any calls to RegisterForIdentityUpdatesLocked or UnregisterForIdentityUpdatesLocked.

func (*DummyIdentityNotifier) MapSelectorsToIPsLocked

func (d *DummyIdentityNotifier) MapSelectorsToIPsLocked(fqdnSelectors map[api.FQDNSelector]struct{}) (selectorsMissingIPs []api.FQDNSelector, selectorIPMapping map[api.FQDNSelector][]net.IP)

MapSelectorsToIPsLocked is a dummy implementation that does not implement the selectors of the real implementation.

func (*DummyIdentityNotifier) RegisterForIdentityUpdatesLocked

func (d *DummyIdentityNotifier) RegisterForIdentityUpdatesLocked(selector api.FQDNSelector)

RegisterForIdentityUpdatesLocked starts managing this selector.

It doesn't implement the identity allocation semantics of the interface.

func (*DummyIdentityNotifier) Unlock

func (d *DummyIdentityNotifier) Unlock()

Unlock must be called after calls to RegisterForIdentityUpdatesLocked or UnregisterForIdentityUpdatesLocked are done.

func (*DummyIdentityNotifier) UnregisterForIdentityUpdatesLocked

func (d *DummyIdentityNotifier) UnregisterForIdentityUpdatesLocked(selector api.FQDNSelector)

UnregisterForIdentityUpdatesLocked stops managing this selector.

type FakeIdentityAllocator added in v1.10.6

type FakeIdentityAllocator struct {
	cache.IdentityCache
}

FakeIdentityAllocator is used as a mock identity allocator for unit tests.

func NewFakeIdentityAllocator added in v1.10.6

func NewFakeIdentityAllocator(c cache.IdentityCache) *FakeIdentityAllocator

func (*FakeIdentityAllocator) AllocateCIDRsForIPs added in v1.10.6

func (f *FakeIdentityAllocator) AllocateCIDRsForIPs(IPs []net.IP, newlyAllocatedIdentities map[string]*identity.Identity) ([]*identity.Identity, error)

func (*FakeIdentityAllocator) AllocateIdentity added in v1.10.6

AllocateIdentity does nothing.

func (*FakeIdentityAllocator) GetIdentities added in v1.10.6

func (f *FakeIdentityAllocator) GetIdentities() cache.IdentitiesModel

func (*FakeIdentityAllocator) GetIdentityCache added in v1.10.6

func (f *FakeIdentityAllocator) GetIdentityCache() cache.IdentityCache

func (*FakeIdentityAllocator) LookupIdentity added in v1.10.6

func (f *FakeIdentityAllocator) LookupIdentity(ctx context.Context, lbls labels.Labels) *identity.Identity

LookupIdentity is a no-op.

func (*FakeIdentityAllocator) LookupIdentityByID added in v1.10.6

LookupIdentityByID returns the identity corresponding to the id if the identity is a reserved identity. Otherwise, returns nil.

func (*FakeIdentityAllocator) Release added in v1.10.6

func (f *FakeIdentityAllocator) Release(context.Context, *identity.Identity, bool) (released bool, err error)

Release does nothing.

func (*FakeIdentityAllocator) ReleaseCIDRIdentitiesByID added in v1.10.6

func (f *FakeIdentityAllocator) ReleaseCIDRIdentitiesByID(ctx context.Context, identities []identity.NumericIdentity)

func (*FakeIdentityAllocator) ReleaseSlice added in v1.10.6

ReleaseSlice does nothing.

func (*FakeIdentityAllocator) WaitForInitialGlobalIdentities added in v1.10.6

func (f *FakeIdentityAllocator) WaitForInitialGlobalIdentities(context.Context) error

WaitForInitialGlobalIdentities does nothing.

type IdentityAllocatorOwnerMock

type IdentityAllocatorOwnerMock struct{}

func (*IdentityAllocatorOwnerMock) GetNodeSuffix

func (i *IdentityAllocatorOwnerMock) GetNodeSuffix() string

func (*IdentityAllocatorOwnerMock) UpdateIdentities

func (i *IdentityAllocatorOwnerMock) UpdateIdentities(added, deleted cache.IdentityCache)

Jump to

Keyboard shortcuts

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