mirror of
https://github.com/rancher/types.git
synced 2025-08-31 12:48:45 +00:00
go generate
This commit is contained in:
@@ -141,14 +141,16 @@ func (mock *IngressListerMock) ListCalls() []struct {
|
||||
}
|
||||
|
||||
var (
|
||||
lockIngressControllerMockAddClusterScopedHandler sync.RWMutex
|
||||
lockIngressControllerMockAddHandler sync.RWMutex
|
||||
lockIngressControllerMockEnqueue sync.RWMutex
|
||||
lockIngressControllerMockGeneric sync.RWMutex
|
||||
lockIngressControllerMockInformer sync.RWMutex
|
||||
lockIngressControllerMockLister sync.RWMutex
|
||||
lockIngressControllerMockStart sync.RWMutex
|
||||
lockIngressControllerMockSync sync.RWMutex
|
||||
lockIngressControllerMockAddClusterScopedFeatureHandler sync.RWMutex
|
||||
lockIngressControllerMockAddClusterScopedHandler sync.RWMutex
|
||||
lockIngressControllerMockAddFeatureHandler sync.RWMutex
|
||||
lockIngressControllerMockAddHandler sync.RWMutex
|
||||
lockIngressControllerMockEnqueue sync.RWMutex
|
||||
lockIngressControllerMockGeneric sync.RWMutex
|
||||
lockIngressControllerMockInformer sync.RWMutex
|
||||
lockIngressControllerMockLister sync.RWMutex
|
||||
lockIngressControllerMockStart sync.RWMutex
|
||||
lockIngressControllerMockSync sync.RWMutex
|
||||
)
|
||||
|
||||
// Ensure, that IngressControllerMock does implement IngressController.
|
||||
@@ -161,9 +163,15 @@ var _ v1beta1a.IngressController = &IngressControllerMock{}
|
||||
//
|
||||
// // make and configure a mocked IngressController
|
||||
// mockedIngressController := &IngressControllerMock{
|
||||
// AddClusterScopedFeatureHandlerFunc: func(ctx context.Context, enabled func() bool, name string, clusterName string, handler v1beta1a.IngressHandlerFunc) {
|
||||
// panic("mock out the AddClusterScopedFeatureHandler method")
|
||||
// },
|
||||
// AddClusterScopedHandlerFunc: func(ctx context.Context, name string, clusterName string, handler v1beta1a.IngressHandlerFunc) {
|
||||
// panic("mock out the AddClusterScopedHandler method")
|
||||
// },
|
||||
// AddFeatureHandlerFunc: func(ctx context.Context, enabled func() bool, name string, sync v1beta1a.IngressHandlerFunc) {
|
||||
// panic("mock out the AddFeatureHandler method")
|
||||
// },
|
||||
// AddHandlerFunc: func(ctx context.Context, name string, handler v1beta1a.IngressHandlerFunc) {
|
||||
// panic("mock out the AddHandler method")
|
||||
// },
|
||||
@@ -192,9 +200,15 @@ var _ v1beta1a.IngressController = &IngressControllerMock{}
|
||||
//
|
||||
// }
|
||||
type IngressControllerMock struct {
|
||||
// AddClusterScopedFeatureHandlerFunc mocks the AddClusterScopedFeatureHandler method.
|
||||
AddClusterScopedFeatureHandlerFunc func(ctx context.Context, enabled func() bool, name string, clusterName string, handler v1beta1a.IngressHandlerFunc)
|
||||
|
||||
// AddClusterScopedHandlerFunc mocks the AddClusterScopedHandler method.
|
||||
AddClusterScopedHandlerFunc func(ctx context.Context, name string, clusterName string, handler v1beta1a.IngressHandlerFunc)
|
||||
|
||||
// AddFeatureHandlerFunc mocks the AddFeatureHandler method.
|
||||
AddFeatureHandlerFunc func(ctx context.Context, enabled func() bool, name string, sync v1beta1a.IngressHandlerFunc)
|
||||
|
||||
// AddHandlerFunc mocks the AddHandler method.
|
||||
AddHandlerFunc func(ctx context.Context, name string, handler v1beta1a.IngressHandlerFunc)
|
||||
|
||||
@@ -218,6 +232,19 @@ type IngressControllerMock 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 v1beta1a.IngressHandlerFunc
|
||||
}
|
||||
// AddClusterScopedHandler holds details about calls to the AddClusterScopedHandler method.
|
||||
AddClusterScopedHandler []struct {
|
||||
// Ctx is the ctx argument value.
|
||||
@@ -229,6 +256,17 @@ type IngressControllerMock struct {
|
||||
// Handler is the handler argument value.
|
||||
Handler v1beta1a.IngressHandlerFunc
|
||||
}
|
||||
// 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 v1beta1a.IngressHandlerFunc
|
||||
}
|
||||
// AddHandler holds details about calls to the AddHandler method.
|
||||
AddHandler []struct {
|
||||
// Ctx is the ctx argument value.
|
||||
@@ -269,6 +307,53 @@ type IngressControllerMock struct {
|
||||
}
|
||||
}
|
||||
|
||||
// AddClusterScopedFeatureHandler calls AddClusterScopedFeatureHandlerFunc.
|
||||
func (mock *IngressControllerMock) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name string, clusterName string, handler v1beta1a.IngressHandlerFunc) {
|
||||
if mock.AddClusterScopedFeatureHandlerFunc == nil {
|
||||
panic("IngressControllerMock.AddClusterScopedFeatureHandlerFunc: method is nil but IngressController.AddClusterScopedFeatureHandler was just called")
|
||||
}
|
||||
callInfo := struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
ClusterName string
|
||||
Handler v1beta1a.IngressHandlerFunc
|
||||
}{
|
||||
Ctx: ctx,
|
||||
Enabled: enabled,
|
||||
Name: name,
|
||||
ClusterName: clusterName,
|
||||
Handler: handler,
|
||||
}
|
||||
lockIngressControllerMockAddClusterScopedFeatureHandler.Lock()
|
||||
mock.calls.AddClusterScopedFeatureHandler = append(mock.calls.AddClusterScopedFeatureHandler, callInfo)
|
||||
lockIngressControllerMockAddClusterScopedFeatureHandler.Unlock()
|
||||
mock.AddClusterScopedFeatureHandlerFunc(ctx, enabled, name, clusterName, handler)
|
||||
}
|
||||
|
||||
// AddClusterScopedFeatureHandlerCalls gets all the calls that were made to AddClusterScopedFeatureHandler.
|
||||
// Check the length with:
|
||||
// len(mockedIngressController.AddClusterScopedFeatureHandlerCalls())
|
||||
func (mock *IngressControllerMock) AddClusterScopedFeatureHandlerCalls() []struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
ClusterName string
|
||||
Handler v1beta1a.IngressHandlerFunc
|
||||
} {
|
||||
var calls []struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
ClusterName string
|
||||
Handler v1beta1a.IngressHandlerFunc
|
||||
}
|
||||
lockIngressControllerMockAddClusterScopedFeatureHandler.RLock()
|
||||
calls = mock.calls.AddClusterScopedFeatureHandler
|
||||
lockIngressControllerMockAddClusterScopedFeatureHandler.RUnlock()
|
||||
return calls
|
||||
}
|
||||
|
||||
// AddClusterScopedHandler calls AddClusterScopedHandlerFunc.
|
||||
func (mock *IngressControllerMock) AddClusterScopedHandler(ctx context.Context, name string, clusterName string, handler v1beta1a.IngressHandlerFunc) {
|
||||
if mock.AddClusterScopedHandlerFunc == nil {
|
||||
@@ -312,6 +397,49 @@ func (mock *IngressControllerMock) AddClusterScopedHandlerCalls() []struct {
|
||||
return calls
|
||||
}
|
||||
|
||||
// AddFeatureHandler calls AddFeatureHandlerFunc.
|
||||
func (mock *IngressControllerMock) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync v1beta1a.IngressHandlerFunc) {
|
||||
if mock.AddFeatureHandlerFunc == nil {
|
||||
panic("IngressControllerMock.AddFeatureHandlerFunc: method is nil but IngressController.AddFeatureHandler was just called")
|
||||
}
|
||||
callInfo := struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
Sync v1beta1a.IngressHandlerFunc
|
||||
}{
|
||||
Ctx: ctx,
|
||||
Enabled: enabled,
|
||||
Name: name,
|
||||
Sync: sync,
|
||||
}
|
||||
lockIngressControllerMockAddFeatureHandler.Lock()
|
||||
mock.calls.AddFeatureHandler = append(mock.calls.AddFeatureHandler, callInfo)
|
||||
lockIngressControllerMockAddFeatureHandler.Unlock()
|
||||
mock.AddFeatureHandlerFunc(ctx, enabled, name, sync)
|
||||
}
|
||||
|
||||
// AddFeatureHandlerCalls gets all the calls that were made to AddFeatureHandler.
|
||||
// Check the length with:
|
||||
// len(mockedIngressController.AddFeatureHandlerCalls())
|
||||
func (mock *IngressControllerMock) AddFeatureHandlerCalls() []struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
Sync v1beta1a.IngressHandlerFunc
|
||||
} {
|
||||
var calls []struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
Sync v1beta1a.IngressHandlerFunc
|
||||
}
|
||||
lockIngressControllerMockAddFeatureHandler.RLock()
|
||||
calls = mock.calls.AddFeatureHandler
|
||||
lockIngressControllerMockAddFeatureHandler.RUnlock()
|
||||
return calls
|
||||
}
|
||||
|
||||
// AddHandler calls AddHandlerFunc.
|
||||
func (mock *IngressControllerMock) AddHandler(ctx context.Context, name string, handler v1beta1a.IngressHandlerFunc) {
|
||||
if mock.AddHandlerFunc == nil {
|
||||
@@ -531,21 +659,25 @@ func (mock *IngressControllerMock) SyncCalls() []struct {
|
||||
}
|
||||
|
||||
var (
|
||||
lockIngressInterfaceMockAddClusterScopedHandler sync.RWMutex
|
||||
lockIngressInterfaceMockAddClusterScopedLifecycle sync.RWMutex
|
||||
lockIngressInterfaceMockAddHandler sync.RWMutex
|
||||
lockIngressInterfaceMockAddLifecycle sync.RWMutex
|
||||
lockIngressInterfaceMockController sync.RWMutex
|
||||
lockIngressInterfaceMockCreate sync.RWMutex
|
||||
lockIngressInterfaceMockDelete sync.RWMutex
|
||||
lockIngressInterfaceMockDeleteCollection sync.RWMutex
|
||||
lockIngressInterfaceMockDeleteNamespaced sync.RWMutex
|
||||
lockIngressInterfaceMockGet sync.RWMutex
|
||||
lockIngressInterfaceMockGetNamespaced sync.RWMutex
|
||||
lockIngressInterfaceMockList sync.RWMutex
|
||||
lockIngressInterfaceMockObjectClient sync.RWMutex
|
||||
lockIngressInterfaceMockUpdate sync.RWMutex
|
||||
lockIngressInterfaceMockWatch sync.RWMutex
|
||||
lockIngressInterfaceMockAddClusterScopedFeatureHandler sync.RWMutex
|
||||
lockIngressInterfaceMockAddClusterScopedFeatureLifecycle sync.RWMutex
|
||||
lockIngressInterfaceMockAddClusterScopedHandler sync.RWMutex
|
||||
lockIngressInterfaceMockAddClusterScopedLifecycle sync.RWMutex
|
||||
lockIngressInterfaceMockAddFeatureHandler sync.RWMutex
|
||||
lockIngressInterfaceMockAddFeatureLifecycle sync.RWMutex
|
||||
lockIngressInterfaceMockAddHandler sync.RWMutex
|
||||
lockIngressInterfaceMockAddLifecycle sync.RWMutex
|
||||
lockIngressInterfaceMockController sync.RWMutex
|
||||
lockIngressInterfaceMockCreate sync.RWMutex
|
||||
lockIngressInterfaceMockDelete sync.RWMutex
|
||||
lockIngressInterfaceMockDeleteCollection sync.RWMutex
|
||||
lockIngressInterfaceMockDeleteNamespaced sync.RWMutex
|
||||
lockIngressInterfaceMockGet sync.RWMutex
|
||||
lockIngressInterfaceMockGetNamespaced sync.RWMutex
|
||||
lockIngressInterfaceMockList sync.RWMutex
|
||||
lockIngressInterfaceMockObjectClient sync.RWMutex
|
||||
lockIngressInterfaceMockUpdate sync.RWMutex
|
||||
lockIngressInterfaceMockWatch sync.RWMutex
|
||||
)
|
||||
|
||||
// Ensure, that IngressInterfaceMock does implement IngressInterface.
|
||||
@@ -558,12 +690,24 @@ var _ v1beta1a.IngressInterface = &IngressInterfaceMock{}
|
||||
//
|
||||
// // make and configure a mocked IngressInterface
|
||||
// mockedIngressInterface := &IngressInterfaceMock{
|
||||
// AddClusterScopedFeatureHandlerFunc: func(ctx context.Context, enabled func() bool, name string, clusterName string, sync v1beta1a.IngressHandlerFunc) {
|
||||
// panic("mock out the AddClusterScopedFeatureHandler method")
|
||||
// },
|
||||
// AddClusterScopedFeatureLifecycleFunc: func(ctx context.Context, enabled func() bool, name string, clusterName string, lifecycle v1beta1a.IngressLifecycle) {
|
||||
// panic("mock out the AddClusterScopedFeatureLifecycle method")
|
||||
// },
|
||||
// AddClusterScopedHandlerFunc: func(ctx context.Context, name string, clusterName string, sync v1beta1a.IngressHandlerFunc) {
|
||||
// panic("mock out the AddClusterScopedHandler method")
|
||||
// },
|
||||
// AddClusterScopedLifecycleFunc: func(ctx context.Context, name string, clusterName string, lifecycle v1beta1a.IngressLifecycle) {
|
||||
// panic("mock out the AddClusterScopedLifecycle method")
|
||||
// },
|
||||
// AddFeatureHandlerFunc: func(ctx context.Context, enabled func() bool, name string, sync v1beta1a.IngressHandlerFunc) {
|
||||
// panic("mock out the AddFeatureHandler method")
|
||||
// },
|
||||
// AddFeatureLifecycleFunc: func(ctx context.Context, enabled func() bool, name string, lifecycle v1beta1a.IngressLifecycle) {
|
||||
// panic("mock out the AddFeatureLifecycle method")
|
||||
// },
|
||||
// AddHandlerFunc: func(ctx context.Context, name string, sync v1beta1a.IngressHandlerFunc) {
|
||||
// panic("mock out the AddHandler method")
|
||||
// },
|
||||
@@ -610,12 +754,24 @@ var _ v1beta1a.IngressInterface = &IngressInterfaceMock{}
|
||||
//
|
||||
// }
|
||||
type IngressInterfaceMock struct {
|
||||
// AddClusterScopedFeatureHandlerFunc mocks the AddClusterScopedFeatureHandler method.
|
||||
AddClusterScopedFeatureHandlerFunc func(ctx context.Context, enabled func() bool, name string, clusterName string, sync v1beta1a.IngressHandlerFunc)
|
||||
|
||||
// AddClusterScopedFeatureLifecycleFunc mocks the AddClusterScopedFeatureLifecycle method.
|
||||
AddClusterScopedFeatureLifecycleFunc func(ctx context.Context, enabled func() bool, name string, clusterName string, lifecycle v1beta1a.IngressLifecycle)
|
||||
|
||||
// AddClusterScopedHandlerFunc mocks the AddClusterScopedHandler method.
|
||||
AddClusterScopedHandlerFunc func(ctx context.Context, name string, clusterName string, sync v1beta1a.IngressHandlerFunc)
|
||||
|
||||
// AddClusterScopedLifecycleFunc mocks the AddClusterScopedLifecycle method.
|
||||
AddClusterScopedLifecycleFunc func(ctx context.Context, name string, clusterName string, lifecycle v1beta1a.IngressLifecycle)
|
||||
|
||||
// AddFeatureHandlerFunc mocks the AddFeatureHandler method.
|
||||
AddFeatureHandlerFunc func(ctx context.Context, enabled func() bool, name string, sync v1beta1a.IngressHandlerFunc)
|
||||
|
||||
// AddFeatureLifecycleFunc mocks the AddFeatureLifecycle method.
|
||||
AddFeatureLifecycleFunc func(ctx context.Context, enabled func() bool, name string, lifecycle v1beta1a.IngressLifecycle)
|
||||
|
||||
// AddHandlerFunc mocks the AddHandler method.
|
||||
AddHandlerFunc func(ctx context.Context, name string, sync v1beta1a.IngressHandlerFunc)
|
||||
|
||||
@@ -657,6 +813,32 @@ type IngressInterfaceMock 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 v1beta1a.IngressHandlerFunc
|
||||
}
|
||||
// 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 v1beta1a.IngressLifecycle
|
||||
}
|
||||
// AddClusterScopedHandler holds details about calls to the AddClusterScopedHandler method.
|
||||
AddClusterScopedHandler []struct {
|
||||
// Ctx is the ctx argument value.
|
||||
@@ -679,6 +861,28 @@ type IngressInterfaceMock struct {
|
||||
// Lifecycle is the lifecycle argument value.
|
||||
Lifecycle v1beta1a.IngressLifecycle
|
||||
}
|
||||
// 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 v1beta1a.IngressHandlerFunc
|
||||
}
|
||||
// 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 v1beta1a.IngressLifecycle
|
||||
}
|
||||
// AddHandler holds details about calls to the AddHandler method.
|
||||
AddHandler []struct {
|
||||
// Ctx is the ctx argument value.
|
||||
@@ -765,6 +969,100 @@ type IngressInterfaceMock struct {
|
||||
}
|
||||
}
|
||||
|
||||
// AddClusterScopedFeatureHandler calls AddClusterScopedFeatureHandlerFunc.
|
||||
func (mock *IngressInterfaceMock) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name string, clusterName string, sync v1beta1a.IngressHandlerFunc) {
|
||||
if mock.AddClusterScopedFeatureHandlerFunc == nil {
|
||||
panic("IngressInterfaceMock.AddClusterScopedFeatureHandlerFunc: method is nil but IngressInterface.AddClusterScopedFeatureHandler was just called")
|
||||
}
|
||||
callInfo := struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
ClusterName string
|
||||
Sync v1beta1a.IngressHandlerFunc
|
||||
}{
|
||||
Ctx: ctx,
|
||||
Enabled: enabled,
|
||||
Name: name,
|
||||
ClusterName: clusterName,
|
||||
Sync: sync,
|
||||
}
|
||||
lockIngressInterfaceMockAddClusterScopedFeatureHandler.Lock()
|
||||
mock.calls.AddClusterScopedFeatureHandler = append(mock.calls.AddClusterScopedFeatureHandler, callInfo)
|
||||
lockIngressInterfaceMockAddClusterScopedFeatureHandler.Unlock()
|
||||
mock.AddClusterScopedFeatureHandlerFunc(ctx, enabled, name, clusterName, sync)
|
||||
}
|
||||
|
||||
// AddClusterScopedFeatureHandlerCalls gets all the calls that were made to AddClusterScopedFeatureHandler.
|
||||
// Check the length with:
|
||||
// len(mockedIngressInterface.AddClusterScopedFeatureHandlerCalls())
|
||||
func (mock *IngressInterfaceMock) AddClusterScopedFeatureHandlerCalls() []struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
ClusterName string
|
||||
Sync v1beta1a.IngressHandlerFunc
|
||||
} {
|
||||
var calls []struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
ClusterName string
|
||||
Sync v1beta1a.IngressHandlerFunc
|
||||
}
|
||||
lockIngressInterfaceMockAddClusterScopedFeatureHandler.RLock()
|
||||
calls = mock.calls.AddClusterScopedFeatureHandler
|
||||
lockIngressInterfaceMockAddClusterScopedFeatureHandler.RUnlock()
|
||||
return calls
|
||||
}
|
||||
|
||||
// AddClusterScopedFeatureLifecycle calls AddClusterScopedFeatureLifecycleFunc.
|
||||
func (mock *IngressInterfaceMock) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name string, clusterName string, lifecycle v1beta1a.IngressLifecycle) {
|
||||
if mock.AddClusterScopedFeatureLifecycleFunc == nil {
|
||||
panic("IngressInterfaceMock.AddClusterScopedFeatureLifecycleFunc: method is nil but IngressInterface.AddClusterScopedFeatureLifecycle was just called")
|
||||
}
|
||||
callInfo := struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
ClusterName string
|
||||
Lifecycle v1beta1a.IngressLifecycle
|
||||
}{
|
||||
Ctx: ctx,
|
||||
Enabled: enabled,
|
||||
Name: name,
|
||||
ClusterName: clusterName,
|
||||
Lifecycle: lifecycle,
|
||||
}
|
||||
lockIngressInterfaceMockAddClusterScopedFeatureLifecycle.Lock()
|
||||
mock.calls.AddClusterScopedFeatureLifecycle = append(mock.calls.AddClusterScopedFeatureLifecycle, callInfo)
|
||||
lockIngressInterfaceMockAddClusterScopedFeatureLifecycle.Unlock()
|
||||
mock.AddClusterScopedFeatureLifecycleFunc(ctx, enabled, name, clusterName, lifecycle)
|
||||
}
|
||||
|
||||
// AddClusterScopedFeatureLifecycleCalls gets all the calls that were made to AddClusterScopedFeatureLifecycle.
|
||||
// Check the length with:
|
||||
// len(mockedIngressInterface.AddClusterScopedFeatureLifecycleCalls())
|
||||
func (mock *IngressInterfaceMock) AddClusterScopedFeatureLifecycleCalls() []struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
ClusterName string
|
||||
Lifecycle v1beta1a.IngressLifecycle
|
||||
} {
|
||||
var calls []struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
ClusterName string
|
||||
Lifecycle v1beta1a.IngressLifecycle
|
||||
}
|
||||
lockIngressInterfaceMockAddClusterScopedFeatureLifecycle.RLock()
|
||||
calls = mock.calls.AddClusterScopedFeatureLifecycle
|
||||
lockIngressInterfaceMockAddClusterScopedFeatureLifecycle.RUnlock()
|
||||
return calls
|
||||
}
|
||||
|
||||
// AddClusterScopedHandler calls AddClusterScopedHandlerFunc.
|
||||
func (mock *IngressInterfaceMock) AddClusterScopedHandler(ctx context.Context, name string, clusterName string, sync v1beta1a.IngressHandlerFunc) {
|
||||
if mock.AddClusterScopedHandlerFunc == nil {
|
||||
@@ -851,6 +1149,92 @@ func (mock *IngressInterfaceMock) AddClusterScopedLifecycleCalls() []struct {
|
||||
return calls
|
||||
}
|
||||
|
||||
// AddFeatureHandler calls AddFeatureHandlerFunc.
|
||||
func (mock *IngressInterfaceMock) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync v1beta1a.IngressHandlerFunc) {
|
||||
if mock.AddFeatureHandlerFunc == nil {
|
||||
panic("IngressInterfaceMock.AddFeatureHandlerFunc: method is nil but IngressInterface.AddFeatureHandler was just called")
|
||||
}
|
||||
callInfo := struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
Sync v1beta1a.IngressHandlerFunc
|
||||
}{
|
||||
Ctx: ctx,
|
||||
Enabled: enabled,
|
||||
Name: name,
|
||||
Sync: sync,
|
||||
}
|
||||
lockIngressInterfaceMockAddFeatureHandler.Lock()
|
||||
mock.calls.AddFeatureHandler = append(mock.calls.AddFeatureHandler, callInfo)
|
||||
lockIngressInterfaceMockAddFeatureHandler.Unlock()
|
||||
mock.AddFeatureHandlerFunc(ctx, enabled, name, sync)
|
||||
}
|
||||
|
||||
// AddFeatureHandlerCalls gets all the calls that were made to AddFeatureHandler.
|
||||
// Check the length with:
|
||||
// len(mockedIngressInterface.AddFeatureHandlerCalls())
|
||||
func (mock *IngressInterfaceMock) AddFeatureHandlerCalls() []struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
Sync v1beta1a.IngressHandlerFunc
|
||||
} {
|
||||
var calls []struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
Sync v1beta1a.IngressHandlerFunc
|
||||
}
|
||||
lockIngressInterfaceMockAddFeatureHandler.RLock()
|
||||
calls = mock.calls.AddFeatureHandler
|
||||
lockIngressInterfaceMockAddFeatureHandler.RUnlock()
|
||||
return calls
|
||||
}
|
||||
|
||||
// AddFeatureLifecycle calls AddFeatureLifecycleFunc.
|
||||
func (mock *IngressInterfaceMock) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle v1beta1a.IngressLifecycle) {
|
||||
if mock.AddFeatureLifecycleFunc == nil {
|
||||
panic("IngressInterfaceMock.AddFeatureLifecycleFunc: method is nil but IngressInterface.AddFeatureLifecycle was just called")
|
||||
}
|
||||
callInfo := struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
Lifecycle v1beta1a.IngressLifecycle
|
||||
}{
|
||||
Ctx: ctx,
|
||||
Enabled: enabled,
|
||||
Name: name,
|
||||
Lifecycle: lifecycle,
|
||||
}
|
||||
lockIngressInterfaceMockAddFeatureLifecycle.Lock()
|
||||
mock.calls.AddFeatureLifecycle = append(mock.calls.AddFeatureLifecycle, callInfo)
|
||||
lockIngressInterfaceMockAddFeatureLifecycle.Unlock()
|
||||
mock.AddFeatureLifecycleFunc(ctx, enabled, name, lifecycle)
|
||||
}
|
||||
|
||||
// AddFeatureLifecycleCalls gets all the calls that were made to AddFeatureLifecycle.
|
||||
// Check the length with:
|
||||
// len(mockedIngressInterface.AddFeatureLifecycleCalls())
|
||||
func (mock *IngressInterfaceMock) AddFeatureLifecycleCalls() []struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
Lifecycle v1beta1a.IngressLifecycle
|
||||
} {
|
||||
var calls []struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
Lifecycle v1beta1a.IngressLifecycle
|
||||
}
|
||||
lockIngressInterfaceMockAddFeatureLifecycle.RLock()
|
||||
calls = mock.calls.AddFeatureLifecycle
|
||||
lockIngressInterfaceMockAddFeatureLifecycle.RUnlock()
|
||||
return calls
|
||||
}
|
||||
|
||||
// AddHandler calls AddHandlerFunc.
|
||||
func (mock *IngressInterfaceMock) AddHandler(ctx context.Context, name string, sync v1beta1a.IngressHandlerFunc) {
|
||||
if mock.AddHandlerFunc == nil {
|
||||
|
@@ -141,14 +141,16 @@ func (mock *PodSecurityPolicyListerMock) ListCalls() []struct {
|
||||
}
|
||||
|
||||
var (
|
||||
lockPodSecurityPolicyControllerMockAddClusterScopedHandler sync.RWMutex
|
||||
lockPodSecurityPolicyControllerMockAddHandler sync.RWMutex
|
||||
lockPodSecurityPolicyControllerMockEnqueue sync.RWMutex
|
||||
lockPodSecurityPolicyControllerMockGeneric sync.RWMutex
|
||||
lockPodSecurityPolicyControllerMockInformer sync.RWMutex
|
||||
lockPodSecurityPolicyControllerMockLister sync.RWMutex
|
||||
lockPodSecurityPolicyControllerMockStart sync.RWMutex
|
||||
lockPodSecurityPolicyControllerMockSync sync.RWMutex
|
||||
lockPodSecurityPolicyControllerMockAddClusterScopedFeatureHandler sync.RWMutex
|
||||
lockPodSecurityPolicyControllerMockAddClusterScopedHandler sync.RWMutex
|
||||
lockPodSecurityPolicyControllerMockAddFeatureHandler sync.RWMutex
|
||||
lockPodSecurityPolicyControllerMockAddHandler sync.RWMutex
|
||||
lockPodSecurityPolicyControllerMockEnqueue sync.RWMutex
|
||||
lockPodSecurityPolicyControllerMockGeneric sync.RWMutex
|
||||
lockPodSecurityPolicyControllerMockInformer sync.RWMutex
|
||||
lockPodSecurityPolicyControllerMockLister sync.RWMutex
|
||||
lockPodSecurityPolicyControllerMockStart sync.RWMutex
|
||||
lockPodSecurityPolicyControllerMockSync sync.RWMutex
|
||||
)
|
||||
|
||||
// Ensure, that PodSecurityPolicyControllerMock does implement PodSecurityPolicyController.
|
||||
@@ -161,9 +163,15 @@ var _ v1beta1a.PodSecurityPolicyController = &PodSecurityPolicyControllerMock{}
|
||||
//
|
||||
// // make and configure a mocked PodSecurityPolicyController
|
||||
// mockedPodSecurityPolicyController := &PodSecurityPolicyControllerMock{
|
||||
// AddClusterScopedFeatureHandlerFunc: func(ctx context.Context, enabled func() bool, name string, clusterName string, handler v1beta1a.PodSecurityPolicyHandlerFunc) {
|
||||
// panic("mock out the AddClusterScopedFeatureHandler method")
|
||||
// },
|
||||
// AddClusterScopedHandlerFunc: func(ctx context.Context, name string, clusterName string, handler v1beta1a.PodSecurityPolicyHandlerFunc) {
|
||||
// panic("mock out the AddClusterScopedHandler method")
|
||||
// },
|
||||
// AddFeatureHandlerFunc: func(ctx context.Context, enabled func() bool, name string, sync v1beta1a.PodSecurityPolicyHandlerFunc) {
|
||||
// panic("mock out the AddFeatureHandler method")
|
||||
// },
|
||||
// AddHandlerFunc: func(ctx context.Context, name string, handler v1beta1a.PodSecurityPolicyHandlerFunc) {
|
||||
// panic("mock out the AddHandler method")
|
||||
// },
|
||||
@@ -192,9 +200,15 @@ var _ v1beta1a.PodSecurityPolicyController = &PodSecurityPolicyControllerMock{}
|
||||
//
|
||||
// }
|
||||
type PodSecurityPolicyControllerMock struct {
|
||||
// AddClusterScopedFeatureHandlerFunc mocks the AddClusterScopedFeatureHandler method.
|
||||
AddClusterScopedFeatureHandlerFunc func(ctx context.Context, enabled func() bool, name string, clusterName string, handler v1beta1a.PodSecurityPolicyHandlerFunc)
|
||||
|
||||
// AddClusterScopedHandlerFunc mocks the AddClusterScopedHandler method.
|
||||
AddClusterScopedHandlerFunc func(ctx context.Context, name string, clusterName string, handler v1beta1a.PodSecurityPolicyHandlerFunc)
|
||||
|
||||
// AddFeatureHandlerFunc mocks the AddFeatureHandler method.
|
||||
AddFeatureHandlerFunc func(ctx context.Context, enabled func() bool, name string, sync v1beta1a.PodSecurityPolicyHandlerFunc)
|
||||
|
||||
// AddHandlerFunc mocks the AddHandler method.
|
||||
AddHandlerFunc func(ctx context.Context, name string, handler v1beta1a.PodSecurityPolicyHandlerFunc)
|
||||
|
||||
@@ -218,6 +232,19 @@ type PodSecurityPolicyControllerMock 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 v1beta1a.PodSecurityPolicyHandlerFunc
|
||||
}
|
||||
// AddClusterScopedHandler holds details about calls to the AddClusterScopedHandler method.
|
||||
AddClusterScopedHandler []struct {
|
||||
// Ctx is the ctx argument value.
|
||||
@@ -229,6 +256,17 @@ type PodSecurityPolicyControllerMock struct {
|
||||
// Handler is the handler argument value.
|
||||
Handler v1beta1a.PodSecurityPolicyHandlerFunc
|
||||
}
|
||||
// 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 v1beta1a.PodSecurityPolicyHandlerFunc
|
||||
}
|
||||
// AddHandler holds details about calls to the AddHandler method.
|
||||
AddHandler []struct {
|
||||
// Ctx is the ctx argument value.
|
||||
@@ -269,6 +307,53 @@ type PodSecurityPolicyControllerMock struct {
|
||||
}
|
||||
}
|
||||
|
||||
// AddClusterScopedFeatureHandler calls AddClusterScopedFeatureHandlerFunc.
|
||||
func (mock *PodSecurityPolicyControllerMock) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name string, clusterName string, handler v1beta1a.PodSecurityPolicyHandlerFunc) {
|
||||
if mock.AddClusterScopedFeatureHandlerFunc == nil {
|
||||
panic("PodSecurityPolicyControllerMock.AddClusterScopedFeatureHandlerFunc: method is nil but PodSecurityPolicyController.AddClusterScopedFeatureHandler was just called")
|
||||
}
|
||||
callInfo := struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
ClusterName string
|
||||
Handler v1beta1a.PodSecurityPolicyHandlerFunc
|
||||
}{
|
||||
Ctx: ctx,
|
||||
Enabled: enabled,
|
||||
Name: name,
|
||||
ClusterName: clusterName,
|
||||
Handler: handler,
|
||||
}
|
||||
lockPodSecurityPolicyControllerMockAddClusterScopedFeatureHandler.Lock()
|
||||
mock.calls.AddClusterScopedFeatureHandler = append(mock.calls.AddClusterScopedFeatureHandler, callInfo)
|
||||
lockPodSecurityPolicyControllerMockAddClusterScopedFeatureHandler.Unlock()
|
||||
mock.AddClusterScopedFeatureHandlerFunc(ctx, enabled, name, clusterName, handler)
|
||||
}
|
||||
|
||||
// AddClusterScopedFeatureHandlerCalls gets all the calls that were made to AddClusterScopedFeatureHandler.
|
||||
// Check the length with:
|
||||
// len(mockedPodSecurityPolicyController.AddClusterScopedFeatureHandlerCalls())
|
||||
func (mock *PodSecurityPolicyControllerMock) AddClusterScopedFeatureHandlerCalls() []struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
ClusterName string
|
||||
Handler v1beta1a.PodSecurityPolicyHandlerFunc
|
||||
} {
|
||||
var calls []struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
ClusterName string
|
||||
Handler v1beta1a.PodSecurityPolicyHandlerFunc
|
||||
}
|
||||
lockPodSecurityPolicyControllerMockAddClusterScopedFeatureHandler.RLock()
|
||||
calls = mock.calls.AddClusterScopedFeatureHandler
|
||||
lockPodSecurityPolicyControllerMockAddClusterScopedFeatureHandler.RUnlock()
|
||||
return calls
|
||||
}
|
||||
|
||||
// AddClusterScopedHandler calls AddClusterScopedHandlerFunc.
|
||||
func (mock *PodSecurityPolicyControllerMock) AddClusterScopedHandler(ctx context.Context, name string, clusterName string, handler v1beta1a.PodSecurityPolicyHandlerFunc) {
|
||||
if mock.AddClusterScopedHandlerFunc == nil {
|
||||
@@ -312,6 +397,49 @@ func (mock *PodSecurityPolicyControllerMock) AddClusterScopedHandlerCalls() []st
|
||||
return calls
|
||||
}
|
||||
|
||||
// AddFeatureHandler calls AddFeatureHandlerFunc.
|
||||
func (mock *PodSecurityPolicyControllerMock) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync v1beta1a.PodSecurityPolicyHandlerFunc) {
|
||||
if mock.AddFeatureHandlerFunc == nil {
|
||||
panic("PodSecurityPolicyControllerMock.AddFeatureHandlerFunc: method is nil but PodSecurityPolicyController.AddFeatureHandler was just called")
|
||||
}
|
||||
callInfo := struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
Sync v1beta1a.PodSecurityPolicyHandlerFunc
|
||||
}{
|
||||
Ctx: ctx,
|
||||
Enabled: enabled,
|
||||
Name: name,
|
||||
Sync: sync,
|
||||
}
|
||||
lockPodSecurityPolicyControllerMockAddFeatureHandler.Lock()
|
||||
mock.calls.AddFeatureHandler = append(mock.calls.AddFeatureHandler, callInfo)
|
||||
lockPodSecurityPolicyControllerMockAddFeatureHandler.Unlock()
|
||||
mock.AddFeatureHandlerFunc(ctx, enabled, name, sync)
|
||||
}
|
||||
|
||||
// AddFeatureHandlerCalls gets all the calls that were made to AddFeatureHandler.
|
||||
// Check the length with:
|
||||
// len(mockedPodSecurityPolicyController.AddFeatureHandlerCalls())
|
||||
func (mock *PodSecurityPolicyControllerMock) AddFeatureHandlerCalls() []struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
Sync v1beta1a.PodSecurityPolicyHandlerFunc
|
||||
} {
|
||||
var calls []struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
Sync v1beta1a.PodSecurityPolicyHandlerFunc
|
||||
}
|
||||
lockPodSecurityPolicyControllerMockAddFeatureHandler.RLock()
|
||||
calls = mock.calls.AddFeatureHandler
|
||||
lockPodSecurityPolicyControllerMockAddFeatureHandler.RUnlock()
|
||||
return calls
|
||||
}
|
||||
|
||||
// AddHandler calls AddHandlerFunc.
|
||||
func (mock *PodSecurityPolicyControllerMock) AddHandler(ctx context.Context, name string, handler v1beta1a.PodSecurityPolicyHandlerFunc) {
|
||||
if mock.AddHandlerFunc == nil {
|
||||
@@ -531,21 +659,25 @@ func (mock *PodSecurityPolicyControllerMock) SyncCalls() []struct {
|
||||
}
|
||||
|
||||
var (
|
||||
lockPodSecurityPolicyInterfaceMockAddClusterScopedHandler sync.RWMutex
|
||||
lockPodSecurityPolicyInterfaceMockAddClusterScopedLifecycle sync.RWMutex
|
||||
lockPodSecurityPolicyInterfaceMockAddHandler sync.RWMutex
|
||||
lockPodSecurityPolicyInterfaceMockAddLifecycle sync.RWMutex
|
||||
lockPodSecurityPolicyInterfaceMockController sync.RWMutex
|
||||
lockPodSecurityPolicyInterfaceMockCreate sync.RWMutex
|
||||
lockPodSecurityPolicyInterfaceMockDelete sync.RWMutex
|
||||
lockPodSecurityPolicyInterfaceMockDeleteCollection sync.RWMutex
|
||||
lockPodSecurityPolicyInterfaceMockDeleteNamespaced sync.RWMutex
|
||||
lockPodSecurityPolicyInterfaceMockGet sync.RWMutex
|
||||
lockPodSecurityPolicyInterfaceMockGetNamespaced sync.RWMutex
|
||||
lockPodSecurityPolicyInterfaceMockList sync.RWMutex
|
||||
lockPodSecurityPolicyInterfaceMockObjectClient sync.RWMutex
|
||||
lockPodSecurityPolicyInterfaceMockUpdate sync.RWMutex
|
||||
lockPodSecurityPolicyInterfaceMockWatch sync.RWMutex
|
||||
lockPodSecurityPolicyInterfaceMockAddClusterScopedFeatureHandler sync.RWMutex
|
||||
lockPodSecurityPolicyInterfaceMockAddClusterScopedFeatureLifecycle sync.RWMutex
|
||||
lockPodSecurityPolicyInterfaceMockAddClusterScopedHandler sync.RWMutex
|
||||
lockPodSecurityPolicyInterfaceMockAddClusterScopedLifecycle sync.RWMutex
|
||||
lockPodSecurityPolicyInterfaceMockAddFeatureHandler sync.RWMutex
|
||||
lockPodSecurityPolicyInterfaceMockAddFeatureLifecycle sync.RWMutex
|
||||
lockPodSecurityPolicyInterfaceMockAddHandler sync.RWMutex
|
||||
lockPodSecurityPolicyInterfaceMockAddLifecycle sync.RWMutex
|
||||
lockPodSecurityPolicyInterfaceMockController sync.RWMutex
|
||||
lockPodSecurityPolicyInterfaceMockCreate sync.RWMutex
|
||||
lockPodSecurityPolicyInterfaceMockDelete sync.RWMutex
|
||||
lockPodSecurityPolicyInterfaceMockDeleteCollection sync.RWMutex
|
||||
lockPodSecurityPolicyInterfaceMockDeleteNamespaced sync.RWMutex
|
||||
lockPodSecurityPolicyInterfaceMockGet sync.RWMutex
|
||||
lockPodSecurityPolicyInterfaceMockGetNamespaced sync.RWMutex
|
||||
lockPodSecurityPolicyInterfaceMockList sync.RWMutex
|
||||
lockPodSecurityPolicyInterfaceMockObjectClient sync.RWMutex
|
||||
lockPodSecurityPolicyInterfaceMockUpdate sync.RWMutex
|
||||
lockPodSecurityPolicyInterfaceMockWatch sync.RWMutex
|
||||
)
|
||||
|
||||
// Ensure, that PodSecurityPolicyInterfaceMock does implement PodSecurityPolicyInterface.
|
||||
@@ -558,12 +690,24 @@ var _ v1beta1a.PodSecurityPolicyInterface = &PodSecurityPolicyInterfaceMock{}
|
||||
//
|
||||
// // make and configure a mocked PodSecurityPolicyInterface
|
||||
// mockedPodSecurityPolicyInterface := &PodSecurityPolicyInterfaceMock{
|
||||
// AddClusterScopedFeatureHandlerFunc: func(ctx context.Context, enabled func() bool, name string, clusterName string, sync v1beta1a.PodSecurityPolicyHandlerFunc) {
|
||||
// panic("mock out the AddClusterScopedFeatureHandler method")
|
||||
// },
|
||||
// AddClusterScopedFeatureLifecycleFunc: func(ctx context.Context, enabled func() bool, name string, clusterName string, lifecycle v1beta1a.PodSecurityPolicyLifecycle) {
|
||||
// panic("mock out the AddClusterScopedFeatureLifecycle method")
|
||||
// },
|
||||
// AddClusterScopedHandlerFunc: func(ctx context.Context, name string, clusterName string, sync v1beta1a.PodSecurityPolicyHandlerFunc) {
|
||||
// panic("mock out the AddClusterScopedHandler method")
|
||||
// },
|
||||
// AddClusterScopedLifecycleFunc: func(ctx context.Context, name string, clusterName string, lifecycle v1beta1a.PodSecurityPolicyLifecycle) {
|
||||
// panic("mock out the AddClusterScopedLifecycle method")
|
||||
// },
|
||||
// AddFeatureHandlerFunc: func(ctx context.Context, enabled func() bool, name string, sync v1beta1a.PodSecurityPolicyHandlerFunc) {
|
||||
// panic("mock out the AddFeatureHandler method")
|
||||
// },
|
||||
// AddFeatureLifecycleFunc: func(ctx context.Context, enabled func() bool, name string, lifecycle v1beta1a.PodSecurityPolicyLifecycle) {
|
||||
// panic("mock out the AddFeatureLifecycle method")
|
||||
// },
|
||||
// AddHandlerFunc: func(ctx context.Context, name string, sync v1beta1a.PodSecurityPolicyHandlerFunc) {
|
||||
// panic("mock out the AddHandler method")
|
||||
// },
|
||||
@@ -610,12 +754,24 @@ var _ v1beta1a.PodSecurityPolicyInterface = &PodSecurityPolicyInterfaceMock{}
|
||||
//
|
||||
// }
|
||||
type PodSecurityPolicyInterfaceMock struct {
|
||||
// AddClusterScopedFeatureHandlerFunc mocks the AddClusterScopedFeatureHandler method.
|
||||
AddClusterScopedFeatureHandlerFunc func(ctx context.Context, enabled func() bool, name string, clusterName string, sync v1beta1a.PodSecurityPolicyHandlerFunc)
|
||||
|
||||
// AddClusterScopedFeatureLifecycleFunc mocks the AddClusterScopedFeatureLifecycle method.
|
||||
AddClusterScopedFeatureLifecycleFunc func(ctx context.Context, enabled func() bool, name string, clusterName string, lifecycle v1beta1a.PodSecurityPolicyLifecycle)
|
||||
|
||||
// AddClusterScopedHandlerFunc mocks the AddClusterScopedHandler method.
|
||||
AddClusterScopedHandlerFunc func(ctx context.Context, name string, clusterName string, sync v1beta1a.PodSecurityPolicyHandlerFunc)
|
||||
|
||||
// AddClusterScopedLifecycleFunc mocks the AddClusterScopedLifecycle method.
|
||||
AddClusterScopedLifecycleFunc func(ctx context.Context, name string, clusterName string, lifecycle v1beta1a.PodSecurityPolicyLifecycle)
|
||||
|
||||
// AddFeatureHandlerFunc mocks the AddFeatureHandler method.
|
||||
AddFeatureHandlerFunc func(ctx context.Context, enabled func() bool, name string, sync v1beta1a.PodSecurityPolicyHandlerFunc)
|
||||
|
||||
// AddFeatureLifecycleFunc mocks the AddFeatureLifecycle method.
|
||||
AddFeatureLifecycleFunc func(ctx context.Context, enabled func() bool, name string, lifecycle v1beta1a.PodSecurityPolicyLifecycle)
|
||||
|
||||
// AddHandlerFunc mocks the AddHandler method.
|
||||
AddHandlerFunc func(ctx context.Context, name string, sync v1beta1a.PodSecurityPolicyHandlerFunc)
|
||||
|
||||
@@ -657,6 +813,32 @@ type PodSecurityPolicyInterfaceMock 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 v1beta1a.PodSecurityPolicyHandlerFunc
|
||||
}
|
||||
// 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 v1beta1a.PodSecurityPolicyLifecycle
|
||||
}
|
||||
// AddClusterScopedHandler holds details about calls to the AddClusterScopedHandler method.
|
||||
AddClusterScopedHandler []struct {
|
||||
// Ctx is the ctx argument value.
|
||||
@@ -679,6 +861,28 @@ type PodSecurityPolicyInterfaceMock struct {
|
||||
// Lifecycle is the lifecycle argument value.
|
||||
Lifecycle v1beta1a.PodSecurityPolicyLifecycle
|
||||
}
|
||||
// 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 v1beta1a.PodSecurityPolicyHandlerFunc
|
||||
}
|
||||
// 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 v1beta1a.PodSecurityPolicyLifecycle
|
||||
}
|
||||
// AddHandler holds details about calls to the AddHandler method.
|
||||
AddHandler []struct {
|
||||
// Ctx is the ctx argument value.
|
||||
@@ -765,6 +969,100 @@ type PodSecurityPolicyInterfaceMock struct {
|
||||
}
|
||||
}
|
||||
|
||||
// AddClusterScopedFeatureHandler calls AddClusterScopedFeatureHandlerFunc.
|
||||
func (mock *PodSecurityPolicyInterfaceMock) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name string, clusterName string, sync v1beta1a.PodSecurityPolicyHandlerFunc) {
|
||||
if mock.AddClusterScopedFeatureHandlerFunc == nil {
|
||||
panic("PodSecurityPolicyInterfaceMock.AddClusterScopedFeatureHandlerFunc: method is nil but PodSecurityPolicyInterface.AddClusterScopedFeatureHandler was just called")
|
||||
}
|
||||
callInfo := struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
ClusterName string
|
||||
Sync v1beta1a.PodSecurityPolicyHandlerFunc
|
||||
}{
|
||||
Ctx: ctx,
|
||||
Enabled: enabled,
|
||||
Name: name,
|
||||
ClusterName: clusterName,
|
||||
Sync: sync,
|
||||
}
|
||||
lockPodSecurityPolicyInterfaceMockAddClusterScopedFeatureHandler.Lock()
|
||||
mock.calls.AddClusterScopedFeatureHandler = append(mock.calls.AddClusterScopedFeatureHandler, callInfo)
|
||||
lockPodSecurityPolicyInterfaceMockAddClusterScopedFeatureHandler.Unlock()
|
||||
mock.AddClusterScopedFeatureHandlerFunc(ctx, enabled, name, clusterName, sync)
|
||||
}
|
||||
|
||||
// AddClusterScopedFeatureHandlerCalls gets all the calls that were made to AddClusterScopedFeatureHandler.
|
||||
// Check the length with:
|
||||
// len(mockedPodSecurityPolicyInterface.AddClusterScopedFeatureHandlerCalls())
|
||||
func (mock *PodSecurityPolicyInterfaceMock) AddClusterScopedFeatureHandlerCalls() []struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
ClusterName string
|
||||
Sync v1beta1a.PodSecurityPolicyHandlerFunc
|
||||
} {
|
||||
var calls []struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
ClusterName string
|
||||
Sync v1beta1a.PodSecurityPolicyHandlerFunc
|
||||
}
|
||||
lockPodSecurityPolicyInterfaceMockAddClusterScopedFeatureHandler.RLock()
|
||||
calls = mock.calls.AddClusterScopedFeatureHandler
|
||||
lockPodSecurityPolicyInterfaceMockAddClusterScopedFeatureHandler.RUnlock()
|
||||
return calls
|
||||
}
|
||||
|
||||
// AddClusterScopedFeatureLifecycle calls AddClusterScopedFeatureLifecycleFunc.
|
||||
func (mock *PodSecurityPolicyInterfaceMock) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name string, clusterName string, lifecycle v1beta1a.PodSecurityPolicyLifecycle) {
|
||||
if mock.AddClusterScopedFeatureLifecycleFunc == nil {
|
||||
panic("PodSecurityPolicyInterfaceMock.AddClusterScopedFeatureLifecycleFunc: method is nil but PodSecurityPolicyInterface.AddClusterScopedFeatureLifecycle was just called")
|
||||
}
|
||||
callInfo := struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
ClusterName string
|
||||
Lifecycle v1beta1a.PodSecurityPolicyLifecycle
|
||||
}{
|
||||
Ctx: ctx,
|
||||
Enabled: enabled,
|
||||
Name: name,
|
||||
ClusterName: clusterName,
|
||||
Lifecycle: lifecycle,
|
||||
}
|
||||
lockPodSecurityPolicyInterfaceMockAddClusterScopedFeatureLifecycle.Lock()
|
||||
mock.calls.AddClusterScopedFeatureLifecycle = append(mock.calls.AddClusterScopedFeatureLifecycle, callInfo)
|
||||
lockPodSecurityPolicyInterfaceMockAddClusterScopedFeatureLifecycle.Unlock()
|
||||
mock.AddClusterScopedFeatureLifecycleFunc(ctx, enabled, name, clusterName, lifecycle)
|
||||
}
|
||||
|
||||
// AddClusterScopedFeatureLifecycleCalls gets all the calls that were made to AddClusterScopedFeatureLifecycle.
|
||||
// Check the length with:
|
||||
// len(mockedPodSecurityPolicyInterface.AddClusterScopedFeatureLifecycleCalls())
|
||||
func (mock *PodSecurityPolicyInterfaceMock) AddClusterScopedFeatureLifecycleCalls() []struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
ClusterName string
|
||||
Lifecycle v1beta1a.PodSecurityPolicyLifecycle
|
||||
} {
|
||||
var calls []struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
ClusterName string
|
||||
Lifecycle v1beta1a.PodSecurityPolicyLifecycle
|
||||
}
|
||||
lockPodSecurityPolicyInterfaceMockAddClusterScopedFeatureLifecycle.RLock()
|
||||
calls = mock.calls.AddClusterScopedFeatureLifecycle
|
||||
lockPodSecurityPolicyInterfaceMockAddClusterScopedFeatureLifecycle.RUnlock()
|
||||
return calls
|
||||
}
|
||||
|
||||
// AddClusterScopedHandler calls AddClusterScopedHandlerFunc.
|
||||
func (mock *PodSecurityPolicyInterfaceMock) AddClusterScopedHandler(ctx context.Context, name string, clusterName string, sync v1beta1a.PodSecurityPolicyHandlerFunc) {
|
||||
if mock.AddClusterScopedHandlerFunc == nil {
|
||||
@@ -851,6 +1149,92 @@ func (mock *PodSecurityPolicyInterfaceMock) AddClusterScopedLifecycleCalls() []s
|
||||
return calls
|
||||
}
|
||||
|
||||
// AddFeatureHandler calls AddFeatureHandlerFunc.
|
||||
func (mock *PodSecurityPolicyInterfaceMock) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync v1beta1a.PodSecurityPolicyHandlerFunc) {
|
||||
if mock.AddFeatureHandlerFunc == nil {
|
||||
panic("PodSecurityPolicyInterfaceMock.AddFeatureHandlerFunc: method is nil but PodSecurityPolicyInterface.AddFeatureHandler was just called")
|
||||
}
|
||||
callInfo := struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
Sync v1beta1a.PodSecurityPolicyHandlerFunc
|
||||
}{
|
||||
Ctx: ctx,
|
||||
Enabled: enabled,
|
||||
Name: name,
|
||||
Sync: sync,
|
||||
}
|
||||
lockPodSecurityPolicyInterfaceMockAddFeatureHandler.Lock()
|
||||
mock.calls.AddFeatureHandler = append(mock.calls.AddFeatureHandler, callInfo)
|
||||
lockPodSecurityPolicyInterfaceMockAddFeatureHandler.Unlock()
|
||||
mock.AddFeatureHandlerFunc(ctx, enabled, name, sync)
|
||||
}
|
||||
|
||||
// AddFeatureHandlerCalls gets all the calls that were made to AddFeatureHandler.
|
||||
// Check the length with:
|
||||
// len(mockedPodSecurityPolicyInterface.AddFeatureHandlerCalls())
|
||||
func (mock *PodSecurityPolicyInterfaceMock) AddFeatureHandlerCalls() []struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
Sync v1beta1a.PodSecurityPolicyHandlerFunc
|
||||
} {
|
||||
var calls []struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
Sync v1beta1a.PodSecurityPolicyHandlerFunc
|
||||
}
|
||||
lockPodSecurityPolicyInterfaceMockAddFeatureHandler.RLock()
|
||||
calls = mock.calls.AddFeatureHandler
|
||||
lockPodSecurityPolicyInterfaceMockAddFeatureHandler.RUnlock()
|
||||
return calls
|
||||
}
|
||||
|
||||
// AddFeatureLifecycle calls AddFeatureLifecycleFunc.
|
||||
func (mock *PodSecurityPolicyInterfaceMock) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle v1beta1a.PodSecurityPolicyLifecycle) {
|
||||
if mock.AddFeatureLifecycleFunc == nil {
|
||||
panic("PodSecurityPolicyInterfaceMock.AddFeatureLifecycleFunc: method is nil but PodSecurityPolicyInterface.AddFeatureLifecycle was just called")
|
||||
}
|
||||
callInfo := struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
Lifecycle v1beta1a.PodSecurityPolicyLifecycle
|
||||
}{
|
||||
Ctx: ctx,
|
||||
Enabled: enabled,
|
||||
Name: name,
|
||||
Lifecycle: lifecycle,
|
||||
}
|
||||
lockPodSecurityPolicyInterfaceMockAddFeatureLifecycle.Lock()
|
||||
mock.calls.AddFeatureLifecycle = append(mock.calls.AddFeatureLifecycle, callInfo)
|
||||
lockPodSecurityPolicyInterfaceMockAddFeatureLifecycle.Unlock()
|
||||
mock.AddFeatureLifecycleFunc(ctx, enabled, name, lifecycle)
|
||||
}
|
||||
|
||||
// AddFeatureLifecycleCalls gets all the calls that were made to AddFeatureLifecycle.
|
||||
// Check the length with:
|
||||
// len(mockedPodSecurityPolicyInterface.AddFeatureLifecycleCalls())
|
||||
func (mock *PodSecurityPolicyInterfaceMock) AddFeatureLifecycleCalls() []struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
Lifecycle v1beta1a.PodSecurityPolicyLifecycle
|
||||
} {
|
||||
var calls []struct {
|
||||
Ctx context.Context
|
||||
Enabled func() bool
|
||||
Name string
|
||||
Lifecycle v1beta1a.PodSecurityPolicyLifecycle
|
||||
}
|
||||
lockPodSecurityPolicyInterfaceMockAddFeatureLifecycle.RLock()
|
||||
calls = mock.calls.AddFeatureLifecycle
|
||||
lockPodSecurityPolicyInterfaceMockAddFeatureLifecycle.RUnlock()
|
||||
return calls
|
||||
}
|
||||
|
||||
// AddHandler calls AddHandlerFunc.
|
||||
func (mock *PodSecurityPolicyInterfaceMock) AddHandler(ctx context.Context, name string, sync v1beta1a.PodSecurityPolicyHandlerFunc) {
|
||||
if mock.AddHandlerFunc == nil {
|
||||
|
@@ -69,7 +69,9 @@ type IngressController interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() IngressLister
|
||||
AddHandler(ctx context.Context, name string, handler IngressHandlerFunc)
|
||||
AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync IngressHandlerFunc)
|
||||
AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler IngressHandlerFunc)
|
||||
AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler IngressHandlerFunc)
|
||||
Enqueue(namespace, name string)
|
||||
Sync(ctx context.Context) error
|
||||
Start(ctx context.Context, threadiness int) error
|
||||
@@ -88,9 +90,13 @@ type IngressInterface interface {
|
||||
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Controller() IngressController
|
||||
AddHandler(ctx context.Context, name string, sync IngressHandlerFunc)
|
||||
AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync IngressHandlerFunc)
|
||||
AddLifecycle(ctx context.Context, name string, lifecycle IngressLifecycle)
|
||||
AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle IngressLifecycle)
|
||||
AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync IngressHandlerFunc)
|
||||
AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync IngressHandlerFunc)
|
||||
AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle IngressLifecycle)
|
||||
AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle IngressLifecycle)
|
||||
}
|
||||
|
||||
type ingressLister struct {
|
||||
@@ -150,6 +156,20 @@ func (c *ingressController) AddHandler(ctx context.Context, name string, handler
|
||||
})
|
||||
}
|
||||
|
||||
func (c *ingressController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler IngressHandlerFunc) {
|
||||
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.(*v1beta1.Ingress); ok {
|
||||
return handler(key, v)
|
||||
} else {
|
||||
return nil, nil
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func (c *ingressController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler IngressHandlerFunc) {
|
||||
resource.PutClusterScoped(IngressGroupVersionResource)
|
||||
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
|
||||
@@ -163,6 +183,21 @@ func (c *ingressController) AddClusterScopedHandler(ctx context.Context, name, c
|
||||
})
|
||||
}
|
||||
|
||||
func (c *ingressController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler IngressHandlerFunc) {
|
||||
resource.PutClusterScoped(IngressGroupVersionResource)
|
||||
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.(*v1beta1.Ingress); ok && controller.ObjectInCluster(cluster, obj) {
|
||||
return handler(key, v)
|
||||
} else {
|
||||
return nil, nil
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
type ingressFactory struct {
|
||||
}
|
||||
|
||||
@@ -258,20 +293,38 @@ func (s *ingressClient) AddHandler(ctx context.Context, name string, sync Ingres
|
||||
s.Controller().AddHandler(ctx, name, sync)
|
||||
}
|
||||
|
||||
func (s *ingressClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync IngressHandlerFunc) {
|
||||
s.Controller().AddFeatureHandler(ctx, enabled, name, sync)
|
||||
}
|
||||
|
||||
func (s *ingressClient) AddLifecycle(ctx context.Context, name string, lifecycle IngressLifecycle) {
|
||||
sync := NewIngressLifecycleAdapter(name, false, s, lifecycle)
|
||||
s.Controller().AddHandler(ctx, name, sync)
|
||||
}
|
||||
|
||||
func (s *ingressClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle IngressLifecycle) {
|
||||
sync := NewIngressLifecycleAdapter(name, false, s, lifecycle)
|
||||
s.Controller().AddFeatureHandler(ctx, enabled, name, sync)
|
||||
}
|
||||
|
||||
func (s *ingressClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync IngressHandlerFunc) {
|
||||
s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync)
|
||||
}
|
||||
|
||||
func (s *ingressClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync IngressHandlerFunc) {
|
||||
s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync)
|
||||
}
|
||||
|
||||
func (s *ingressClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle IngressLifecycle) {
|
||||
sync := NewIngressLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle)
|
||||
s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync)
|
||||
}
|
||||
|
||||
func (s *ingressClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle IngressLifecycle) {
|
||||
sync := NewIngressLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle)
|
||||
s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync)
|
||||
}
|
||||
|
||||
type IngressIndexer func(obj *v1beta1.Ingress) ([]string, error)
|
||||
|
||||
type IngressClientCache interface {
|
||||
|
@@ -68,7 +68,9 @@ type PodSecurityPolicyController interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() PodSecurityPolicyLister
|
||||
AddHandler(ctx context.Context, name string, handler PodSecurityPolicyHandlerFunc)
|
||||
AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync PodSecurityPolicyHandlerFunc)
|
||||
AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler PodSecurityPolicyHandlerFunc)
|
||||
AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler PodSecurityPolicyHandlerFunc)
|
||||
Enqueue(namespace, name string)
|
||||
Sync(ctx context.Context) error
|
||||
Start(ctx context.Context, threadiness int) error
|
||||
@@ -87,9 +89,13 @@ type PodSecurityPolicyInterface interface {
|
||||
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Controller() PodSecurityPolicyController
|
||||
AddHandler(ctx context.Context, name string, sync PodSecurityPolicyHandlerFunc)
|
||||
AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync PodSecurityPolicyHandlerFunc)
|
||||
AddLifecycle(ctx context.Context, name string, lifecycle PodSecurityPolicyLifecycle)
|
||||
AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle PodSecurityPolicyLifecycle)
|
||||
AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync PodSecurityPolicyHandlerFunc)
|
||||
AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync PodSecurityPolicyHandlerFunc)
|
||||
AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle PodSecurityPolicyLifecycle)
|
||||
AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle PodSecurityPolicyLifecycle)
|
||||
}
|
||||
|
||||
type podSecurityPolicyLister struct {
|
||||
@@ -149,6 +155,20 @@ func (c *podSecurityPolicyController) AddHandler(ctx context.Context, name strin
|
||||
})
|
||||
}
|
||||
|
||||
func (c *podSecurityPolicyController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler PodSecurityPolicyHandlerFunc) {
|
||||
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.(*v1beta1.PodSecurityPolicy); ok {
|
||||
return handler(key, v)
|
||||
} else {
|
||||
return nil, nil
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func (c *podSecurityPolicyController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler PodSecurityPolicyHandlerFunc) {
|
||||
resource.PutClusterScoped(PodSecurityPolicyGroupVersionResource)
|
||||
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
|
||||
@@ -162,6 +182,21 @@ func (c *podSecurityPolicyController) AddClusterScopedHandler(ctx context.Contex
|
||||
})
|
||||
}
|
||||
|
||||
func (c *podSecurityPolicyController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler PodSecurityPolicyHandlerFunc) {
|
||||
resource.PutClusterScoped(PodSecurityPolicyGroupVersionResource)
|
||||
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.(*v1beta1.PodSecurityPolicy); ok && controller.ObjectInCluster(cluster, obj) {
|
||||
return handler(key, v)
|
||||
} else {
|
||||
return nil, nil
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
type podSecurityPolicyFactory struct {
|
||||
}
|
||||
|
||||
@@ -257,20 +292,38 @@ func (s *podSecurityPolicyClient) AddHandler(ctx context.Context, name string, s
|
||||
s.Controller().AddHandler(ctx, name, sync)
|
||||
}
|
||||
|
||||
func (s *podSecurityPolicyClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync PodSecurityPolicyHandlerFunc) {
|
||||
s.Controller().AddFeatureHandler(ctx, enabled, name, sync)
|
||||
}
|
||||
|
||||
func (s *podSecurityPolicyClient) AddLifecycle(ctx context.Context, name string, lifecycle PodSecurityPolicyLifecycle) {
|
||||
sync := NewPodSecurityPolicyLifecycleAdapter(name, false, s, lifecycle)
|
||||
s.Controller().AddHandler(ctx, name, sync)
|
||||
}
|
||||
|
||||
func (s *podSecurityPolicyClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle PodSecurityPolicyLifecycle) {
|
||||
sync := NewPodSecurityPolicyLifecycleAdapter(name, false, s, lifecycle)
|
||||
s.Controller().AddFeatureHandler(ctx, enabled, name, sync)
|
||||
}
|
||||
|
||||
func (s *podSecurityPolicyClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync PodSecurityPolicyHandlerFunc) {
|
||||
s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync)
|
||||
}
|
||||
|
||||
func (s *podSecurityPolicyClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync PodSecurityPolicyHandlerFunc) {
|
||||
s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync)
|
||||
}
|
||||
|
||||
func (s *podSecurityPolicyClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle PodSecurityPolicyLifecycle) {
|
||||
sync := NewPodSecurityPolicyLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle)
|
||||
s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync)
|
||||
}
|
||||
|
||||
func (s *podSecurityPolicyClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle PodSecurityPolicyLifecycle) {
|
||||
sync := NewPodSecurityPolicyLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle)
|
||||
s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync)
|
||||
}
|
||||
|
||||
type PodSecurityPolicyIndexer func(obj *v1beta1.PodSecurityPolicy) ([]string, error)
|
||||
|
||||
type PodSecurityPolicyClientCache interface {
|
||||
|
Reference in New Issue
Block a user