Documentation ¶
Index ¶
- type ClientMap
- func (f *ClientMap) AddClient(key clientmap.ClientSetKey, cs kubernetes.Interface) *ClientMap
- func (f *ClientMap) AddRuntimeClient(key clientmap.ClientSetKey, c client.Client) *ClientMap
- func (f *ClientMap) GetClient(_ context.Context, key clientmap.ClientSetKey) (kubernetes.Interface, error)
- func (f *ClientMap) InvalidateClient(key clientmap.ClientSetKey) error
- func (f *ClientMap) Start(_ context.Context) error
- type ClientMapBuilder
- func (b *ClientMapBuilder) Build() *ClientMap
- func (b *ClientMapBuilder) WithClientSetForKey(key clientmap.ClientSetKey, cs kubernetes.Interface) *ClientMapBuilder
- func (b *ClientMapBuilder) WithClientSets(clientSets map[clientmap.ClientSetKey]kubernetes.Interface) *ClientMapBuilder
- func (b *ClientMapBuilder) WithRuntimeClientForKey(key clientmap.ClientSetKey, c client.Client, config *rest.Config) *ClientMapBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientMap ¶
type ClientMap struct {
// contains filtered or unexported fields
}
ClientMap is a simple implementation of clientmap.ClientMap which can be used to fake ClientMaps in unit tests.
func NewClientMapWithClientSets ¶
func NewClientMapWithClientSets(clientSets map[clientmap.ClientSetKey]kubernetes.Interface) *ClientMap
NewClientMapWithClientSets creates a new ClientMap containing the given ClientSets.
func (*ClientMap) AddClient ¶
func (f *ClientMap) AddClient(key clientmap.ClientSetKey, cs kubernetes.Interface) *ClientMap
AddClient adds the given ClientSet to the fake ClientMap with the given key.
func (*ClientMap) AddRuntimeClient ¶
AddRuntimeClient adds a new fake ClientSets containing only the given runtime client to the fake ClientMap with the given key.
func (*ClientMap) GetClient ¶
func (f *ClientMap) GetClient(_ context.Context, key clientmap.ClientSetKey) (kubernetes.Interface, error)
GetClient returns the ClientSet for the given key if present.
func (*ClientMap) InvalidateClient ¶
func (f *ClientMap) InvalidateClient(key clientmap.ClientSetKey) error
InvalidateClient removes the ClientSet for the given key from the ClientMap if present.
type ClientMapBuilder ¶
type ClientMapBuilder struct {
// contains filtered or unexported fields
}
ClientMapBuilder can build a fake ClientMap which can be used to fake ClientMaps in unit tests.
func NewClientMapBuilder ¶
func NewClientMapBuilder() *ClientMapBuilder
NewClientMapBuilder constructs a new ClientMapBuilder.
func (*ClientMapBuilder) Build ¶
func (b *ClientMapBuilder) Build() *ClientMap
Build builds the ClientMap using the provided attributes.
func (*ClientMapBuilder) WithClientSetForKey ¶
func (b *ClientMapBuilder) WithClientSetForKey(key clientmap.ClientSetKey, cs kubernetes.Interface) *ClientMapBuilder
WithClientSetForKey adds a given ClientSet for the given key to the map of ClientSets, that should be contained in the ClientMap.
func (*ClientMapBuilder) WithClientSets ¶
func (b *ClientMapBuilder) WithClientSets(clientSets map[clientmap.ClientSetKey]kubernetes.Interface) *ClientMapBuilder
WithClientSets set the map of ClientSets, that should be contained in the ClientMap.
func (*ClientMapBuilder) WithRuntimeClientForKey ¶
func (b *ClientMapBuilder) WithRuntimeClientForKey(key clientmap.ClientSetKey, c client.Client, config *rest.Config) *ClientMapBuilder
WithRuntimeClientForKey adds a ClientSet containing only the given controller-runtime Client for the given key to the map of ClientSets, that should be contained in the ClientMap.