Documentation ¶
Index ¶
- func NewFakeMapper(scheme *runtime.Scheme) meta.RESTMapper
- func NewScheme() *runtime.Scheme
- type FakeIndexClient
- func (fc *FakeIndexClient) Create(ctx context.Context, obj client.Object, opts ...client.CreateOption) error
- func (fc *FakeIndexClient) Delete(ctx context.Context, obj client.Object, opts ...client.DeleteOption) error
- func (fc *FakeIndexClient) DeleteAllOf(ctx context.Context, obj client.Object, opts ...client.DeleteAllOfOption) error
- func (fc *FakeIndexClient) Get(ctx context.Context, key client.ObjectKey, obj client.Object) error
- func (fc *FakeIndexClient) List(ctx context.Context, list client.ObjectList, opts ...client.ListOption) error
- func (fc *FakeIndexClient) Patch(ctx context.Context, obj client.Object, patch client.Patch, ...) error
- func (fc *FakeIndexClient) SetIndexValue(gvk schema.GroupVersionKind, index string, value string, objs []runtime.Object)
- func (fc *FakeIndexClient) Update(ctx context.Context, obj client.Object, opts ...client.UpdateOption) error
- type FakeInformer
- func (f *FakeInformer) Add(obj metav1.Object)
- func (f *FakeInformer) AddEventHandler(handler cache.ResourceEventHandler)
- func (f *FakeInformer) AddEventHandlerWithResyncPeriod(handler cache.ResourceEventHandler, resyncPeriod time.Duration)
- func (f *FakeInformer) AddIndexers(indexers cache.Indexers) error
- func (f *FakeInformer) Delete(obj metav1.Object)
- func (f *FakeInformer) GetController() cache.Controller
- func (f *FakeInformer) GetIndexer() cache.Indexer
- func (f *FakeInformer) GetStore() cache.Store
- func (f *FakeInformer) HasSynced() bool
- func (f *FakeInformer) Informer() cache.SharedIndexInformer
- func (f *FakeInformer) LastSyncResourceVersion() string
- func (f *FakeInformer) Run(<-chan struct{})
- func (f *FakeInformer) SetWatchErrorHandler(handler cache.WatchErrorHandler) error
- func (f *FakeInformer) Update(oldObj, newObj metav1.Object)
- type FakeInformers
- func (c *FakeInformers) FakeInformerFor(ctx context.Context, obj client.Object) (*FakeInformer, error)
- func (c *FakeInformers) FakeInformerForKind(ctx context.Context, gvk schema.GroupVersionKind) (*FakeInformer, error)
- func (c *FakeInformers) Get(ctx context.Context, key client.ObjectKey, obj client.Object) error
- func (c *FakeInformers) GetInformer(ctx context.Context, obj client.Object) (cache.Informer, error)
- func (c *FakeInformers) GetInformerForKind(ctx context.Context, gvk schema.GroupVersionKind) (cache.Informer, error)
- func (c *FakeInformers) IndexField(ctx context.Context, obj client.Object, field string, ...) error
- func (c *FakeInformers) List(ctx context.Context, list client.ObjectList, opts ...client.ListOption) error
- func (c *FakeInformers) Start(ctx context.Context) error
- func (c *FakeInformers) WaitForCacheSync(ctx context.Context) bool
- type FakeManager
- func (fm *FakeManager) Add(manager.Runnable) error
- func (fm *FakeManager) AddHealthzCheck(name string, check healthz.Checker) error
- func (fm *FakeManager) AddMetricsExtraHandler(path string, handler http.Handler) error
- func (fm *FakeManager) AddReadyzCheck(name string, check healthz.Checker) error
- func (fm *FakeManager) Elected() <-chan struct{}
- func (fm *FakeManager) GetAPIReader() client.Reader
- func (fm *FakeManager) GetCache() cache.Cache
- func (fm *FakeManager) GetClient() client.Client
- func (fm *FakeManager) GetConfig() *rest.Config
- func (fm *FakeManager) GetEventRecorderFor(name string) record.EventRecorder
- func (fm *FakeManager) GetFieldIndexer() client.FieldIndexer
- func (fm *FakeManager) GetLogger() logr.Logger
- func (fm *FakeManager) GetRESTMapper() meta.RESTMapper
- func (fm *FakeManager) GetScheme() *runtime.Scheme
- func (fm *FakeManager) GetWebhookServer() *webhook.Server
- func (fm *FakeManager) SetFields(interface{}) error
- func (fm *FakeManager) Start(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFakeMapper ¶
func NewFakeMapper(scheme *runtime.Scheme) meta.RESTMapper
NewFakeMapper creates a new fake mapper
Types ¶
type FakeIndexClient ¶
func NewFakeClient ¶
func NewFakeClient(scheme *runtime.Scheme, objs ...runtime.Object) *FakeIndexClient
NewFakeClient creates a new fake client for the standard schema
func (*FakeIndexClient) Create ¶
func (fc *FakeIndexClient) Create(ctx context.Context, obj client.Object, opts ...client.CreateOption) error
func (*FakeIndexClient) Delete ¶
func (fc *FakeIndexClient) Delete(ctx context.Context, obj client.Object, opts ...client.DeleteOption) error
func (*FakeIndexClient) DeleteAllOf ¶
func (fc *FakeIndexClient) DeleteAllOf(ctx context.Context, obj client.Object, opts ...client.DeleteAllOfOption) error
func (*FakeIndexClient) List ¶
func (fc *FakeIndexClient) List(ctx context.Context, list client.ObjectList, opts ...client.ListOption) error
func (*FakeIndexClient) Patch ¶
func (fc *FakeIndexClient) Patch(ctx context.Context, obj client.Object, patch client.Patch, opts ...client.PatchOption) error
func (*FakeIndexClient) SetIndexValue ¶
func (fc *FakeIndexClient) SetIndexValue(gvk schema.GroupVersionKind, index string, value string, objs []runtime.Object)
func (*FakeIndexClient) Update ¶
func (fc *FakeIndexClient) Update(ctx context.Context, obj client.Object, opts ...client.UpdateOption) error
type FakeInformer ¶
type FakeInformer struct { // NotSynced is returned by the HasSynced functions to implement the Informer interface NotSynced bool // RunCount is incremented each time RunInformersAndControllers is called RunCount int // contains filtered or unexported fields }
FakeInformer provides fake Informer functionality for testing
func (*FakeInformer) Add ¶
func (f *FakeInformer) Add(obj metav1.Object)
Add fakes an Add event for obj
func (*FakeInformer) AddEventHandler ¶
func (f *FakeInformer) AddEventHandler(handler cache.ResourceEventHandler)
AddEventHandler implements the Informer interface. Adds an EventHandler to the fake Informers.
func (*FakeInformer) AddEventHandlerWithResyncPeriod ¶
func (f *FakeInformer) AddEventHandlerWithResyncPeriod(handler cache.ResourceEventHandler, resyncPeriod time.Duration)
AddEventHandlerWithResyncPeriod does nothing.
func (*FakeInformer) AddIndexers ¶
func (f *FakeInformer) AddIndexers(indexers cache.Indexers) error
AddIndexers does nothing. TODO(community): Implement this.
func (*FakeInformer) Delete ¶
func (f *FakeInformer) Delete(obj metav1.Object)
Delete fakes an Delete event for obj
func (*FakeInformer) GetController ¶
func (f *FakeInformer) GetController() cache.Controller
GetController does nothing. TODO(community): Implement this.
func (*FakeInformer) GetIndexer ¶
func (f *FakeInformer) GetIndexer() cache.Indexer
GetIndexer does nothing. TODO(community): Implement this.
func (*FakeInformer) GetStore ¶
func (f *FakeInformer) GetStore() cache.Store
GetStore does nothing. TODO(community): Implement this.
func (*FakeInformer) HasSynced ¶
func (f *FakeInformer) HasSynced() bool
HasSynced implements the Informer interface. Returns f.Synced
func (*FakeInformer) Informer ¶
func (f *FakeInformer) Informer() cache.SharedIndexInformer
Informer returns the fake Informer.
func (*FakeInformer) LastSyncResourceVersion ¶
func (f *FakeInformer) LastSyncResourceVersion() string
LastSyncResourceVersion does nothing. TODO(community): Implement this.
func (*FakeInformer) Run ¶
func (f *FakeInformer) Run(<-chan struct{})
Run implements the Informer interface. Increments f.RunCount
func (*FakeInformer) SetWatchErrorHandler ¶
func (f *FakeInformer) SetWatchErrorHandler(handler cache.WatchErrorHandler) error
func (*FakeInformer) Update ¶
func (f *FakeInformer) Update(oldObj, newObj metav1.Object)
Update fakes an Update event for obj
type FakeInformers ¶
type FakeInformers struct { InformersByGVK map[schema.GroupVersionKind]toolscache.SharedIndexInformer Scheme *runtime.Scheme Error error Synced *bool }
FakeInformers is a fake implementation of Informers
func NewFakeCache ¶
func NewFakeCache(scheme *runtime.Scheme) *FakeInformers
NewFakeCache creates a new fake cache
func (*FakeInformers) FakeInformerFor ¶
func (c *FakeInformers) FakeInformerFor(ctx context.Context, obj client.Object) (*FakeInformer, error)
FakeInformerFor implements Informers
func (*FakeInformers) FakeInformerForKind ¶
func (c *FakeInformers) FakeInformerForKind(ctx context.Context, gvk schema.GroupVersionKind) (*FakeInformer, error)
FakeInformerForKind implements Informers
func (*FakeInformers) GetInformer ¶
GetInformer implements Informers
func (*FakeInformers) GetInformerForKind ¶
func (c *FakeInformers) GetInformerForKind(ctx context.Context, gvk schema.GroupVersionKind) (cache.Informer, error)
GetInformerForKind implements Informers
func (*FakeInformers) IndexField ¶
func (c *FakeInformers) IndexField(ctx context.Context, obj client.Object, field string, extractValue client.IndexerFunc) error
IndexField implements Cache
func (*FakeInformers) List ¶
func (c *FakeInformers) List(ctx context.Context, list client.ObjectList, opts ...client.ListOption) error
List implements Cache
func (*FakeInformers) Start ¶
func (c *FakeInformers) Start(ctx context.Context) error
Start implements Informers
func (*FakeInformers) WaitForCacheSync ¶
func (c *FakeInformers) WaitForCacheSync(ctx context.Context) bool
WaitForCacheSync implements Informers
type FakeManager ¶
type FakeManager struct { Scheme *runtime.Scheme Client client.Client Cache *FakeInformers Mapper meta.RESTMapper }
func NewFakeManager ¶
func NewFakeManager() *FakeManager
func (*FakeManager) AddHealthzCheck ¶
func (fm *FakeManager) AddHealthzCheck(name string, check healthz.Checker) error
func (*FakeManager) AddMetricsExtraHandler ¶
func (fm *FakeManager) AddMetricsExtraHandler(path string, handler http.Handler) error
func (*FakeManager) AddReadyzCheck ¶
func (fm *FakeManager) AddReadyzCheck(name string, check healthz.Checker) error
func (*FakeManager) Elected ¶
func (fm *FakeManager) Elected() <-chan struct{}
func (*FakeManager) GetAPIReader ¶
func (fm *FakeManager) GetAPIReader() client.Reader
func (*FakeManager) GetCache ¶
func (fm *FakeManager) GetCache() cache.Cache
func (*FakeManager) GetClient ¶
func (fm *FakeManager) GetClient() client.Client
func (*FakeManager) GetConfig ¶
func (fm *FakeManager) GetConfig() *rest.Config
func (*FakeManager) GetEventRecorderFor ¶
func (fm *FakeManager) GetEventRecorderFor(name string) record.EventRecorder
func (*FakeManager) GetFieldIndexer ¶
func (fm *FakeManager) GetFieldIndexer() client.FieldIndexer
func (*FakeManager) GetLogger ¶
func (fm *FakeManager) GetLogger() logr.Logger
func (*FakeManager) GetRESTMapper ¶
func (fm *FakeManager) GetRESTMapper() meta.RESTMapper
func (*FakeManager) GetScheme ¶
func (fm *FakeManager) GetScheme() *runtime.Scheme
func (*FakeManager) GetWebhookServer ¶
func (fm *FakeManager) GetWebhookServer() *webhook.Server
func (*FakeManager) SetFields ¶
func (fm *FakeManager) SetFields(interface{}) error