Documentation ¶
Index ¶
- Variables
- func ErrorMessageEquals(a, b error) bool
- type MockStore
- func (c *MockStore) Get(ctx context.Context, gvr schema.GroupVersionResource, name string, ...) (runtime.Object, error)
- func (c *MockStore) GetResourceFromCache(ctx context.Context, gvr schema.GroupVersionResource, namespace, name string) (runtime.Object, string, error)
- func (c *MockStore) HasResource(resource schema.GroupVersionResource) bool
- func (c *MockStore) List(ctx context.Context, gvr schema.GroupVersionResource, ...) (runtime.Object, error)
- func (c *MockStore) Stop()
- func (c *MockStore) UpdateCache(resourcesByCluster map[string]map[schema.GroupVersionResource]struct{}) error
- func (c *MockStore) Watch(ctx context.Context, gvr schema.GroupVersionResource, ...) (watch.Interface, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( PodGVK = corev1.SchemeGroupVersion.WithKind("Pod") NodeGVK = corev1.SchemeGroupVersion.WithKind("Node") PodGVR = corev1.SchemeGroupVersion.WithResource("pods") NodeGVR = corev1.SchemeGroupVersion.WithResource("nodes") SecretGVR = corev1.SchemeGroupVersion.WithResource("secret") ClusterGVR = clusterv1alpha1.SchemeGroupVersion.WithResource("cluster") PodSelector = searchv1alpha1.ResourceSelector{APIVersion: PodGVK.GroupVersion().String(), Kind: PodGVK.Kind} NodeSelector = searchv1alpha1.ResourceSelector{APIVersion: NodeGVK.GroupVersion().String(), Kind: NodeGVK.Kind} RestMapper *meta.DefaultRESTMapper )
variables for test
Functions ¶
func ErrorMessageEquals ¶
ErrorMessageEquals compare if two error message is equal. 1. nil error == nil error 2. nil error != non nil error 3. Other wise compare error.Error() returned string
Types ¶
type MockStore ¶
type MockStore struct { UpdateCacheFunc func(resourcesByCluster map[string]map[schema.GroupVersionResource]struct{}) error HasResourceFunc func(resource schema.GroupVersionResource) bool GetResourceFromCacheFunc func(ctx context.Context, gvr schema.GroupVersionResource, namespace, name string) (runtime.Object, string, error) StopFunc func() GetFunc func(ctx context.Context, gvr schema.GroupVersionResource, name string, options *metav1.GetOptions) (runtime.Object, error) ListFunc func(ctx context.Context, gvr schema.GroupVersionResource, options *metainternalversion.ListOptions) (runtime.Object, error) WatchFunc func(ctx context.Context, gvr schema.GroupVersionResource, options *metainternalversion.ListOptions) (watch.Interface, error) }
MockStore is a mock for store.Store interface
func (*MockStore) Get ¶
func (c *MockStore) Get(ctx context.Context, gvr schema.GroupVersionResource, name string, options *metav1.GetOptions) (runtime.Object, error)
Get implements store.Store interface
func (*MockStore) GetResourceFromCache ¶
func (c *MockStore) GetResourceFromCache(ctx context.Context, gvr schema.GroupVersionResource, namespace, name string) (runtime.Object, string, error)
GetResourceFromCache implements store.Store interface
func (*MockStore) HasResource ¶
func (c *MockStore) HasResource(resource schema.GroupVersionResource) bool
HasResource implements store.Store interface
func (*MockStore) List ¶
func (c *MockStore) List(ctx context.Context, gvr schema.GroupVersionResource, options *metainternalversion.ListOptions) (runtime.Object, error)
List implements store.Store interface
func (*MockStore) UpdateCache ¶
func (c *MockStore) UpdateCache(resourcesByCluster map[string]map[schema.GroupVersionResource]struct{}) error
UpdateCache implements store.Store interface
func (*MockStore) Watch ¶
func (c *MockStore) Watch(ctx context.Context, gvr schema.GroupVersionResource, options *metainternalversion.ListOptions) (watch.Interface, error)
Watch implements store.Store interface
Click to show internal directories.
Click to hide internal directories.