mirror of
https://github.com/rancher/types.git
synced 2025-09-12 13:03:45 +00:00
go generate
This commit is contained in:
@@ -141,14 +141,16 @@ func (mock *JobListerMock) ListCalls() []struct {
|
||||
}
|
||||
|
||||
var (
|
||||
lockJobControllerMockAddClusterScopedHandler sync.RWMutex
|
||||
lockJobControllerMockAddHandler sync.RWMutex
|
||||
lockJobControllerMockEnqueue sync.RWMutex
|
||||
lockJobControllerMockGeneric sync.RWMutex
|
||||
lockJobControllerMockInformer sync.RWMutex
|
||||
lockJobControllerMockLister sync.RWMutex
|
||||
lockJobControllerMockStart sync.RWMutex
|
||||
lockJobControllerMockSync sync.RWMutex
|
||||
lockJobControllerMockAddClusterScopedFeatureHandler sync.RWMutex
|
||||
lockJobControllerMockAddClusterScopedHandler sync.RWMutex
|
||||
lockJobControllerMockAddFeatureHandler sync.RWMutex
|
||||
lockJobControllerMockAddHandler sync.RWMutex
|
||||
lockJobControllerMockEnqueue sync.RWMutex
|
||||
lockJobControllerMockGeneric sync.RWMutex
|
||||
lockJobControllerMockInformer sync.RWMutex
|
||||
lockJobControllerMockLister sync.RWMutex
|
||||
lockJobControllerMockStart sync.RWMutex
|
||||
lockJobControllerMockSync sync.RWMutex
|
||||
)
|
||||
|
||||
// Ensure, that JobControllerMock does implement JobController.
|
||||
@@ -161,9 +163,15 @@ var _ v1a.JobController = &JobControllerMock{}
|
||||
//
|
||||
// // make and configure a mocked JobController
|
||||
// mockedJobController := &JobControllerMock{
|
||||
// AddClusterScopedFeatureHandlerFunc: func(ctx context.Context, enabled func() bool, name string, clusterName string, handler v1a.JobHandlerFunc) {
|
||||
// panic("mock out the AddClusterScopedFeatureHandler method")
|
||||
// },
|
||||
// AddClusterScopedHandlerFunc: func(ctx context.Context, name string, clusterName string, handler v1a.JobHandlerFunc) {
|
||||
// panic("mock out the AddClusterScopedHandler method")
|
||||
// },
|
||||
// AddFeatureHandlerFunc: func(ctx context.Context, enabled func() bool, name string, sync v1a.JobHandlerFunc) {
|
||||
// panic("mock out the AddFeatureHandler method")
|
||||
// },
|
||||
// AddHandlerFunc: func(ctx context.Context, name string, handler v1a.JobHandlerFunc) {
|
||||
// panic("mock out the AddHandler method")
|
||||
// },
|
||||
@@ -192,9 +200,15 @@ var _ v1a.JobController = &JobControllerMock{}
|
||||
//
|
||||
// }
|
||||
type JobControllerMock struct {
|
||||
// AddClusterScopedFeatureHandlerFunc mocks the AddClusterScopedFeatureHandler method.
|
||||
AddClusterScopedFeatureHandlerFunc func(ctx context.Context, enabled func() bool, name string, clusterName string, handler v1a.JobHandlerFunc)
|
||||
|
||||
// AddClusterScopedHandlerFunc mocks the AddClusterScopedHandler method.
|
||||
AddClusterScopedHandlerFunc func(ctx context.Context, name string, clusterName string, handler v1a.JobHandlerFunc)
|
||||
|
||||
// AddFeatureHandlerFunc mocks the AddFeatureHandler method.
|
||||
AddFeatureHandlerFunc func(ctx context.Context, enabled func() bool, name string, sync v1a.JobHandlerFunc)
|
||||
|
||||
// AddHandlerFunc mocks the AddHandler method.
|
||||
AddHandlerFunc func(ctx context.Context, name string, handler v1a.JobHandlerFunc)
|
||||
|
||||
@@ -218,6 +232,19 @@ type JobControllerMock struct {
|
||||
|
||||
// calls tracks calls to the methods.
|
||||
calls struct {
|
||||
// AddClusterScopedFeatureHandler holds details about calls to the AddClusterScopedFeatureHandler method.
|
||||
AddClusterScopedFeatureHandler []struct {
|
||||
// Ctx is the ctx argument value.
|
||||
Ctx context.Context
|
||||
// Enabled is the enabled argument value.
|
||||
Enabled func() bool
|
||||
// Name is the name argument value.
|
||||
Name string
|
||||
// ClusterName is the clusterName argument value.
|
||||
ClusterName string
|
||||
// Handler is the handler argument value.
|
||||
Handler v1a.JobHandlerFunc
|
||||
}
|
||||
// AddClusterScopedHandler holds details about calls to the AddClusterScopedHandler method.
|
||||
AddClusterScopedHandler []struct {
|
||||
// Ctx is the ctx argument value.
|
||||
@@ -229,6 +256,17 @@ type JobControllerMock struct {
|
||||
// Handler is the handler argument value.
|
||||
Handler v1a.JobHandlerFunc
|
||||
}
|
||||
// AddFeatureHandler holds details about calls to the AddFeatureHandler method.
|
||||
AddFeatureHandler []struct {
|
||||
// Ctx is the ctx argument value.
|
||||
Ctx context.Context
|
||||
// Enabled is the enabled argument value.
|
||||
Enabled func() bool
|
||||
// Name is the name argument value.
|
||||
Name string
|
||||
// Sync is the sync argument value.
|
||||
Sync v1a.JobHandlerFunc
|
||||
}
|
||||
// AddHandler holds details about calls to the AddHandler method.
|
||||
AddHandler []struct {
|
||||
// Ctx is the ctx argument value.
|
||||
@@ -269,6 +307,53 @@ type JobControllerMock struct {
|
||||
}
|
||||
}
|
||||
|
||||
// AddClusterScopedFeatureHandler calls AddClusterScopedFeatureHandlerFunc.
|
||||
func (mock *JobControllerMock) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name string, clusterName string, handler v1a.JobHandlerFunc) {
|
||||
if mock.AddClusterScopedFeatureHandlerFunc == nil {
|
||||
panic("JobControllerMock.AddClusterScopedFeatureHandlerFunc: method is nil but JobController.AddClusterScopedFeatureHandler was just called")
|
||||
}
|
||||
callInfo := struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
ClusterName string
|
||||
Handler v1a.JobHandlerFunc
|
||||
}{
|
||||
Ctx: ctx,
|
||||
Enabled: enabled,
|
||||
Name: name,
|
||||
ClusterName: clusterName,
|
||||
Handler: handler,
|
||||
}
|
||||
lockJobControllerMockAddClusterScopedFeatureHandler.Lock()
|
||||
mock.calls.AddClusterScopedFeatureHandler = append(mock.calls.AddClusterScopedFeatureHandler, callInfo)
|
||||
lockJobControllerMockAddClusterScopedFeatureHandler.Unlock()
|
||||
mock.AddClusterScopedFeatureHandlerFunc(ctx, enabled, name, clusterName, handler)
|
||||
}
|
||||
|
||||
// AddClusterScopedFeatureHandlerCalls gets all the calls that were made to AddClusterScopedFeatureHandler.
|
||||
// Check the length with:
|
||||
// len(mockedJobController.AddClusterScopedFeatureHandlerCalls())
|
||||
func (mock *JobControllerMock) AddClusterScopedFeatureHandlerCalls() []struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
ClusterName string
|
||||
Handler v1a.JobHandlerFunc
|
||||
} {
|
||||
var calls []struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
ClusterName string
|
||||
Handler v1a.JobHandlerFunc
|
||||
}
|
||||
lockJobControllerMockAddClusterScopedFeatureHandler.RLock()
|
||||
calls = mock.calls.AddClusterScopedFeatureHandler
|
||||
lockJobControllerMockAddClusterScopedFeatureHandler.RUnlock()
|
||||
return calls
|
||||
}
|
||||
|
||||
// AddClusterScopedHandler calls AddClusterScopedHandlerFunc.
|
||||
func (mock *JobControllerMock) AddClusterScopedHandler(ctx context.Context, name string, clusterName string, handler v1a.JobHandlerFunc) {
|
||||
if mock.AddClusterScopedHandlerFunc == nil {
|
||||
@@ -312,6 +397,49 @@ func (mock *JobControllerMock) AddClusterScopedHandlerCalls() []struct {
|
||||
return calls
|
||||
}
|
||||
|
||||
// AddFeatureHandler calls AddFeatureHandlerFunc.
|
||||
func (mock *JobControllerMock) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync v1a.JobHandlerFunc) {
|
||||
if mock.AddFeatureHandlerFunc == nil {
|
||||
panic("JobControllerMock.AddFeatureHandlerFunc: method is nil but JobController.AddFeatureHandler was just called")
|
||||
}
|
||||
callInfo := struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
Sync v1a.JobHandlerFunc
|
||||
}{
|
||||
Ctx: ctx,
|
||||
Enabled: enabled,
|
||||
Name: name,
|
||||
Sync: sync,
|
||||
}
|
||||
lockJobControllerMockAddFeatureHandler.Lock()
|
||||
mock.calls.AddFeatureHandler = append(mock.calls.AddFeatureHandler, callInfo)
|
||||
lockJobControllerMockAddFeatureHandler.Unlock()
|
||||
mock.AddFeatureHandlerFunc(ctx, enabled, name, sync)
|
||||
}
|
||||
|
||||
// AddFeatureHandlerCalls gets all the calls that were made to AddFeatureHandler.
|
||||
// Check the length with:
|
||||
// len(mockedJobController.AddFeatureHandlerCalls())
|
||||
func (mock *JobControllerMock) AddFeatureHandlerCalls() []struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
Sync v1a.JobHandlerFunc
|
||||
} {
|
||||
var calls []struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
Sync v1a.JobHandlerFunc
|
||||
}
|
||||
lockJobControllerMockAddFeatureHandler.RLock()
|
||||
calls = mock.calls.AddFeatureHandler
|
||||
lockJobControllerMockAddFeatureHandler.RUnlock()
|
||||
return calls
|
||||
}
|
||||
|
||||
// AddHandler calls AddHandlerFunc.
|
||||
func (mock *JobControllerMock) AddHandler(ctx context.Context, name string, handler v1a.JobHandlerFunc) {
|
||||
if mock.AddHandlerFunc == nil {
|
||||
@@ -531,21 +659,25 @@ func (mock *JobControllerMock) SyncCalls() []struct {
|
||||
}
|
||||
|
||||
var (
|
||||
lockJobInterfaceMockAddClusterScopedHandler sync.RWMutex
|
||||
lockJobInterfaceMockAddClusterScopedLifecycle sync.RWMutex
|
||||
lockJobInterfaceMockAddHandler sync.RWMutex
|
||||
lockJobInterfaceMockAddLifecycle sync.RWMutex
|
||||
lockJobInterfaceMockController sync.RWMutex
|
||||
lockJobInterfaceMockCreate sync.RWMutex
|
||||
lockJobInterfaceMockDelete sync.RWMutex
|
||||
lockJobInterfaceMockDeleteCollection sync.RWMutex
|
||||
lockJobInterfaceMockDeleteNamespaced sync.RWMutex
|
||||
lockJobInterfaceMockGet sync.RWMutex
|
||||
lockJobInterfaceMockGetNamespaced sync.RWMutex
|
||||
lockJobInterfaceMockList sync.RWMutex
|
||||
lockJobInterfaceMockObjectClient sync.RWMutex
|
||||
lockJobInterfaceMockUpdate sync.RWMutex
|
||||
lockJobInterfaceMockWatch sync.RWMutex
|
||||
lockJobInterfaceMockAddClusterScopedFeatureHandler sync.RWMutex
|
||||
lockJobInterfaceMockAddClusterScopedFeatureLifecycle sync.RWMutex
|
||||
lockJobInterfaceMockAddClusterScopedHandler sync.RWMutex
|
||||
lockJobInterfaceMockAddClusterScopedLifecycle sync.RWMutex
|
||||
lockJobInterfaceMockAddFeatureHandler sync.RWMutex
|
||||
lockJobInterfaceMockAddFeatureLifecycle sync.RWMutex
|
||||
lockJobInterfaceMockAddHandler sync.RWMutex
|
||||
lockJobInterfaceMockAddLifecycle sync.RWMutex
|
||||
lockJobInterfaceMockController sync.RWMutex
|
||||
lockJobInterfaceMockCreate sync.RWMutex
|
||||
lockJobInterfaceMockDelete sync.RWMutex
|
||||
lockJobInterfaceMockDeleteCollection sync.RWMutex
|
||||
lockJobInterfaceMockDeleteNamespaced sync.RWMutex
|
||||
lockJobInterfaceMockGet sync.RWMutex
|
||||
lockJobInterfaceMockGetNamespaced sync.RWMutex
|
||||
lockJobInterfaceMockList sync.RWMutex
|
||||
lockJobInterfaceMockObjectClient sync.RWMutex
|
||||
lockJobInterfaceMockUpdate sync.RWMutex
|
||||
lockJobInterfaceMockWatch sync.RWMutex
|
||||
)
|
||||
|
||||
// Ensure, that JobInterfaceMock does implement JobInterface.
|
||||
@@ -558,12 +690,24 @@ var _ v1a.JobInterface = &JobInterfaceMock{}
|
||||
//
|
||||
// // make and configure a mocked JobInterface
|
||||
// mockedJobInterface := &JobInterfaceMock{
|
||||
// AddClusterScopedFeatureHandlerFunc: func(ctx context.Context, enabled func() bool, name string, clusterName string, sync v1a.JobHandlerFunc) {
|
||||
// panic("mock out the AddClusterScopedFeatureHandler method")
|
||||
// },
|
||||
// AddClusterScopedFeatureLifecycleFunc: func(ctx context.Context, enabled func() bool, name string, clusterName string, lifecycle v1a.JobLifecycle) {
|
||||
// panic("mock out the AddClusterScopedFeatureLifecycle method")
|
||||
// },
|
||||
// AddClusterScopedHandlerFunc: func(ctx context.Context, name string, clusterName string, sync v1a.JobHandlerFunc) {
|
||||
// panic("mock out the AddClusterScopedHandler method")
|
||||
// },
|
||||
// AddClusterScopedLifecycleFunc: func(ctx context.Context, name string, clusterName string, lifecycle v1a.JobLifecycle) {
|
||||
// panic("mock out the AddClusterScopedLifecycle method")
|
||||
// },
|
||||
// AddFeatureHandlerFunc: func(ctx context.Context, enabled func() bool, name string, sync v1a.JobHandlerFunc) {
|
||||
// panic("mock out the AddFeatureHandler method")
|
||||
// },
|
||||
// AddFeatureLifecycleFunc: func(ctx context.Context, enabled func() bool, name string, lifecycle v1a.JobLifecycle) {
|
||||
// panic("mock out the AddFeatureLifecycle method")
|
||||
// },
|
||||
// AddHandlerFunc: func(ctx context.Context, name string, sync v1a.JobHandlerFunc) {
|
||||
// panic("mock out the AddHandler method")
|
||||
// },
|
||||
@@ -610,12 +754,24 @@ var _ v1a.JobInterface = &JobInterfaceMock{}
|
||||
//
|
||||
// }
|
||||
type JobInterfaceMock struct {
|
||||
// AddClusterScopedFeatureHandlerFunc mocks the AddClusterScopedFeatureHandler method.
|
||||
AddClusterScopedFeatureHandlerFunc func(ctx context.Context, enabled func() bool, name string, clusterName string, sync v1a.JobHandlerFunc)
|
||||
|
||||
// AddClusterScopedFeatureLifecycleFunc mocks the AddClusterScopedFeatureLifecycle method.
|
||||
AddClusterScopedFeatureLifecycleFunc func(ctx context.Context, enabled func() bool, name string, clusterName string, lifecycle v1a.JobLifecycle)
|
||||
|
||||
// AddClusterScopedHandlerFunc mocks the AddClusterScopedHandler method.
|
||||
AddClusterScopedHandlerFunc func(ctx context.Context, name string, clusterName string, sync v1a.JobHandlerFunc)
|
||||
|
||||
// AddClusterScopedLifecycleFunc mocks the AddClusterScopedLifecycle method.
|
||||
AddClusterScopedLifecycleFunc func(ctx context.Context, name string, clusterName string, lifecycle v1a.JobLifecycle)
|
||||
|
||||
// AddFeatureHandlerFunc mocks the AddFeatureHandler method.
|
||||
AddFeatureHandlerFunc func(ctx context.Context, enabled func() bool, name string, sync v1a.JobHandlerFunc)
|
||||
|
||||
// AddFeatureLifecycleFunc mocks the AddFeatureLifecycle method.
|
||||
AddFeatureLifecycleFunc func(ctx context.Context, enabled func() bool, name string, lifecycle v1a.JobLifecycle)
|
||||
|
||||
// AddHandlerFunc mocks the AddHandler method.
|
||||
AddHandlerFunc func(ctx context.Context, name string, sync v1a.JobHandlerFunc)
|
||||
|
||||
@@ -657,6 +813,32 @@ type JobInterfaceMock struct {
|
||||
|
||||
// calls tracks calls to the methods.
|
||||
calls struct {
|
||||
// AddClusterScopedFeatureHandler holds details about calls to the AddClusterScopedFeatureHandler method.
|
||||
AddClusterScopedFeatureHandler []struct {
|
||||
// Ctx is the ctx argument value.
|
||||
Ctx context.Context
|
||||
// Enabled is the enabled argument value.
|
||||
Enabled func() bool
|
||||
// Name is the name argument value.
|
||||
Name string
|
||||
// ClusterName is the clusterName argument value.
|
||||
ClusterName string
|
||||
// Sync is the sync argument value.
|
||||
Sync v1a.JobHandlerFunc
|
||||
}
|
||||
// AddClusterScopedFeatureLifecycle holds details about calls to the AddClusterScopedFeatureLifecycle method.
|
||||
AddClusterScopedFeatureLifecycle []struct {
|
||||
// Ctx is the ctx argument value.
|
||||
Ctx context.Context
|
||||
// Enabled is the enabled argument value.
|
||||
Enabled func() bool
|
||||
// Name is the name argument value.
|
||||
Name string
|
||||
// ClusterName is the clusterName argument value.
|
||||
ClusterName string
|
||||
// Lifecycle is the lifecycle argument value.
|
||||
Lifecycle v1a.JobLifecycle
|
||||
}
|
||||
// AddClusterScopedHandler holds details about calls to the AddClusterScopedHandler method.
|
||||
AddClusterScopedHandler []struct {
|
||||
// Ctx is the ctx argument value.
|
||||
@@ -679,6 +861,28 @@ type JobInterfaceMock struct {
|
||||
// Lifecycle is the lifecycle argument value.
|
||||
Lifecycle v1a.JobLifecycle
|
||||
}
|
||||
// AddFeatureHandler holds details about calls to the AddFeatureHandler method.
|
||||
AddFeatureHandler []struct {
|
||||
// Ctx is the ctx argument value.
|
||||
Ctx context.Context
|
||||
// Enabled is the enabled argument value.
|
||||
Enabled func() bool
|
||||
// Name is the name argument value.
|
||||
Name string
|
||||
// Sync is the sync argument value.
|
||||
Sync v1a.JobHandlerFunc
|
||||
}
|
||||
// AddFeatureLifecycle holds details about calls to the AddFeatureLifecycle method.
|
||||
AddFeatureLifecycle []struct {
|
||||
// Ctx is the ctx argument value.
|
||||
Ctx context.Context
|
||||
// Enabled is the enabled argument value.
|
||||
Enabled func() bool
|
||||
// Name is the name argument value.
|
||||
Name string
|
||||
// Lifecycle is the lifecycle argument value.
|
||||
Lifecycle v1a.JobLifecycle
|
||||
}
|
||||
// AddHandler holds details about calls to the AddHandler method.
|
||||
AddHandler []struct {
|
||||
// Ctx is the ctx argument value.
|
||||
@@ -765,6 +969,100 @@ type JobInterfaceMock struct {
|
||||
}
|
||||
}
|
||||
|
||||
// AddClusterScopedFeatureHandler calls AddClusterScopedFeatureHandlerFunc.
|
||||
func (mock *JobInterfaceMock) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name string, clusterName string, sync v1a.JobHandlerFunc) {
|
||||
if mock.AddClusterScopedFeatureHandlerFunc == nil {
|
||||
panic("JobInterfaceMock.AddClusterScopedFeatureHandlerFunc: method is nil but JobInterface.AddClusterScopedFeatureHandler was just called")
|
||||
}
|
||||
callInfo := struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
ClusterName string
|
||||
Sync v1a.JobHandlerFunc
|
||||
}{
|
||||
Ctx: ctx,
|
||||
Enabled: enabled,
|
||||
Name: name,
|
||||
ClusterName: clusterName,
|
||||
Sync: sync,
|
||||
}
|
||||
lockJobInterfaceMockAddClusterScopedFeatureHandler.Lock()
|
||||
mock.calls.AddClusterScopedFeatureHandler = append(mock.calls.AddClusterScopedFeatureHandler, callInfo)
|
||||
lockJobInterfaceMockAddClusterScopedFeatureHandler.Unlock()
|
||||
mock.AddClusterScopedFeatureHandlerFunc(ctx, enabled, name, clusterName, sync)
|
||||
}
|
||||
|
||||
// AddClusterScopedFeatureHandlerCalls gets all the calls that were made to AddClusterScopedFeatureHandler.
|
||||
// Check the length with:
|
||||
// len(mockedJobInterface.AddClusterScopedFeatureHandlerCalls())
|
||||
func (mock *JobInterfaceMock) AddClusterScopedFeatureHandlerCalls() []struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
ClusterName string
|
||||
Sync v1a.JobHandlerFunc
|
||||
} {
|
||||
var calls []struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
ClusterName string
|
||||
Sync v1a.JobHandlerFunc
|
||||
}
|
||||
lockJobInterfaceMockAddClusterScopedFeatureHandler.RLock()
|
||||
calls = mock.calls.AddClusterScopedFeatureHandler
|
||||
lockJobInterfaceMockAddClusterScopedFeatureHandler.RUnlock()
|
||||
return calls
|
||||
}
|
||||
|
||||
// AddClusterScopedFeatureLifecycle calls AddClusterScopedFeatureLifecycleFunc.
|
||||
func (mock *JobInterfaceMock) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name string, clusterName string, lifecycle v1a.JobLifecycle) {
|
||||
if mock.AddClusterScopedFeatureLifecycleFunc == nil {
|
||||
panic("JobInterfaceMock.AddClusterScopedFeatureLifecycleFunc: method is nil but JobInterface.AddClusterScopedFeatureLifecycle was just called")
|
||||
}
|
||||
callInfo := struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
ClusterName string
|
||||
Lifecycle v1a.JobLifecycle
|
||||
}{
|
||||
Ctx: ctx,
|
||||
Enabled: enabled,
|
||||
Name: name,
|
||||
ClusterName: clusterName,
|
||||
Lifecycle: lifecycle,
|
||||
}
|
||||
lockJobInterfaceMockAddClusterScopedFeatureLifecycle.Lock()
|
||||
mock.calls.AddClusterScopedFeatureLifecycle = append(mock.calls.AddClusterScopedFeatureLifecycle, callInfo)
|
||||
lockJobInterfaceMockAddClusterScopedFeatureLifecycle.Unlock()
|
||||
mock.AddClusterScopedFeatureLifecycleFunc(ctx, enabled, name, clusterName, lifecycle)
|
||||
}
|
||||
|
||||
// AddClusterScopedFeatureLifecycleCalls gets all the calls that were made to AddClusterScopedFeatureLifecycle.
|
||||
// Check the length with:
|
||||
// len(mockedJobInterface.AddClusterScopedFeatureLifecycleCalls())
|
||||
func (mock *JobInterfaceMock) AddClusterScopedFeatureLifecycleCalls() []struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
ClusterName string
|
||||
Lifecycle v1a.JobLifecycle
|
||||
} {
|
||||
var calls []struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
ClusterName string
|
||||
Lifecycle v1a.JobLifecycle
|
||||
}
|
||||
lockJobInterfaceMockAddClusterScopedFeatureLifecycle.RLock()
|
||||
calls = mock.calls.AddClusterScopedFeatureLifecycle
|
||||
lockJobInterfaceMockAddClusterScopedFeatureLifecycle.RUnlock()
|
||||
return calls
|
||||
}
|
||||
|
||||
// AddClusterScopedHandler calls AddClusterScopedHandlerFunc.
|
||||
func (mock *JobInterfaceMock) AddClusterScopedHandler(ctx context.Context, name string, clusterName string, sync v1a.JobHandlerFunc) {
|
||||
if mock.AddClusterScopedHandlerFunc == nil {
|
||||
@@ -851,6 +1149,92 @@ func (mock *JobInterfaceMock) AddClusterScopedLifecycleCalls() []struct {
|
||||
return calls
|
||||
}
|
||||
|
||||
// AddFeatureHandler calls AddFeatureHandlerFunc.
|
||||
func (mock *JobInterfaceMock) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync v1a.JobHandlerFunc) {
|
||||
if mock.AddFeatureHandlerFunc == nil {
|
||||
panic("JobInterfaceMock.AddFeatureHandlerFunc: method is nil but JobInterface.AddFeatureHandler was just called")
|
||||
}
|
||||
callInfo := struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
Sync v1a.JobHandlerFunc
|
||||
}{
|
||||
Ctx: ctx,
|
||||
Enabled: enabled,
|
||||
Name: name,
|
||||
Sync: sync,
|
||||
}
|
||||
lockJobInterfaceMockAddFeatureHandler.Lock()
|
||||
mock.calls.AddFeatureHandler = append(mock.calls.AddFeatureHandler, callInfo)
|
||||
lockJobInterfaceMockAddFeatureHandler.Unlock()
|
||||
mock.AddFeatureHandlerFunc(ctx, enabled, name, sync)
|
||||
}
|
||||
|
||||
// AddFeatureHandlerCalls gets all the calls that were made to AddFeatureHandler.
|
||||
// Check the length with:
|
||||
// len(mockedJobInterface.AddFeatureHandlerCalls())
|
||||
func (mock *JobInterfaceMock) AddFeatureHandlerCalls() []struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
Sync v1a.JobHandlerFunc
|
||||
} {
|
||||
var calls []struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
Sync v1a.JobHandlerFunc
|
||||
}
|
||||
lockJobInterfaceMockAddFeatureHandler.RLock()
|
||||
calls = mock.calls.AddFeatureHandler
|
||||
lockJobInterfaceMockAddFeatureHandler.RUnlock()
|
||||
return calls
|
||||
}
|
||||
|
||||
// AddFeatureLifecycle calls AddFeatureLifecycleFunc.
|
||||
func (mock *JobInterfaceMock) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle v1a.JobLifecycle) {
|
||||
if mock.AddFeatureLifecycleFunc == nil {
|
||||
panic("JobInterfaceMock.AddFeatureLifecycleFunc: method is nil but JobInterface.AddFeatureLifecycle was just called")
|
||||
}
|
||||
callInfo := struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
Lifecycle v1a.JobLifecycle
|
||||
}{
|
||||
Ctx: ctx,
|
||||
Enabled: enabled,
|
||||
Name: name,
|
||||
Lifecycle: lifecycle,
|
||||
}
|
||||
lockJobInterfaceMockAddFeatureLifecycle.Lock()
|
||||
mock.calls.AddFeatureLifecycle = append(mock.calls.AddFeatureLifecycle, callInfo)
|
||||
lockJobInterfaceMockAddFeatureLifecycle.Unlock()
|
||||
mock.AddFeatureLifecycleFunc(ctx, enabled, name, lifecycle)
|
||||
}
|
||||
|
||||
// AddFeatureLifecycleCalls gets all the calls that were made to AddFeatureLifecycle.
|
||||
// Check the length with:
|
||||
// len(mockedJobInterface.AddFeatureLifecycleCalls())
|
||||
func (mock *JobInterfaceMock) AddFeatureLifecycleCalls() []struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
Lifecycle v1a.JobLifecycle
|
||||
} {
|
||||
var calls []struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
Lifecycle v1a.JobLifecycle
|
||||
}
|
||||
lockJobInterfaceMockAddFeatureLifecycle.RLock()
|
||||
calls = mock.calls.AddFeatureLifecycle
|
||||
lockJobInterfaceMockAddFeatureLifecycle.RUnlock()
|
||||
return calls
|
||||
}
|
||||
|
||||
// AddHandler calls AddHandlerFunc.
|
||||
func (mock *JobInterfaceMock) AddHandler(ctx context.Context, name string, sync v1a.JobHandlerFunc) {
|
||||
if mock.AddHandlerFunc == nil {
|
||||
|
@@ -69,7 +69,9 @@ type JobController interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() JobLister
|
||||
AddHandler(ctx context.Context, name string, handler JobHandlerFunc)
|
||||
AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync JobHandlerFunc)
|
||||
AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler JobHandlerFunc)
|
||||
AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler JobHandlerFunc)
|
||||
Enqueue(namespace, name string)
|
||||
Sync(ctx context.Context) error
|
||||
Start(ctx context.Context, threadiness int) error
|
||||
@@ -88,9 +90,13 @@ type JobInterface interface {
|
||||
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Controller() JobController
|
||||
AddHandler(ctx context.Context, name string, sync JobHandlerFunc)
|
||||
AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync JobHandlerFunc)
|
||||
AddLifecycle(ctx context.Context, name string, lifecycle JobLifecycle)
|
||||
AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle JobLifecycle)
|
||||
AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync JobHandlerFunc)
|
||||
AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync JobHandlerFunc)
|
||||
AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle JobLifecycle)
|
||||
AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle JobLifecycle)
|
||||
}
|
||||
|
||||
type jobLister struct {
|
||||
@@ -150,6 +156,20 @@ func (c *jobController) AddHandler(ctx context.Context, name string, handler Job
|
||||
})
|
||||
}
|
||||
|
||||
func (c *jobController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler JobHandlerFunc) {
|
||||
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
|
||||
if !enabled() {
|
||||
return nil, nil
|
||||
} else if obj == nil {
|
||||
return handler(key, nil)
|
||||
} else if v, ok := obj.(*v1.Job); ok {
|
||||
return handler(key, v)
|
||||
} else {
|
||||
return nil, nil
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func (c *jobController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler JobHandlerFunc) {
|
||||
resource.PutClusterScoped(JobGroupVersionResource)
|
||||
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
|
||||
@@ -163,6 +183,21 @@ func (c *jobController) AddClusterScopedHandler(ctx context.Context, name, clust
|
||||
})
|
||||
}
|
||||
|
||||
func (c *jobController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler JobHandlerFunc) {
|
||||
resource.PutClusterScoped(JobGroupVersionResource)
|
||||
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
|
||||
if !enabled() {
|
||||
return nil, nil
|
||||
} else if obj == nil {
|
||||
return handler(key, nil)
|
||||
} else if v, ok := obj.(*v1.Job); ok && controller.ObjectInCluster(cluster, obj) {
|
||||
return handler(key, v)
|
||||
} else {
|
||||
return nil, nil
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
type jobFactory struct {
|
||||
}
|
||||
|
||||
@@ -258,20 +293,38 @@ func (s *jobClient) AddHandler(ctx context.Context, name string, sync JobHandler
|
||||
s.Controller().AddHandler(ctx, name, sync)
|
||||
}
|
||||
|
||||
func (s *jobClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync JobHandlerFunc) {
|
||||
s.Controller().AddFeatureHandler(ctx, enabled, name, sync)
|
||||
}
|
||||
|
||||
func (s *jobClient) AddLifecycle(ctx context.Context, name string, lifecycle JobLifecycle) {
|
||||
sync := NewJobLifecycleAdapter(name, false, s, lifecycle)
|
||||
s.Controller().AddHandler(ctx, name, sync)
|
||||
}
|
||||
|
||||
func (s *jobClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle JobLifecycle) {
|
||||
sync := NewJobLifecycleAdapter(name, false, s, lifecycle)
|
||||
s.Controller().AddFeatureHandler(ctx, enabled, name, sync)
|
||||
}
|
||||
|
||||
func (s *jobClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync JobHandlerFunc) {
|
||||
s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync)
|
||||
}
|
||||
|
||||
func (s *jobClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync JobHandlerFunc) {
|
||||
s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync)
|
||||
}
|
||||
|
||||
func (s *jobClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle JobLifecycle) {
|
||||
sync := NewJobLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle)
|
||||
s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync)
|
||||
}
|
||||
|
||||
func (s *jobClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle JobLifecycle) {
|
||||
sync := NewJobLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle)
|
||||
s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync)
|
||||
}
|
||||
|
||||
type JobIndexer func(obj *v1.Job) ([]string, error)
|
||||
|
||||
type JobClientCache interface {
|
||||
|
Reference in New Issue
Block a user