|
|
|
@@ -21,21 +21,25 @@ type fakeExecutorType struct {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (f *fakeExecutorType) Run(context.Context, manager.Interface) {}
|
|
|
|
|
func (f *fakeExecutorType) GetTypeName(context.Context) fv1.ExecutorType { return fv1.ExecutorTypePoolmgr }
|
|
|
|
|
func (f *fakeExecutorType) GetTypeName(context.Context) fv1.ExecutorType {
|
|
|
|
|
return fv1.ExecutorTypePoolmgr
|
|
|
|
|
}
|
|
|
|
|
func (f *fakeExecutorType) GetFuncSvc(context.Context, *fv1.Function) (*fscache.FuncSvc, error) {
|
|
|
|
|
return nil, nil
|
|
|
|
|
}
|
|
|
|
|
func (f *fakeExecutorType) GetFuncSvcFromCache(context.Context, *fv1.Function) (*fscache.FuncSvc, error) {
|
|
|
|
|
return nil, nil
|
|
|
|
|
}
|
|
|
|
|
func (f *fakeExecutorType) DumpDebugInfo(context.Context) error { return nil }
|
|
|
|
|
func (f *fakeExecutorType) DeleteFuncSvcFromCache(context.Context, *fscache.FuncSvc) {}
|
|
|
|
|
func (f *fakeExecutorType) TapService(context.Context, string) error { return nil }
|
|
|
|
|
func (f *fakeExecutorType) UnTapService(context.Context, *metav1.ObjectMeta, string) {}
|
|
|
|
|
func (f *fakeExecutorType) DumpDebugInfo(context.Context) error { return nil }
|
|
|
|
|
func (f *fakeExecutorType) DeleteFuncSvcFromCache(context.Context, *fscache.FuncSvc) {}
|
|
|
|
|
func (f *fakeExecutorType) TapService(context.Context, string) error { return nil }
|
|
|
|
|
func (f *fakeExecutorType) UnTapService(context.Context, *metav1.ObjectMeta, string) {}
|
|
|
|
|
func (f *fakeExecutorType) MarkSpecializationFailure(context.Context, *metav1.ObjectMeta) {}
|
|
|
|
|
func (f *fakeExecutorType) IsValid(context.Context, *fscache.FuncSvc) bool { return true }
|
|
|
|
|
func (f *fakeExecutorType) RefreshFuncPods(context.Context, *zap.Logger, fv1.Function) error { return nil }
|
|
|
|
|
func (f *fakeExecutorType) AdoptExistingResources(context.Context) {}
|
|
|
|
|
func (f *fakeExecutorType) IsValid(context.Context, *fscache.FuncSvc) bool { return true }
|
|
|
|
|
func (f *fakeExecutorType) RefreshFuncPods(context.Context, *zap.Logger, fv1.Function) error {
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
func (f *fakeExecutorType) AdoptExistingResources(context.Context) {}
|
|
|
|
|
func (f *fakeExecutorType) CleanupOldExecutorObjects(context.Context) {}
|
|
|
|
|
func (f *fakeExecutorType) AddNamespace(ctx context.Context, ns string, mgr manager.Interface) error {
|
|
|
|
|
f.addCalls++
|
|
|
|
@@ -62,7 +66,7 @@ func TestRegisterExecutorTypes(t *testing.T) {
|
|
|
|
|
|
|
|
|
|
func TestRegisterExecutorTypesAggregatesErrors(t *testing.T) {
|
|
|
|
|
err := registerExecutorTypes(context.Background(), zap.NewNop(), "tenant-executor-a", map[fv1.ExecutorType]executortype.ExecutorType{
|
|
|
|
|
fv1.ExecutorTypePoolmgr: &fakeExecutorType{addErr: errors.New("poolmgr failed")},
|
|
|
|
|
fv1.ExecutorTypePoolmgr: &fakeExecutorType{addErr: errors.New("poolmgr failed")},
|
|
|
|
|
fv1.ExecutorTypeContainer: &fakeExecutorType{},
|
|
|
|
|
}, nil)
|
|
|
|
|
if err == nil {
|
|
|
|
@@ -71,4 +75,4 @@ func TestRegisterExecutorTypesAggregatesErrors(t *testing.T) {
|
|
|
|
|
if err.Error() != "poolmgr failed" {
|
|
|
|
|
t.Fatalf("unexpected error: %v", err)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|