Documentation ¶
Index ¶
- type DummyIdentityNotifier
- func (d *DummyIdentityNotifier) Lock()
- func (d *DummyIdentityNotifier) MapSelectorsToIPsLocked(fqdnSelectors map[api.FQDNSelector]struct{}) (selectorsMissingIPs []api.FQDNSelector, ...)
- func (d *DummyIdentityNotifier) RegisterForIdentityUpdatesLocked(selector api.FQDNSelector)
- func (d *DummyIdentityNotifier) Unlock()
- func (d *DummyIdentityNotifier) UnregisterForIdentityUpdatesLocked(selector api.FQDNSelector)
- type FakeIdentityAllocator
- func (f *FakeIdentityAllocator) AllocateCIDRsForIPs(IPs []net.IP, newlyAllocatedIdentities map[string]*identity.Identity) ([]*identity.Identity, error)
- func (f *FakeIdentityAllocator) AllocateIdentity(context.Context, labels.Labels, bool, identity.NumericIdentity) (*identity.Identity, bool, error)
- func (f *FakeIdentityAllocator) GetIdentities() cache.IdentitiesModel
- func (f *FakeIdentityAllocator) GetIdentityCache() cache.IdentityCache
- func (f *FakeIdentityAllocator) LookupIdentity(ctx context.Context, lbls labels.Labels) *identity.Identity
- func (f *FakeIdentityAllocator) LookupIdentityByID(ctx context.Context, id identity.NumericIdentity) *identity.Identity
- func (f *FakeIdentityAllocator) Release(context.Context, *identity.Identity, bool) (released bool, err error)
- func (f *FakeIdentityAllocator) ReleaseCIDRIdentitiesByID(ctx context.Context, identities []identity.NumericIdentity)
- func (f *FakeIdentityAllocator) ReleaseSlice(context.Context, cache.IdentityAllocatorOwner, []*identity.Identity) error
- func (f *FakeIdentityAllocator) WaitForInitialGlobalIdentities(context.Context) error
- type IdentityAllocatorOwnerMock
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 (*FakeIdentityAllocator) AllocateIdentity ¶ added in v1.10.6
func (f *FakeIdentityAllocator) AllocateIdentity(context.Context, labels.Labels, bool, identity.NumericIdentity) (*identity.Identity, bool, error)
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
func (f *FakeIdentityAllocator) LookupIdentityByID(ctx context.Context, id identity.NumericIdentity) *identity.Identity
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
func (f *FakeIdentityAllocator) ReleaseSlice(context.Context, cache.IdentityAllocatorOwner, []*identity.Identity) error
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)