diff --git a/apis/management.cattle.io/v3/fakes/zz_generated_cis_benchmark_version_mock.go b/apis/management.cattle.io/v3/fakes/zz_generated_cis_benchmark_version_mock.go new file mode 100644 index 00000000..a98d3ac1 --- /dev/null +++ b/apis/management.cattle.io/v3/fakes/zz_generated_cis_benchmark_version_mock.go @@ -0,0 +1,1789 @@ +// Code generated by moq; DO NOT EDIT. +// github.com/matryer/moq + +package fakes + +import ( + context "context" + sync "sync" + + controller "github.com/rancher/norman/controller" + objectclient "github.com/rancher/norman/objectclient" + v3 "github.com/rancher/types/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +var ( + lockCisBenchmarkVersionListerMockGet sync.RWMutex + lockCisBenchmarkVersionListerMockList sync.RWMutex +) + +// Ensure, that CisBenchmarkVersionListerMock does implement CisBenchmarkVersionLister. +// If this is not the case, regenerate this file with moq. +var _ v3.CisBenchmarkVersionLister = &CisBenchmarkVersionListerMock{} + +// CisBenchmarkVersionListerMock is a mock implementation of CisBenchmarkVersionLister. +// +// func TestSomethingThatUsesCisBenchmarkVersionLister(t *testing.T) { +// +// // make and configure a mocked CisBenchmarkVersionLister +// mockedCisBenchmarkVersionLister := &CisBenchmarkVersionListerMock{ +// GetFunc: func(namespace string, name string) (*v3.CisBenchmarkVersion, error) { +// panic("mock out the Get method") +// }, +// ListFunc: func(namespace string, selector labels.Selector) ([]*v3.CisBenchmarkVersion, error) { +// panic("mock out the List method") +// }, +// } +// +// // use mockedCisBenchmarkVersionLister in code that requires CisBenchmarkVersionLister +// // and then make assertions. +// +// } +type CisBenchmarkVersionListerMock struct { + // GetFunc mocks the Get method. + GetFunc func(namespace string, name string) (*v3.CisBenchmarkVersion, error) + + // ListFunc mocks the List method. + ListFunc func(namespace string, selector labels.Selector) ([]*v3.CisBenchmarkVersion, error) + + // calls tracks calls to the methods. + calls struct { + // Get holds details about calls to the Get method. + Get []struct { + // Namespace is the namespace argument value. + Namespace string + // Name is the name argument value. + Name string + } + // List holds details about calls to the List method. + List []struct { + // Namespace is the namespace argument value. + Namespace string + // Selector is the selector argument value. + Selector labels.Selector + } + } +} + +// Get calls GetFunc. +func (mock *CisBenchmarkVersionListerMock) Get(namespace string, name string) (*v3.CisBenchmarkVersion, error) { + if mock.GetFunc == nil { + panic("CisBenchmarkVersionListerMock.GetFunc: method is nil but CisBenchmarkVersionLister.Get was just called") + } + callInfo := struct { + Namespace string + Name string + }{ + Namespace: namespace, + Name: name, + } + lockCisBenchmarkVersionListerMockGet.Lock() + mock.calls.Get = append(mock.calls.Get, callInfo) + lockCisBenchmarkVersionListerMockGet.Unlock() + return mock.GetFunc(namespace, name) +} + +// GetCalls gets all the calls that were made to Get. +// Check the length with: +// len(mockedCisBenchmarkVersionLister.GetCalls()) +func (mock *CisBenchmarkVersionListerMock) GetCalls() []struct { + Namespace string + Name string +} { + var calls []struct { + Namespace string + Name string + } + lockCisBenchmarkVersionListerMockGet.RLock() + calls = mock.calls.Get + lockCisBenchmarkVersionListerMockGet.RUnlock() + return calls +} + +// List calls ListFunc. +func (mock *CisBenchmarkVersionListerMock) List(namespace string, selector labels.Selector) ([]*v3.CisBenchmarkVersion, error) { + if mock.ListFunc == nil { + panic("CisBenchmarkVersionListerMock.ListFunc: method is nil but CisBenchmarkVersionLister.List was just called") + } + callInfo := struct { + Namespace string + Selector labels.Selector + }{ + Namespace: namespace, + Selector: selector, + } + lockCisBenchmarkVersionListerMockList.Lock() + mock.calls.List = append(mock.calls.List, callInfo) + lockCisBenchmarkVersionListerMockList.Unlock() + return mock.ListFunc(namespace, selector) +} + +// ListCalls gets all the calls that were made to List. +// Check the length with: +// len(mockedCisBenchmarkVersionLister.ListCalls()) +func (mock *CisBenchmarkVersionListerMock) ListCalls() []struct { + Namespace string + Selector labels.Selector +} { + var calls []struct { + Namespace string + Selector labels.Selector + } + lockCisBenchmarkVersionListerMockList.RLock() + calls = mock.calls.List + lockCisBenchmarkVersionListerMockList.RUnlock() + return calls +} + +var ( + lockCisBenchmarkVersionControllerMockAddClusterScopedFeatureHandler sync.RWMutex + lockCisBenchmarkVersionControllerMockAddClusterScopedHandler sync.RWMutex + lockCisBenchmarkVersionControllerMockAddFeatureHandler sync.RWMutex + lockCisBenchmarkVersionControllerMockAddHandler sync.RWMutex + lockCisBenchmarkVersionControllerMockEnqueue sync.RWMutex + lockCisBenchmarkVersionControllerMockGeneric sync.RWMutex + lockCisBenchmarkVersionControllerMockInformer sync.RWMutex + lockCisBenchmarkVersionControllerMockLister sync.RWMutex + lockCisBenchmarkVersionControllerMockStart sync.RWMutex + lockCisBenchmarkVersionControllerMockSync sync.RWMutex +) + +// Ensure, that CisBenchmarkVersionControllerMock does implement CisBenchmarkVersionController. +// If this is not the case, regenerate this file with moq. +var _ v3.CisBenchmarkVersionController = &CisBenchmarkVersionControllerMock{} + +// CisBenchmarkVersionControllerMock is a mock implementation of CisBenchmarkVersionController. +// +// func TestSomethingThatUsesCisBenchmarkVersionController(t *testing.T) { +// +// // make and configure a mocked CisBenchmarkVersionController +// mockedCisBenchmarkVersionController := &CisBenchmarkVersionControllerMock{ +// AddClusterScopedFeatureHandlerFunc: func(ctx context.Context, enabled func() bool, name string, clusterName string, handler v3.CisBenchmarkVersionHandlerFunc) { +// panic("mock out the AddClusterScopedFeatureHandler method") +// }, +// AddClusterScopedHandlerFunc: func(ctx context.Context, name string, clusterName string, handler v3.CisBenchmarkVersionHandlerFunc) { +// panic("mock out the AddClusterScopedHandler method") +// }, +// AddFeatureHandlerFunc: func(ctx context.Context, enabled func() bool, name string, sync v3.CisBenchmarkVersionHandlerFunc) { +// panic("mock out the AddFeatureHandler method") +// }, +// AddHandlerFunc: func(ctx context.Context, name string, handler v3.CisBenchmarkVersionHandlerFunc) { +// panic("mock out the AddHandler method") +// }, +// EnqueueFunc: func(namespace string, name string) { +// panic("mock out the Enqueue method") +// }, +// GenericFunc: func() controller.GenericController { +// panic("mock out the Generic method") +// }, +// InformerFunc: func() cache.SharedIndexInformer { +// panic("mock out the Informer method") +// }, +// ListerFunc: func() v3.CisBenchmarkVersionLister { +// panic("mock out the Lister method") +// }, +// StartFunc: func(ctx context.Context, threadiness int) error { +// panic("mock out the Start method") +// }, +// SyncFunc: func(ctx context.Context) error { +// panic("mock out the Sync method") +// }, +// } +// +// // use mockedCisBenchmarkVersionController in code that requires CisBenchmarkVersionController +// // and then make assertions. +// +// } +type CisBenchmarkVersionControllerMock struct { + // AddClusterScopedFeatureHandlerFunc mocks the AddClusterScopedFeatureHandler method. + AddClusterScopedFeatureHandlerFunc func(ctx context.Context, enabled func() bool, name string, clusterName string, handler v3.CisBenchmarkVersionHandlerFunc) + + // AddClusterScopedHandlerFunc mocks the AddClusterScopedHandler method. + AddClusterScopedHandlerFunc func(ctx context.Context, name string, clusterName string, handler v3.CisBenchmarkVersionHandlerFunc) + + // AddFeatureHandlerFunc mocks the AddFeatureHandler method. + AddFeatureHandlerFunc func(ctx context.Context, enabled func() bool, name string, sync v3.CisBenchmarkVersionHandlerFunc) + + // AddHandlerFunc mocks the AddHandler method. + AddHandlerFunc func(ctx context.Context, name string, handler v3.CisBenchmarkVersionHandlerFunc) + + // EnqueueFunc mocks the Enqueue method. + EnqueueFunc func(namespace string, name string) + + // GenericFunc mocks the Generic method. + GenericFunc func() controller.GenericController + + // InformerFunc mocks the Informer method. + InformerFunc func() cache.SharedIndexInformer + + // ListerFunc mocks the Lister method. + ListerFunc func() v3.CisBenchmarkVersionLister + + // StartFunc mocks the Start method. + StartFunc func(ctx context.Context, threadiness int) error + + // SyncFunc mocks the Sync method. + SyncFunc func(ctx context.Context) error + + // 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 v3.CisBenchmarkVersionHandlerFunc + } + // AddClusterScopedHandler holds details about calls to the AddClusterScopedHandler method. + AddClusterScopedHandler []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Name is the name argument value. + Name string + // ClusterName is the clusterName argument value. + ClusterName string + // Handler is the handler argument value. + Handler v3.CisBenchmarkVersionHandlerFunc + } + // 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 v3.CisBenchmarkVersionHandlerFunc + } + // AddHandler holds details about calls to the AddHandler method. + AddHandler []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Name is the name argument value. + Name string + // Handler is the handler argument value. + Handler v3.CisBenchmarkVersionHandlerFunc + } + // Enqueue holds details about calls to the Enqueue method. + Enqueue []struct { + // Namespace is the namespace argument value. + Namespace string + // Name is the name argument value. + Name string + } + // Generic holds details about calls to the Generic method. + Generic []struct { + } + // Informer holds details about calls to the Informer method. + Informer []struct { + } + // Lister holds details about calls to the Lister method. + Lister []struct { + } + // Start holds details about calls to the Start method. + Start []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Threadiness is the threadiness argument value. + Threadiness int + } + // Sync holds details about calls to the Sync method. + Sync []struct { + // Ctx is the ctx argument value. + Ctx context.Context + } + } +} + +// AddClusterScopedFeatureHandler calls AddClusterScopedFeatureHandlerFunc. +func (mock *CisBenchmarkVersionControllerMock) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name string, clusterName string, handler v3.CisBenchmarkVersionHandlerFunc) { + if mock.AddClusterScopedFeatureHandlerFunc == nil { + panic("CisBenchmarkVersionControllerMock.AddClusterScopedFeatureHandlerFunc: method is nil but CisBenchmarkVersionController.AddClusterScopedFeatureHandler was just called") + } + callInfo := struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Handler v3.CisBenchmarkVersionHandlerFunc + }{ + Ctx: ctx, + Enabled: enabled, + Name: name, + ClusterName: clusterName, + Handler: handler, + } + lockCisBenchmarkVersionControllerMockAddClusterScopedFeatureHandler.Lock() + mock.calls.AddClusterScopedFeatureHandler = append(mock.calls.AddClusterScopedFeatureHandler, callInfo) + lockCisBenchmarkVersionControllerMockAddClusterScopedFeatureHandler.Unlock() + mock.AddClusterScopedFeatureHandlerFunc(ctx, enabled, name, clusterName, handler) +} + +// AddClusterScopedFeatureHandlerCalls gets all the calls that were made to AddClusterScopedFeatureHandler. +// Check the length with: +// len(mockedCisBenchmarkVersionController.AddClusterScopedFeatureHandlerCalls()) +func (mock *CisBenchmarkVersionControllerMock) AddClusterScopedFeatureHandlerCalls() []struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Handler v3.CisBenchmarkVersionHandlerFunc +} { + var calls []struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Handler v3.CisBenchmarkVersionHandlerFunc + } + lockCisBenchmarkVersionControllerMockAddClusterScopedFeatureHandler.RLock() + calls = mock.calls.AddClusterScopedFeatureHandler + lockCisBenchmarkVersionControllerMockAddClusterScopedFeatureHandler.RUnlock() + return calls +} + +// AddClusterScopedHandler calls AddClusterScopedHandlerFunc. +func (mock *CisBenchmarkVersionControllerMock) AddClusterScopedHandler(ctx context.Context, name string, clusterName string, handler v3.CisBenchmarkVersionHandlerFunc) { + if mock.AddClusterScopedHandlerFunc == nil { + panic("CisBenchmarkVersionControllerMock.AddClusterScopedHandlerFunc: method is nil but CisBenchmarkVersionController.AddClusterScopedHandler was just called") + } + callInfo := struct { + Ctx context.Context + Name string + ClusterName string + Handler v3.CisBenchmarkVersionHandlerFunc + }{ + Ctx: ctx, + Name: name, + ClusterName: clusterName, + Handler: handler, + } + lockCisBenchmarkVersionControllerMockAddClusterScopedHandler.Lock() + mock.calls.AddClusterScopedHandler = append(mock.calls.AddClusterScopedHandler, callInfo) + lockCisBenchmarkVersionControllerMockAddClusterScopedHandler.Unlock() + mock.AddClusterScopedHandlerFunc(ctx, name, clusterName, handler) +} + +// AddClusterScopedHandlerCalls gets all the calls that were made to AddClusterScopedHandler. +// Check the length with: +// len(mockedCisBenchmarkVersionController.AddClusterScopedHandlerCalls()) +func (mock *CisBenchmarkVersionControllerMock) AddClusterScopedHandlerCalls() []struct { + Ctx context.Context + Name string + ClusterName string + Handler v3.CisBenchmarkVersionHandlerFunc +} { + var calls []struct { + Ctx context.Context + Name string + ClusterName string + Handler v3.CisBenchmarkVersionHandlerFunc + } + lockCisBenchmarkVersionControllerMockAddClusterScopedHandler.RLock() + calls = mock.calls.AddClusterScopedHandler + lockCisBenchmarkVersionControllerMockAddClusterScopedHandler.RUnlock() + return calls +} + +// AddFeatureHandler calls AddFeatureHandlerFunc. +func (mock *CisBenchmarkVersionControllerMock) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync v3.CisBenchmarkVersionHandlerFunc) { + if mock.AddFeatureHandlerFunc == nil { + panic("CisBenchmarkVersionControllerMock.AddFeatureHandlerFunc: method is nil but CisBenchmarkVersionController.AddFeatureHandler was just called") + } + callInfo := struct { + Ctx context.Context + Enabled func() bool + Name string + Sync v3.CisBenchmarkVersionHandlerFunc + }{ + Ctx: ctx, + Enabled: enabled, + Name: name, + Sync: sync, + } + lockCisBenchmarkVersionControllerMockAddFeatureHandler.Lock() + mock.calls.AddFeatureHandler = append(mock.calls.AddFeatureHandler, callInfo) + lockCisBenchmarkVersionControllerMockAddFeatureHandler.Unlock() + mock.AddFeatureHandlerFunc(ctx, enabled, name, sync) +} + +// AddFeatureHandlerCalls gets all the calls that were made to AddFeatureHandler. +// Check the length with: +// len(mockedCisBenchmarkVersionController.AddFeatureHandlerCalls()) +func (mock *CisBenchmarkVersionControllerMock) AddFeatureHandlerCalls() []struct { + Ctx context.Context + Enabled func() bool + Name string + Sync v3.CisBenchmarkVersionHandlerFunc +} { + var calls []struct { + Ctx context.Context + Enabled func() bool + Name string + Sync v3.CisBenchmarkVersionHandlerFunc + } + lockCisBenchmarkVersionControllerMockAddFeatureHandler.RLock() + calls = mock.calls.AddFeatureHandler + lockCisBenchmarkVersionControllerMockAddFeatureHandler.RUnlock() + return calls +} + +// AddHandler calls AddHandlerFunc. +func (mock *CisBenchmarkVersionControllerMock) AddHandler(ctx context.Context, name string, handler v3.CisBenchmarkVersionHandlerFunc) { + if mock.AddHandlerFunc == nil { + panic("CisBenchmarkVersionControllerMock.AddHandlerFunc: method is nil but CisBenchmarkVersionController.AddHandler was just called") + } + callInfo := struct { + Ctx context.Context + Name string + Handler v3.CisBenchmarkVersionHandlerFunc + }{ + Ctx: ctx, + Name: name, + Handler: handler, + } + lockCisBenchmarkVersionControllerMockAddHandler.Lock() + mock.calls.AddHandler = append(mock.calls.AddHandler, callInfo) + lockCisBenchmarkVersionControllerMockAddHandler.Unlock() + mock.AddHandlerFunc(ctx, name, handler) +} + +// AddHandlerCalls gets all the calls that were made to AddHandler. +// Check the length with: +// len(mockedCisBenchmarkVersionController.AddHandlerCalls()) +func (mock *CisBenchmarkVersionControllerMock) AddHandlerCalls() []struct { + Ctx context.Context + Name string + Handler v3.CisBenchmarkVersionHandlerFunc +} { + var calls []struct { + Ctx context.Context + Name string + Handler v3.CisBenchmarkVersionHandlerFunc + } + lockCisBenchmarkVersionControllerMockAddHandler.RLock() + calls = mock.calls.AddHandler + lockCisBenchmarkVersionControllerMockAddHandler.RUnlock() + return calls +} + +// Enqueue calls EnqueueFunc. +func (mock *CisBenchmarkVersionControllerMock) Enqueue(namespace string, name string) { + if mock.EnqueueFunc == nil { + panic("CisBenchmarkVersionControllerMock.EnqueueFunc: method is nil but CisBenchmarkVersionController.Enqueue was just called") + } + callInfo := struct { + Namespace string + Name string + }{ + Namespace: namespace, + Name: name, + } + lockCisBenchmarkVersionControllerMockEnqueue.Lock() + mock.calls.Enqueue = append(mock.calls.Enqueue, callInfo) + lockCisBenchmarkVersionControllerMockEnqueue.Unlock() + mock.EnqueueFunc(namespace, name) +} + +// EnqueueCalls gets all the calls that were made to Enqueue. +// Check the length with: +// len(mockedCisBenchmarkVersionController.EnqueueCalls()) +func (mock *CisBenchmarkVersionControllerMock) EnqueueCalls() []struct { + Namespace string + Name string +} { + var calls []struct { + Namespace string + Name string + } + lockCisBenchmarkVersionControllerMockEnqueue.RLock() + calls = mock.calls.Enqueue + lockCisBenchmarkVersionControllerMockEnqueue.RUnlock() + return calls +} + +// Generic calls GenericFunc. +func (mock *CisBenchmarkVersionControllerMock) Generic() controller.GenericController { + if mock.GenericFunc == nil { + panic("CisBenchmarkVersionControllerMock.GenericFunc: method is nil but CisBenchmarkVersionController.Generic was just called") + } + callInfo := struct { + }{} + lockCisBenchmarkVersionControllerMockGeneric.Lock() + mock.calls.Generic = append(mock.calls.Generic, callInfo) + lockCisBenchmarkVersionControllerMockGeneric.Unlock() + return mock.GenericFunc() +} + +// GenericCalls gets all the calls that were made to Generic. +// Check the length with: +// len(mockedCisBenchmarkVersionController.GenericCalls()) +func (mock *CisBenchmarkVersionControllerMock) GenericCalls() []struct { +} { + var calls []struct { + } + lockCisBenchmarkVersionControllerMockGeneric.RLock() + calls = mock.calls.Generic + lockCisBenchmarkVersionControllerMockGeneric.RUnlock() + return calls +} + +// Informer calls InformerFunc. +func (mock *CisBenchmarkVersionControllerMock) Informer() cache.SharedIndexInformer { + if mock.InformerFunc == nil { + panic("CisBenchmarkVersionControllerMock.InformerFunc: method is nil but CisBenchmarkVersionController.Informer was just called") + } + callInfo := struct { + }{} + lockCisBenchmarkVersionControllerMockInformer.Lock() + mock.calls.Informer = append(mock.calls.Informer, callInfo) + lockCisBenchmarkVersionControllerMockInformer.Unlock() + return mock.InformerFunc() +} + +// InformerCalls gets all the calls that were made to Informer. +// Check the length with: +// len(mockedCisBenchmarkVersionController.InformerCalls()) +func (mock *CisBenchmarkVersionControllerMock) InformerCalls() []struct { +} { + var calls []struct { + } + lockCisBenchmarkVersionControllerMockInformer.RLock() + calls = mock.calls.Informer + lockCisBenchmarkVersionControllerMockInformer.RUnlock() + return calls +} + +// Lister calls ListerFunc. +func (mock *CisBenchmarkVersionControllerMock) Lister() v3.CisBenchmarkVersionLister { + if mock.ListerFunc == nil { + panic("CisBenchmarkVersionControllerMock.ListerFunc: method is nil but CisBenchmarkVersionController.Lister was just called") + } + callInfo := struct { + }{} + lockCisBenchmarkVersionControllerMockLister.Lock() + mock.calls.Lister = append(mock.calls.Lister, callInfo) + lockCisBenchmarkVersionControllerMockLister.Unlock() + return mock.ListerFunc() +} + +// ListerCalls gets all the calls that were made to Lister. +// Check the length with: +// len(mockedCisBenchmarkVersionController.ListerCalls()) +func (mock *CisBenchmarkVersionControllerMock) ListerCalls() []struct { +} { + var calls []struct { + } + lockCisBenchmarkVersionControllerMockLister.RLock() + calls = mock.calls.Lister + lockCisBenchmarkVersionControllerMockLister.RUnlock() + return calls +} + +// Start calls StartFunc. +func (mock *CisBenchmarkVersionControllerMock) Start(ctx context.Context, threadiness int) error { + if mock.StartFunc == nil { + panic("CisBenchmarkVersionControllerMock.StartFunc: method is nil but CisBenchmarkVersionController.Start was just called") + } + callInfo := struct { + Ctx context.Context + Threadiness int + }{ + Ctx: ctx, + Threadiness: threadiness, + } + lockCisBenchmarkVersionControllerMockStart.Lock() + mock.calls.Start = append(mock.calls.Start, callInfo) + lockCisBenchmarkVersionControllerMockStart.Unlock() + return mock.StartFunc(ctx, threadiness) +} + +// StartCalls gets all the calls that were made to Start. +// Check the length with: +// len(mockedCisBenchmarkVersionController.StartCalls()) +func (mock *CisBenchmarkVersionControllerMock) StartCalls() []struct { + Ctx context.Context + Threadiness int +} { + var calls []struct { + Ctx context.Context + Threadiness int + } + lockCisBenchmarkVersionControllerMockStart.RLock() + calls = mock.calls.Start + lockCisBenchmarkVersionControllerMockStart.RUnlock() + return calls +} + +// Sync calls SyncFunc. +func (mock *CisBenchmarkVersionControllerMock) Sync(ctx context.Context) error { + if mock.SyncFunc == nil { + panic("CisBenchmarkVersionControllerMock.SyncFunc: method is nil but CisBenchmarkVersionController.Sync was just called") + } + callInfo := struct { + Ctx context.Context + }{ + Ctx: ctx, + } + lockCisBenchmarkVersionControllerMockSync.Lock() + mock.calls.Sync = append(mock.calls.Sync, callInfo) + lockCisBenchmarkVersionControllerMockSync.Unlock() + return mock.SyncFunc(ctx) +} + +// SyncCalls gets all the calls that were made to Sync. +// Check the length with: +// len(mockedCisBenchmarkVersionController.SyncCalls()) +func (mock *CisBenchmarkVersionControllerMock) SyncCalls() []struct { + Ctx context.Context +} { + var calls []struct { + Ctx context.Context + } + lockCisBenchmarkVersionControllerMockSync.RLock() + calls = mock.calls.Sync + lockCisBenchmarkVersionControllerMockSync.RUnlock() + return calls +} + +var ( + lockCisBenchmarkVersionInterfaceMockAddClusterScopedFeatureHandler sync.RWMutex + lockCisBenchmarkVersionInterfaceMockAddClusterScopedFeatureLifecycle sync.RWMutex + lockCisBenchmarkVersionInterfaceMockAddClusterScopedHandler sync.RWMutex + lockCisBenchmarkVersionInterfaceMockAddClusterScopedLifecycle sync.RWMutex + lockCisBenchmarkVersionInterfaceMockAddFeatureHandler sync.RWMutex + lockCisBenchmarkVersionInterfaceMockAddFeatureLifecycle sync.RWMutex + lockCisBenchmarkVersionInterfaceMockAddHandler sync.RWMutex + lockCisBenchmarkVersionInterfaceMockAddLifecycle sync.RWMutex + lockCisBenchmarkVersionInterfaceMockController sync.RWMutex + lockCisBenchmarkVersionInterfaceMockCreate sync.RWMutex + lockCisBenchmarkVersionInterfaceMockDelete sync.RWMutex + lockCisBenchmarkVersionInterfaceMockDeleteCollection sync.RWMutex + lockCisBenchmarkVersionInterfaceMockDeleteNamespaced sync.RWMutex + lockCisBenchmarkVersionInterfaceMockGet sync.RWMutex + lockCisBenchmarkVersionInterfaceMockGetNamespaced sync.RWMutex + lockCisBenchmarkVersionInterfaceMockList sync.RWMutex + lockCisBenchmarkVersionInterfaceMockListNamespaced sync.RWMutex + lockCisBenchmarkVersionInterfaceMockObjectClient sync.RWMutex + lockCisBenchmarkVersionInterfaceMockUpdate sync.RWMutex + lockCisBenchmarkVersionInterfaceMockWatch sync.RWMutex +) + +// Ensure, that CisBenchmarkVersionInterfaceMock does implement CisBenchmarkVersionInterface. +// If this is not the case, regenerate this file with moq. +var _ v3.CisBenchmarkVersionInterface = &CisBenchmarkVersionInterfaceMock{} + +// CisBenchmarkVersionInterfaceMock is a mock implementation of CisBenchmarkVersionInterface. +// +// func TestSomethingThatUsesCisBenchmarkVersionInterface(t *testing.T) { +// +// // make and configure a mocked CisBenchmarkVersionInterface +// mockedCisBenchmarkVersionInterface := &CisBenchmarkVersionInterfaceMock{ +// AddClusterScopedFeatureHandlerFunc: func(ctx context.Context, enabled func() bool, name string, clusterName string, sync v3.CisBenchmarkVersionHandlerFunc) { +// panic("mock out the AddClusterScopedFeatureHandler method") +// }, +// AddClusterScopedFeatureLifecycleFunc: func(ctx context.Context, enabled func() bool, name string, clusterName string, lifecycle v3.CisBenchmarkVersionLifecycle) { +// panic("mock out the AddClusterScopedFeatureLifecycle method") +// }, +// AddClusterScopedHandlerFunc: func(ctx context.Context, name string, clusterName string, sync v3.CisBenchmarkVersionHandlerFunc) { +// panic("mock out the AddClusterScopedHandler method") +// }, +// AddClusterScopedLifecycleFunc: func(ctx context.Context, name string, clusterName string, lifecycle v3.CisBenchmarkVersionLifecycle) { +// panic("mock out the AddClusterScopedLifecycle method") +// }, +// AddFeatureHandlerFunc: func(ctx context.Context, enabled func() bool, name string, sync v3.CisBenchmarkVersionHandlerFunc) { +// panic("mock out the AddFeatureHandler method") +// }, +// AddFeatureLifecycleFunc: func(ctx context.Context, enabled func() bool, name string, lifecycle v3.CisBenchmarkVersionLifecycle) { +// panic("mock out the AddFeatureLifecycle method") +// }, +// AddHandlerFunc: func(ctx context.Context, name string, sync v3.CisBenchmarkVersionHandlerFunc) { +// panic("mock out the AddHandler method") +// }, +// AddLifecycleFunc: func(ctx context.Context, name string, lifecycle v3.CisBenchmarkVersionLifecycle) { +// panic("mock out the AddLifecycle method") +// }, +// ControllerFunc: func() v3.CisBenchmarkVersionController { +// panic("mock out the Controller method") +// }, +// CreateFunc: func(in1 *v3.CisBenchmarkVersion) (*v3.CisBenchmarkVersion, error) { +// panic("mock out the Create method") +// }, +// DeleteFunc: func(name string, options *v1.DeleteOptions) error { +// panic("mock out the Delete method") +// }, +// DeleteCollectionFunc: func(deleteOpts *v1.DeleteOptions, listOpts v1.ListOptions) error { +// panic("mock out the DeleteCollection method") +// }, +// DeleteNamespacedFunc: func(namespace string, name string, options *v1.DeleteOptions) error { +// panic("mock out the DeleteNamespaced method") +// }, +// GetFunc: func(name string, opts v1.GetOptions) (*v3.CisBenchmarkVersion, error) { +// panic("mock out the Get method") +// }, +// GetNamespacedFunc: func(namespace string, name string, opts v1.GetOptions) (*v3.CisBenchmarkVersion, error) { +// panic("mock out the GetNamespaced method") +// }, +// ListFunc: func(opts v1.ListOptions) (*v3.CisBenchmarkVersionList, error) { +// panic("mock out the List method") +// }, +// ListNamespacedFunc: func(namespace string, opts v1.ListOptions) (*v3.CisBenchmarkVersionList, error) { +// panic("mock out the ListNamespaced method") +// }, +// ObjectClientFunc: func() *objectclient.ObjectClient { +// panic("mock out the ObjectClient method") +// }, +// UpdateFunc: func(in1 *v3.CisBenchmarkVersion) (*v3.CisBenchmarkVersion, error) { +// panic("mock out the Update method") +// }, +// WatchFunc: func(opts v1.ListOptions) (watch.Interface, error) { +// panic("mock out the Watch method") +// }, +// } +// +// // use mockedCisBenchmarkVersionInterface in code that requires CisBenchmarkVersionInterface +// // and then make assertions. +// +// } +type CisBenchmarkVersionInterfaceMock struct { + // AddClusterScopedFeatureHandlerFunc mocks the AddClusterScopedFeatureHandler method. + AddClusterScopedFeatureHandlerFunc func(ctx context.Context, enabled func() bool, name string, clusterName string, sync v3.CisBenchmarkVersionHandlerFunc) + + // AddClusterScopedFeatureLifecycleFunc mocks the AddClusterScopedFeatureLifecycle method. + AddClusterScopedFeatureLifecycleFunc func(ctx context.Context, enabled func() bool, name string, clusterName string, lifecycle v3.CisBenchmarkVersionLifecycle) + + // AddClusterScopedHandlerFunc mocks the AddClusterScopedHandler method. + AddClusterScopedHandlerFunc func(ctx context.Context, name string, clusterName string, sync v3.CisBenchmarkVersionHandlerFunc) + + // AddClusterScopedLifecycleFunc mocks the AddClusterScopedLifecycle method. + AddClusterScopedLifecycleFunc func(ctx context.Context, name string, clusterName string, lifecycle v3.CisBenchmarkVersionLifecycle) + + // AddFeatureHandlerFunc mocks the AddFeatureHandler method. + AddFeatureHandlerFunc func(ctx context.Context, enabled func() bool, name string, sync v3.CisBenchmarkVersionHandlerFunc) + + // AddFeatureLifecycleFunc mocks the AddFeatureLifecycle method. + AddFeatureLifecycleFunc func(ctx context.Context, enabled func() bool, name string, lifecycle v3.CisBenchmarkVersionLifecycle) + + // AddHandlerFunc mocks the AddHandler method. + AddHandlerFunc func(ctx context.Context, name string, sync v3.CisBenchmarkVersionHandlerFunc) + + // AddLifecycleFunc mocks the AddLifecycle method. + AddLifecycleFunc func(ctx context.Context, name string, lifecycle v3.CisBenchmarkVersionLifecycle) + + // ControllerFunc mocks the Controller method. + ControllerFunc func() v3.CisBenchmarkVersionController + + // CreateFunc mocks the Create method. + CreateFunc func(in1 *v3.CisBenchmarkVersion) (*v3.CisBenchmarkVersion, error) + + // DeleteFunc mocks the Delete method. + DeleteFunc func(name string, options *v1.DeleteOptions) error + + // DeleteCollectionFunc mocks the DeleteCollection method. + DeleteCollectionFunc func(deleteOpts *v1.DeleteOptions, listOpts v1.ListOptions) error + + // DeleteNamespacedFunc mocks the DeleteNamespaced method. + DeleteNamespacedFunc func(namespace string, name string, options *v1.DeleteOptions) error + + // GetFunc mocks the Get method. + GetFunc func(name string, opts v1.GetOptions) (*v3.CisBenchmarkVersion, error) + + // GetNamespacedFunc mocks the GetNamespaced method. + GetNamespacedFunc func(namespace string, name string, opts v1.GetOptions) (*v3.CisBenchmarkVersion, error) + + // ListFunc mocks the List method. + ListFunc func(opts v1.ListOptions) (*v3.CisBenchmarkVersionList, error) + + // ListNamespacedFunc mocks the ListNamespaced method. + ListNamespacedFunc func(namespace string, opts v1.ListOptions) (*v3.CisBenchmarkVersionList, error) + + // ObjectClientFunc mocks the ObjectClient method. + ObjectClientFunc func() *objectclient.ObjectClient + + // UpdateFunc mocks the Update method. + UpdateFunc func(in1 *v3.CisBenchmarkVersion) (*v3.CisBenchmarkVersion, error) + + // WatchFunc mocks the Watch method. + WatchFunc func(opts v1.ListOptions) (watch.Interface, error) + + // 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 v3.CisBenchmarkVersionHandlerFunc + } + // 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 v3.CisBenchmarkVersionLifecycle + } + // AddClusterScopedHandler holds details about calls to the AddClusterScopedHandler method. + AddClusterScopedHandler []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Name is the name argument value. + Name string + // ClusterName is the clusterName argument value. + ClusterName string + // Sync is the sync argument value. + Sync v3.CisBenchmarkVersionHandlerFunc + } + // AddClusterScopedLifecycle holds details about calls to the AddClusterScopedLifecycle method. + AddClusterScopedLifecycle []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Name is the name argument value. + Name string + // ClusterName is the clusterName argument value. + ClusterName string + // Lifecycle is the lifecycle argument value. + Lifecycle v3.CisBenchmarkVersionLifecycle + } + // 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 v3.CisBenchmarkVersionHandlerFunc + } + // 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 v3.CisBenchmarkVersionLifecycle + } + // AddHandler holds details about calls to the AddHandler method. + AddHandler []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Name is the name argument value. + Name string + // Sync is the sync argument value. + Sync v3.CisBenchmarkVersionHandlerFunc + } + // AddLifecycle holds details about calls to the AddLifecycle method. + AddLifecycle []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Name is the name argument value. + Name string + // Lifecycle is the lifecycle argument value. + Lifecycle v3.CisBenchmarkVersionLifecycle + } + // Controller holds details about calls to the Controller method. + Controller []struct { + } + // Create holds details about calls to the Create method. + Create []struct { + // In1 is the in1 argument value. + In1 *v3.CisBenchmarkVersion + } + // Delete holds details about calls to the Delete method. + Delete []struct { + // Name is the name argument value. + Name string + // Options is the options argument value. + Options *v1.DeleteOptions + } + // DeleteCollection holds details about calls to the DeleteCollection method. + DeleteCollection []struct { + // DeleteOpts is the deleteOpts argument value. + DeleteOpts *v1.DeleteOptions + // ListOpts is the listOpts argument value. + ListOpts v1.ListOptions + } + // DeleteNamespaced holds details about calls to the DeleteNamespaced method. + DeleteNamespaced []struct { + // Namespace is the namespace argument value. + Namespace string + // Name is the name argument value. + Name string + // Options is the options argument value. + Options *v1.DeleteOptions + } + // Get holds details about calls to the Get method. + Get []struct { + // Name is the name argument value. + Name string + // Opts is the opts argument value. + Opts v1.GetOptions + } + // GetNamespaced holds details about calls to the GetNamespaced method. + GetNamespaced []struct { + // Namespace is the namespace argument value. + Namespace string + // Name is the name argument value. + Name string + // Opts is the opts argument value. + Opts v1.GetOptions + } + // List holds details about calls to the List method. + List []struct { + // Opts is the opts argument value. + Opts v1.ListOptions + } + // ListNamespaced holds details about calls to the ListNamespaced method. + ListNamespaced []struct { + // Namespace is the namespace argument value. + Namespace string + // Opts is the opts argument value. + Opts v1.ListOptions + } + // ObjectClient holds details about calls to the ObjectClient method. + ObjectClient []struct { + } + // Update holds details about calls to the Update method. + Update []struct { + // In1 is the in1 argument value. + In1 *v3.CisBenchmarkVersion + } + // Watch holds details about calls to the Watch method. + Watch []struct { + // Opts is the opts argument value. + Opts v1.ListOptions + } + } +} + +// AddClusterScopedFeatureHandler calls AddClusterScopedFeatureHandlerFunc. +func (mock *CisBenchmarkVersionInterfaceMock) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name string, clusterName string, sync v3.CisBenchmarkVersionHandlerFunc) { + if mock.AddClusterScopedFeatureHandlerFunc == nil { + panic("CisBenchmarkVersionInterfaceMock.AddClusterScopedFeatureHandlerFunc: method is nil but CisBenchmarkVersionInterface.AddClusterScopedFeatureHandler was just called") + } + callInfo := struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Sync v3.CisBenchmarkVersionHandlerFunc + }{ + Ctx: ctx, + Enabled: enabled, + Name: name, + ClusterName: clusterName, + Sync: sync, + } + lockCisBenchmarkVersionInterfaceMockAddClusterScopedFeatureHandler.Lock() + mock.calls.AddClusterScopedFeatureHandler = append(mock.calls.AddClusterScopedFeatureHandler, callInfo) + lockCisBenchmarkVersionInterfaceMockAddClusterScopedFeatureHandler.Unlock() + mock.AddClusterScopedFeatureHandlerFunc(ctx, enabled, name, clusterName, sync) +} + +// AddClusterScopedFeatureHandlerCalls gets all the calls that were made to AddClusterScopedFeatureHandler. +// Check the length with: +// len(mockedCisBenchmarkVersionInterface.AddClusterScopedFeatureHandlerCalls()) +func (mock *CisBenchmarkVersionInterfaceMock) AddClusterScopedFeatureHandlerCalls() []struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Sync v3.CisBenchmarkVersionHandlerFunc +} { + var calls []struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Sync v3.CisBenchmarkVersionHandlerFunc + } + lockCisBenchmarkVersionInterfaceMockAddClusterScopedFeatureHandler.RLock() + calls = mock.calls.AddClusterScopedFeatureHandler + lockCisBenchmarkVersionInterfaceMockAddClusterScopedFeatureHandler.RUnlock() + return calls +} + +// AddClusterScopedFeatureLifecycle calls AddClusterScopedFeatureLifecycleFunc. +func (mock *CisBenchmarkVersionInterfaceMock) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name string, clusterName string, lifecycle v3.CisBenchmarkVersionLifecycle) { + if mock.AddClusterScopedFeatureLifecycleFunc == nil { + panic("CisBenchmarkVersionInterfaceMock.AddClusterScopedFeatureLifecycleFunc: method is nil but CisBenchmarkVersionInterface.AddClusterScopedFeatureLifecycle was just called") + } + callInfo := struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Lifecycle v3.CisBenchmarkVersionLifecycle + }{ + Ctx: ctx, + Enabled: enabled, + Name: name, + ClusterName: clusterName, + Lifecycle: lifecycle, + } + lockCisBenchmarkVersionInterfaceMockAddClusterScopedFeatureLifecycle.Lock() + mock.calls.AddClusterScopedFeatureLifecycle = append(mock.calls.AddClusterScopedFeatureLifecycle, callInfo) + lockCisBenchmarkVersionInterfaceMockAddClusterScopedFeatureLifecycle.Unlock() + mock.AddClusterScopedFeatureLifecycleFunc(ctx, enabled, name, clusterName, lifecycle) +} + +// AddClusterScopedFeatureLifecycleCalls gets all the calls that were made to AddClusterScopedFeatureLifecycle. +// Check the length with: +// len(mockedCisBenchmarkVersionInterface.AddClusterScopedFeatureLifecycleCalls()) +func (mock *CisBenchmarkVersionInterfaceMock) AddClusterScopedFeatureLifecycleCalls() []struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Lifecycle v3.CisBenchmarkVersionLifecycle +} { + var calls []struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Lifecycle v3.CisBenchmarkVersionLifecycle + } + lockCisBenchmarkVersionInterfaceMockAddClusterScopedFeatureLifecycle.RLock() + calls = mock.calls.AddClusterScopedFeatureLifecycle + lockCisBenchmarkVersionInterfaceMockAddClusterScopedFeatureLifecycle.RUnlock() + return calls +} + +// AddClusterScopedHandler calls AddClusterScopedHandlerFunc. +func (mock *CisBenchmarkVersionInterfaceMock) AddClusterScopedHandler(ctx context.Context, name string, clusterName string, sync v3.CisBenchmarkVersionHandlerFunc) { + if mock.AddClusterScopedHandlerFunc == nil { + panic("CisBenchmarkVersionInterfaceMock.AddClusterScopedHandlerFunc: method is nil but CisBenchmarkVersionInterface.AddClusterScopedHandler was just called") + } + callInfo := struct { + Ctx context.Context + Name string + ClusterName string + Sync v3.CisBenchmarkVersionHandlerFunc + }{ + Ctx: ctx, + Name: name, + ClusterName: clusterName, + Sync: sync, + } + lockCisBenchmarkVersionInterfaceMockAddClusterScopedHandler.Lock() + mock.calls.AddClusterScopedHandler = append(mock.calls.AddClusterScopedHandler, callInfo) + lockCisBenchmarkVersionInterfaceMockAddClusterScopedHandler.Unlock() + mock.AddClusterScopedHandlerFunc(ctx, name, clusterName, sync) +} + +// AddClusterScopedHandlerCalls gets all the calls that were made to AddClusterScopedHandler. +// Check the length with: +// len(mockedCisBenchmarkVersionInterface.AddClusterScopedHandlerCalls()) +func (mock *CisBenchmarkVersionInterfaceMock) AddClusterScopedHandlerCalls() []struct { + Ctx context.Context + Name string + ClusterName string + Sync v3.CisBenchmarkVersionHandlerFunc +} { + var calls []struct { + Ctx context.Context + Name string + ClusterName string + Sync v3.CisBenchmarkVersionHandlerFunc + } + lockCisBenchmarkVersionInterfaceMockAddClusterScopedHandler.RLock() + calls = mock.calls.AddClusterScopedHandler + lockCisBenchmarkVersionInterfaceMockAddClusterScopedHandler.RUnlock() + return calls +} + +// AddClusterScopedLifecycle calls AddClusterScopedLifecycleFunc. +func (mock *CisBenchmarkVersionInterfaceMock) AddClusterScopedLifecycle(ctx context.Context, name string, clusterName string, lifecycle v3.CisBenchmarkVersionLifecycle) { + if mock.AddClusterScopedLifecycleFunc == nil { + panic("CisBenchmarkVersionInterfaceMock.AddClusterScopedLifecycleFunc: method is nil but CisBenchmarkVersionInterface.AddClusterScopedLifecycle was just called") + } + callInfo := struct { + Ctx context.Context + Name string + ClusterName string + Lifecycle v3.CisBenchmarkVersionLifecycle + }{ + Ctx: ctx, + Name: name, + ClusterName: clusterName, + Lifecycle: lifecycle, + } + lockCisBenchmarkVersionInterfaceMockAddClusterScopedLifecycle.Lock() + mock.calls.AddClusterScopedLifecycle = append(mock.calls.AddClusterScopedLifecycle, callInfo) + lockCisBenchmarkVersionInterfaceMockAddClusterScopedLifecycle.Unlock() + mock.AddClusterScopedLifecycleFunc(ctx, name, clusterName, lifecycle) +} + +// AddClusterScopedLifecycleCalls gets all the calls that were made to AddClusterScopedLifecycle. +// Check the length with: +// len(mockedCisBenchmarkVersionInterface.AddClusterScopedLifecycleCalls()) +func (mock *CisBenchmarkVersionInterfaceMock) AddClusterScopedLifecycleCalls() []struct { + Ctx context.Context + Name string + ClusterName string + Lifecycle v3.CisBenchmarkVersionLifecycle +} { + var calls []struct { + Ctx context.Context + Name string + ClusterName string + Lifecycle v3.CisBenchmarkVersionLifecycle + } + lockCisBenchmarkVersionInterfaceMockAddClusterScopedLifecycle.RLock() + calls = mock.calls.AddClusterScopedLifecycle + lockCisBenchmarkVersionInterfaceMockAddClusterScopedLifecycle.RUnlock() + return calls +} + +// AddFeatureHandler calls AddFeatureHandlerFunc. +func (mock *CisBenchmarkVersionInterfaceMock) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync v3.CisBenchmarkVersionHandlerFunc) { + if mock.AddFeatureHandlerFunc == nil { + panic("CisBenchmarkVersionInterfaceMock.AddFeatureHandlerFunc: method is nil but CisBenchmarkVersionInterface.AddFeatureHandler was just called") + } + callInfo := struct { + Ctx context.Context + Enabled func() bool + Name string + Sync v3.CisBenchmarkVersionHandlerFunc + }{ + Ctx: ctx, + Enabled: enabled, + Name: name, + Sync: sync, + } + lockCisBenchmarkVersionInterfaceMockAddFeatureHandler.Lock() + mock.calls.AddFeatureHandler = append(mock.calls.AddFeatureHandler, callInfo) + lockCisBenchmarkVersionInterfaceMockAddFeatureHandler.Unlock() + mock.AddFeatureHandlerFunc(ctx, enabled, name, sync) +} + +// AddFeatureHandlerCalls gets all the calls that were made to AddFeatureHandler. +// Check the length with: +// len(mockedCisBenchmarkVersionInterface.AddFeatureHandlerCalls()) +func (mock *CisBenchmarkVersionInterfaceMock) AddFeatureHandlerCalls() []struct { + Ctx context.Context + Enabled func() bool + Name string + Sync v3.CisBenchmarkVersionHandlerFunc +} { + var calls []struct { + Ctx context.Context + Enabled func() bool + Name string + Sync v3.CisBenchmarkVersionHandlerFunc + } + lockCisBenchmarkVersionInterfaceMockAddFeatureHandler.RLock() + calls = mock.calls.AddFeatureHandler + lockCisBenchmarkVersionInterfaceMockAddFeatureHandler.RUnlock() + return calls +} + +// AddFeatureLifecycle calls AddFeatureLifecycleFunc. +func (mock *CisBenchmarkVersionInterfaceMock) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle v3.CisBenchmarkVersionLifecycle) { + if mock.AddFeatureLifecycleFunc == nil { + panic("CisBenchmarkVersionInterfaceMock.AddFeatureLifecycleFunc: method is nil but CisBenchmarkVersionInterface.AddFeatureLifecycle was just called") + } + callInfo := struct { + Ctx context.Context + Enabled func() bool + Name string + Lifecycle v3.CisBenchmarkVersionLifecycle + }{ + Ctx: ctx, + Enabled: enabled, + Name: name, + Lifecycle: lifecycle, + } + lockCisBenchmarkVersionInterfaceMockAddFeatureLifecycle.Lock() + mock.calls.AddFeatureLifecycle = append(mock.calls.AddFeatureLifecycle, callInfo) + lockCisBenchmarkVersionInterfaceMockAddFeatureLifecycle.Unlock() + mock.AddFeatureLifecycleFunc(ctx, enabled, name, lifecycle) +} + +// AddFeatureLifecycleCalls gets all the calls that were made to AddFeatureLifecycle. +// Check the length with: +// len(mockedCisBenchmarkVersionInterface.AddFeatureLifecycleCalls()) +func (mock *CisBenchmarkVersionInterfaceMock) AddFeatureLifecycleCalls() []struct { + Ctx context.Context + Enabled func() bool + Name string + Lifecycle v3.CisBenchmarkVersionLifecycle +} { + var calls []struct { + Ctx context.Context + Enabled func() bool + Name string + Lifecycle v3.CisBenchmarkVersionLifecycle + } + lockCisBenchmarkVersionInterfaceMockAddFeatureLifecycle.RLock() + calls = mock.calls.AddFeatureLifecycle + lockCisBenchmarkVersionInterfaceMockAddFeatureLifecycle.RUnlock() + return calls +} + +// AddHandler calls AddHandlerFunc. +func (mock *CisBenchmarkVersionInterfaceMock) AddHandler(ctx context.Context, name string, sync v3.CisBenchmarkVersionHandlerFunc) { + if mock.AddHandlerFunc == nil { + panic("CisBenchmarkVersionInterfaceMock.AddHandlerFunc: method is nil but CisBenchmarkVersionInterface.AddHandler was just called") + } + callInfo := struct { + Ctx context.Context + Name string + Sync v3.CisBenchmarkVersionHandlerFunc + }{ + Ctx: ctx, + Name: name, + Sync: sync, + } + lockCisBenchmarkVersionInterfaceMockAddHandler.Lock() + mock.calls.AddHandler = append(mock.calls.AddHandler, callInfo) + lockCisBenchmarkVersionInterfaceMockAddHandler.Unlock() + mock.AddHandlerFunc(ctx, name, sync) +} + +// AddHandlerCalls gets all the calls that were made to AddHandler. +// Check the length with: +// len(mockedCisBenchmarkVersionInterface.AddHandlerCalls()) +func (mock *CisBenchmarkVersionInterfaceMock) AddHandlerCalls() []struct { + Ctx context.Context + Name string + Sync v3.CisBenchmarkVersionHandlerFunc +} { + var calls []struct { + Ctx context.Context + Name string + Sync v3.CisBenchmarkVersionHandlerFunc + } + lockCisBenchmarkVersionInterfaceMockAddHandler.RLock() + calls = mock.calls.AddHandler + lockCisBenchmarkVersionInterfaceMockAddHandler.RUnlock() + return calls +} + +// AddLifecycle calls AddLifecycleFunc. +func (mock *CisBenchmarkVersionInterfaceMock) AddLifecycle(ctx context.Context, name string, lifecycle v3.CisBenchmarkVersionLifecycle) { + if mock.AddLifecycleFunc == nil { + panic("CisBenchmarkVersionInterfaceMock.AddLifecycleFunc: method is nil but CisBenchmarkVersionInterface.AddLifecycle was just called") + } + callInfo := struct { + Ctx context.Context + Name string + Lifecycle v3.CisBenchmarkVersionLifecycle + }{ + Ctx: ctx, + Name: name, + Lifecycle: lifecycle, + } + lockCisBenchmarkVersionInterfaceMockAddLifecycle.Lock() + mock.calls.AddLifecycle = append(mock.calls.AddLifecycle, callInfo) + lockCisBenchmarkVersionInterfaceMockAddLifecycle.Unlock() + mock.AddLifecycleFunc(ctx, name, lifecycle) +} + +// AddLifecycleCalls gets all the calls that were made to AddLifecycle. +// Check the length with: +// len(mockedCisBenchmarkVersionInterface.AddLifecycleCalls()) +func (mock *CisBenchmarkVersionInterfaceMock) AddLifecycleCalls() []struct { + Ctx context.Context + Name string + Lifecycle v3.CisBenchmarkVersionLifecycle +} { + var calls []struct { + Ctx context.Context + Name string + Lifecycle v3.CisBenchmarkVersionLifecycle + } + lockCisBenchmarkVersionInterfaceMockAddLifecycle.RLock() + calls = mock.calls.AddLifecycle + lockCisBenchmarkVersionInterfaceMockAddLifecycle.RUnlock() + return calls +} + +// Controller calls ControllerFunc. +func (mock *CisBenchmarkVersionInterfaceMock) Controller() v3.CisBenchmarkVersionController { + if mock.ControllerFunc == nil { + panic("CisBenchmarkVersionInterfaceMock.ControllerFunc: method is nil but CisBenchmarkVersionInterface.Controller was just called") + } + callInfo := struct { + }{} + lockCisBenchmarkVersionInterfaceMockController.Lock() + mock.calls.Controller = append(mock.calls.Controller, callInfo) + lockCisBenchmarkVersionInterfaceMockController.Unlock() + return mock.ControllerFunc() +} + +// ControllerCalls gets all the calls that were made to Controller. +// Check the length with: +// len(mockedCisBenchmarkVersionInterface.ControllerCalls()) +func (mock *CisBenchmarkVersionInterfaceMock) ControllerCalls() []struct { +} { + var calls []struct { + } + lockCisBenchmarkVersionInterfaceMockController.RLock() + calls = mock.calls.Controller + lockCisBenchmarkVersionInterfaceMockController.RUnlock() + return calls +} + +// Create calls CreateFunc. +func (mock *CisBenchmarkVersionInterfaceMock) Create(in1 *v3.CisBenchmarkVersion) (*v3.CisBenchmarkVersion, error) { + if mock.CreateFunc == nil { + panic("CisBenchmarkVersionInterfaceMock.CreateFunc: method is nil but CisBenchmarkVersionInterface.Create was just called") + } + callInfo := struct { + In1 *v3.CisBenchmarkVersion + }{ + In1: in1, + } + lockCisBenchmarkVersionInterfaceMockCreate.Lock() + mock.calls.Create = append(mock.calls.Create, callInfo) + lockCisBenchmarkVersionInterfaceMockCreate.Unlock() + return mock.CreateFunc(in1) +} + +// CreateCalls gets all the calls that were made to Create. +// Check the length with: +// len(mockedCisBenchmarkVersionInterface.CreateCalls()) +func (mock *CisBenchmarkVersionInterfaceMock) CreateCalls() []struct { + In1 *v3.CisBenchmarkVersion +} { + var calls []struct { + In1 *v3.CisBenchmarkVersion + } + lockCisBenchmarkVersionInterfaceMockCreate.RLock() + calls = mock.calls.Create + lockCisBenchmarkVersionInterfaceMockCreate.RUnlock() + return calls +} + +// Delete calls DeleteFunc. +func (mock *CisBenchmarkVersionInterfaceMock) Delete(name string, options *v1.DeleteOptions) error { + if mock.DeleteFunc == nil { + panic("CisBenchmarkVersionInterfaceMock.DeleteFunc: method is nil but CisBenchmarkVersionInterface.Delete was just called") + } + callInfo := struct { + Name string + Options *v1.DeleteOptions + }{ + Name: name, + Options: options, + } + lockCisBenchmarkVersionInterfaceMockDelete.Lock() + mock.calls.Delete = append(mock.calls.Delete, callInfo) + lockCisBenchmarkVersionInterfaceMockDelete.Unlock() + return mock.DeleteFunc(name, options) +} + +// DeleteCalls gets all the calls that were made to Delete. +// Check the length with: +// len(mockedCisBenchmarkVersionInterface.DeleteCalls()) +func (mock *CisBenchmarkVersionInterfaceMock) DeleteCalls() []struct { + Name string + Options *v1.DeleteOptions +} { + var calls []struct { + Name string + Options *v1.DeleteOptions + } + lockCisBenchmarkVersionInterfaceMockDelete.RLock() + calls = mock.calls.Delete + lockCisBenchmarkVersionInterfaceMockDelete.RUnlock() + return calls +} + +// DeleteCollection calls DeleteCollectionFunc. +func (mock *CisBenchmarkVersionInterfaceMock) DeleteCollection(deleteOpts *v1.DeleteOptions, listOpts v1.ListOptions) error { + if mock.DeleteCollectionFunc == nil { + panic("CisBenchmarkVersionInterfaceMock.DeleteCollectionFunc: method is nil but CisBenchmarkVersionInterface.DeleteCollection was just called") + } + callInfo := struct { + DeleteOpts *v1.DeleteOptions + ListOpts v1.ListOptions + }{ + DeleteOpts: deleteOpts, + ListOpts: listOpts, + } + lockCisBenchmarkVersionInterfaceMockDeleteCollection.Lock() + mock.calls.DeleteCollection = append(mock.calls.DeleteCollection, callInfo) + lockCisBenchmarkVersionInterfaceMockDeleteCollection.Unlock() + return mock.DeleteCollectionFunc(deleteOpts, listOpts) +} + +// DeleteCollectionCalls gets all the calls that were made to DeleteCollection. +// Check the length with: +// len(mockedCisBenchmarkVersionInterface.DeleteCollectionCalls()) +func (mock *CisBenchmarkVersionInterfaceMock) DeleteCollectionCalls() []struct { + DeleteOpts *v1.DeleteOptions + ListOpts v1.ListOptions +} { + var calls []struct { + DeleteOpts *v1.DeleteOptions + ListOpts v1.ListOptions + } + lockCisBenchmarkVersionInterfaceMockDeleteCollection.RLock() + calls = mock.calls.DeleteCollection + lockCisBenchmarkVersionInterfaceMockDeleteCollection.RUnlock() + return calls +} + +// DeleteNamespaced calls DeleteNamespacedFunc. +func (mock *CisBenchmarkVersionInterfaceMock) DeleteNamespaced(namespace string, name string, options *v1.DeleteOptions) error { + if mock.DeleteNamespacedFunc == nil { + panic("CisBenchmarkVersionInterfaceMock.DeleteNamespacedFunc: method is nil but CisBenchmarkVersionInterface.DeleteNamespaced was just called") + } + callInfo := struct { + Namespace string + Name string + Options *v1.DeleteOptions + }{ + Namespace: namespace, + Name: name, + Options: options, + } + lockCisBenchmarkVersionInterfaceMockDeleteNamespaced.Lock() + mock.calls.DeleteNamespaced = append(mock.calls.DeleteNamespaced, callInfo) + lockCisBenchmarkVersionInterfaceMockDeleteNamespaced.Unlock() + return mock.DeleteNamespacedFunc(namespace, name, options) +} + +// DeleteNamespacedCalls gets all the calls that were made to DeleteNamespaced. +// Check the length with: +// len(mockedCisBenchmarkVersionInterface.DeleteNamespacedCalls()) +func (mock *CisBenchmarkVersionInterfaceMock) DeleteNamespacedCalls() []struct { + Namespace string + Name string + Options *v1.DeleteOptions +} { + var calls []struct { + Namespace string + Name string + Options *v1.DeleteOptions + } + lockCisBenchmarkVersionInterfaceMockDeleteNamespaced.RLock() + calls = mock.calls.DeleteNamespaced + lockCisBenchmarkVersionInterfaceMockDeleteNamespaced.RUnlock() + return calls +} + +// Get calls GetFunc. +func (mock *CisBenchmarkVersionInterfaceMock) Get(name string, opts v1.GetOptions) (*v3.CisBenchmarkVersion, error) { + if mock.GetFunc == nil { + panic("CisBenchmarkVersionInterfaceMock.GetFunc: method is nil but CisBenchmarkVersionInterface.Get was just called") + } + callInfo := struct { + Name string + Opts v1.GetOptions + }{ + Name: name, + Opts: opts, + } + lockCisBenchmarkVersionInterfaceMockGet.Lock() + mock.calls.Get = append(mock.calls.Get, callInfo) + lockCisBenchmarkVersionInterfaceMockGet.Unlock() + return mock.GetFunc(name, opts) +} + +// GetCalls gets all the calls that were made to Get. +// Check the length with: +// len(mockedCisBenchmarkVersionInterface.GetCalls()) +func (mock *CisBenchmarkVersionInterfaceMock) GetCalls() []struct { + Name string + Opts v1.GetOptions +} { + var calls []struct { + Name string + Opts v1.GetOptions + } + lockCisBenchmarkVersionInterfaceMockGet.RLock() + calls = mock.calls.Get + lockCisBenchmarkVersionInterfaceMockGet.RUnlock() + return calls +} + +// GetNamespaced calls GetNamespacedFunc. +func (mock *CisBenchmarkVersionInterfaceMock) GetNamespaced(namespace string, name string, opts v1.GetOptions) (*v3.CisBenchmarkVersion, error) { + if mock.GetNamespacedFunc == nil { + panic("CisBenchmarkVersionInterfaceMock.GetNamespacedFunc: method is nil but CisBenchmarkVersionInterface.GetNamespaced was just called") + } + callInfo := struct { + Namespace string + Name string + Opts v1.GetOptions + }{ + Namespace: namespace, + Name: name, + Opts: opts, + } + lockCisBenchmarkVersionInterfaceMockGetNamespaced.Lock() + mock.calls.GetNamespaced = append(mock.calls.GetNamespaced, callInfo) + lockCisBenchmarkVersionInterfaceMockGetNamespaced.Unlock() + return mock.GetNamespacedFunc(namespace, name, opts) +} + +// GetNamespacedCalls gets all the calls that were made to GetNamespaced. +// Check the length with: +// len(mockedCisBenchmarkVersionInterface.GetNamespacedCalls()) +func (mock *CisBenchmarkVersionInterfaceMock) GetNamespacedCalls() []struct { + Namespace string + Name string + Opts v1.GetOptions +} { + var calls []struct { + Namespace string + Name string + Opts v1.GetOptions + } + lockCisBenchmarkVersionInterfaceMockGetNamespaced.RLock() + calls = mock.calls.GetNamespaced + lockCisBenchmarkVersionInterfaceMockGetNamespaced.RUnlock() + return calls +} + +// List calls ListFunc. +func (mock *CisBenchmarkVersionInterfaceMock) List(opts v1.ListOptions) (*v3.CisBenchmarkVersionList, error) { + if mock.ListFunc == nil { + panic("CisBenchmarkVersionInterfaceMock.ListFunc: method is nil but CisBenchmarkVersionInterface.List was just called") + } + callInfo := struct { + Opts v1.ListOptions + }{ + Opts: opts, + } + lockCisBenchmarkVersionInterfaceMockList.Lock() + mock.calls.List = append(mock.calls.List, callInfo) + lockCisBenchmarkVersionInterfaceMockList.Unlock() + return mock.ListFunc(opts) +} + +// ListCalls gets all the calls that were made to List. +// Check the length with: +// len(mockedCisBenchmarkVersionInterface.ListCalls()) +func (mock *CisBenchmarkVersionInterfaceMock) ListCalls() []struct { + Opts v1.ListOptions +} { + var calls []struct { + Opts v1.ListOptions + } + lockCisBenchmarkVersionInterfaceMockList.RLock() + calls = mock.calls.List + lockCisBenchmarkVersionInterfaceMockList.RUnlock() + return calls +} + +// ListNamespaced calls ListNamespacedFunc. +func (mock *CisBenchmarkVersionInterfaceMock) ListNamespaced(namespace string, opts v1.ListOptions) (*v3.CisBenchmarkVersionList, error) { + if mock.ListNamespacedFunc == nil { + panic("CisBenchmarkVersionInterfaceMock.ListNamespacedFunc: method is nil but CisBenchmarkVersionInterface.ListNamespaced was just called") + } + callInfo := struct { + Namespace string + Opts v1.ListOptions + }{ + Namespace: namespace, + Opts: opts, + } + lockCisBenchmarkVersionInterfaceMockListNamespaced.Lock() + mock.calls.ListNamespaced = append(mock.calls.ListNamespaced, callInfo) + lockCisBenchmarkVersionInterfaceMockListNamespaced.Unlock() + return mock.ListNamespacedFunc(namespace, opts) +} + +// ListNamespacedCalls gets all the calls that were made to ListNamespaced. +// Check the length with: +// len(mockedCisBenchmarkVersionInterface.ListNamespacedCalls()) +func (mock *CisBenchmarkVersionInterfaceMock) ListNamespacedCalls() []struct { + Namespace string + Opts v1.ListOptions +} { + var calls []struct { + Namespace string + Opts v1.ListOptions + } + lockCisBenchmarkVersionInterfaceMockListNamespaced.RLock() + calls = mock.calls.ListNamespaced + lockCisBenchmarkVersionInterfaceMockListNamespaced.RUnlock() + return calls +} + +// ObjectClient calls ObjectClientFunc. +func (mock *CisBenchmarkVersionInterfaceMock) ObjectClient() *objectclient.ObjectClient { + if mock.ObjectClientFunc == nil { + panic("CisBenchmarkVersionInterfaceMock.ObjectClientFunc: method is nil but CisBenchmarkVersionInterface.ObjectClient was just called") + } + callInfo := struct { + }{} + lockCisBenchmarkVersionInterfaceMockObjectClient.Lock() + mock.calls.ObjectClient = append(mock.calls.ObjectClient, callInfo) + lockCisBenchmarkVersionInterfaceMockObjectClient.Unlock() + return mock.ObjectClientFunc() +} + +// ObjectClientCalls gets all the calls that were made to ObjectClient. +// Check the length with: +// len(mockedCisBenchmarkVersionInterface.ObjectClientCalls()) +func (mock *CisBenchmarkVersionInterfaceMock) ObjectClientCalls() []struct { +} { + var calls []struct { + } + lockCisBenchmarkVersionInterfaceMockObjectClient.RLock() + calls = mock.calls.ObjectClient + lockCisBenchmarkVersionInterfaceMockObjectClient.RUnlock() + return calls +} + +// Update calls UpdateFunc. +func (mock *CisBenchmarkVersionInterfaceMock) Update(in1 *v3.CisBenchmarkVersion) (*v3.CisBenchmarkVersion, error) { + if mock.UpdateFunc == nil { + panic("CisBenchmarkVersionInterfaceMock.UpdateFunc: method is nil but CisBenchmarkVersionInterface.Update was just called") + } + callInfo := struct { + In1 *v3.CisBenchmarkVersion + }{ + In1: in1, + } + lockCisBenchmarkVersionInterfaceMockUpdate.Lock() + mock.calls.Update = append(mock.calls.Update, callInfo) + lockCisBenchmarkVersionInterfaceMockUpdate.Unlock() + return mock.UpdateFunc(in1) +} + +// UpdateCalls gets all the calls that were made to Update. +// Check the length with: +// len(mockedCisBenchmarkVersionInterface.UpdateCalls()) +func (mock *CisBenchmarkVersionInterfaceMock) UpdateCalls() []struct { + In1 *v3.CisBenchmarkVersion +} { + var calls []struct { + In1 *v3.CisBenchmarkVersion + } + lockCisBenchmarkVersionInterfaceMockUpdate.RLock() + calls = mock.calls.Update + lockCisBenchmarkVersionInterfaceMockUpdate.RUnlock() + return calls +} + +// Watch calls WatchFunc. +func (mock *CisBenchmarkVersionInterfaceMock) Watch(opts v1.ListOptions) (watch.Interface, error) { + if mock.WatchFunc == nil { + panic("CisBenchmarkVersionInterfaceMock.WatchFunc: method is nil but CisBenchmarkVersionInterface.Watch was just called") + } + callInfo := struct { + Opts v1.ListOptions + }{ + Opts: opts, + } + lockCisBenchmarkVersionInterfaceMockWatch.Lock() + mock.calls.Watch = append(mock.calls.Watch, callInfo) + lockCisBenchmarkVersionInterfaceMockWatch.Unlock() + return mock.WatchFunc(opts) +} + +// WatchCalls gets all the calls that were made to Watch. +// Check the length with: +// len(mockedCisBenchmarkVersionInterface.WatchCalls()) +func (mock *CisBenchmarkVersionInterfaceMock) WatchCalls() []struct { + Opts v1.ListOptions +} { + var calls []struct { + Opts v1.ListOptions + } + lockCisBenchmarkVersionInterfaceMockWatch.RLock() + calls = mock.calls.Watch + lockCisBenchmarkVersionInterfaceMockWatch.RUnlock() + return calls +} + +var ( + lockCisBenchmarkVersionsGetterMockCisBenchmarkVersions sync.RWMutex +) + +// Ensure, that CisBenchmarkVersionsGetterMock does implement CisBenchmarkVersionsGetter. +// If this is not the case, regenerate this file with moq. +var _ v3.CisBenchmarkVersionsGetter = &CisBenchmarkVersionsGetterMock{} + +// CisBenchmarkVersionsGetterMock is a mock implementation of CisBenchmarkVersionsGetter. +// +// func TestSomethingThatUsesCisBenchmarkVersionsGetter(t *testing.T) { +// +// // make and configure a mocked CisBenchmarkVersionsGetter +// mockedCisBenchmarkVersionsGetter := &CisBenchmarkVersionsGetterMock{ +// CisBenchmarkVersionsFunc: func(namespace string) v3.CisBenchmarkVersionInterface { +// panic("mock out the CisBenchmarkVersions method") +// }, +// } +// +// // use mockedCisBenchmarkVersionsGetter in code that requires CisBenchmarkVersionsGetter +// // and then make assertions. +// +// } +type CisBenchmarkVersionsGetterMock struct { + // CisBenchmarkVersionsFunc mocks the CisBenchmarkVersions method. + CisBenchmarkVersionsFunc func(namespace string) v3.CisBenchmarkVersionInterface + + // calls tracks calls to the methods. + calls struct { + // CisBenchmarkVersions holds details about calls to the CisBenchmarkVersions method. + CisBenchmarkVersions []struct { + // Namespace is the namespace argument value. + Namespace string + } + } +} + +// CisBenchmarkVersions calls CisBenchmarkVersionsFunc. +func (mock *CisBenchmarkVersionsGetterMock) CisBenchmarkVersions(namespace string) v3.CisBenchmarkVersionInterface { + if mock.CisBenchmarkVersionsFunc == nil { + panic("CisBenchmarkVersionsGetterMock.CisBenchmarkVersionsFunc: method is nil but CisBenchmarkVersionsGetter.CisBenchmarkVersions was just called") + } + callInfo := struct { + Namespace string + }{ + Namespace: namespace, + } + lockCisBenchmarkVersionsGetterMockCisBenchmarkVersions.Lock() + mock.calls.CisBenchmarkVersions = append(mock.calls.CisBenchmarkVersions, callInfo) + lockCisBenchmarkVersionsGetterMockCisBenchmarkVersions.Unlock() + return mock.CisBenchmarkVersionsFunc(namespace) +} + +// CisBenchmarkVersionsCalls gets all the calls that were made to CisBenchmarkVersions. +// Check the length with: +// len(mockedCisBenchmarkVersionsGetter.CisBenchmarkVersionsCalls()) +func (mock *CisBenchmarkVersionsGetterMock) CisBenchmarkVersionsCalls() []struct { + Namespace string +} { + var calls []struct { + Namespace string + } + lockCisBenchmarkVersionsGetterMockCisBenchmarkVersions.RLock() + calls = mock.calls.CisBenchmarkVersions + lockCisBenchmarkVersionsGetterMockCisBenchmarkVersions.RUnlock() + return calls +} diff --git a/apis/management.cattle.io/v3/fakes/zz_generated_cis_config_mock.go b/apis/management.cattle.io/v3/fakes/zz_generated_cis_config_mock.go new file mode 100644 index 00000000..d2d599e6 --- /dev/null +++ b/apis/management.cattle.io/v3/fakes/zz_generated_cis_config_mock.go @@ -0,0 +1,1789 @@ +// Code generated by moq; DO NOT EDIT. +// github.com/matryer/moq + +package fakes + +import ( + context "context" + sync "sync" + + controller "github.com/rancher/norman/controller" + objectclient "github.com/rancher/norman/objectclient" + v3 "github.com/rancher/types/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +var ( + lockCisConfigListerMockGet sync.RWMutex + lockCisConfigListerMockList sync.RWMutex +) + +// Ensure, that CisConfigListerMock does implement CisConfigLister. +// If this is not the case, regenerate this file with moq. +var _ v3.CisConfigLister = &CisConfigListerMock{} + +// CisConfigListerMock is a mock implementation of CisConfigLister. +// +// func TestSomethingThatUsesCisConfigLister(t *testing.T) { +// +// // make and configure a mocked CisConfigLister +// mockedCisConfigLister := &CisConfigListerMock{ +// GetFunc: func(namespace string, name string) (*v3.CisConfig, error) { +// panic("mock out the Get method") +// }, +// ListFunc: func(namespace string, selector labels.Selector) ([]*v3.CisConfig, error) { +// panic("mock out the List method") +// }, +// } +// +// // use mockedCisConfigLister in code that requires CisConfigLister +// // and then make assertions. +// +// } +type CisConfigListerMock struct { + // GetFunc mocks the Get method. + GetFunc func(namespace string, name string) (*v3.CisConfig, error) + + // ListFunc mocks the List method. + ListFunc func(namespace string, selector labels.Selector) ([]*v3.CisConfig, error) + + // calls tracks calls to the methods. + calls struct { + // Get holds details about calls to the Get method. + Get []struct { + // Namespace is the namespace argument value. + Namespace string + // Name is the name argument value. + Name string + } + // List holds details about calls to the List method. + List []struct { + // Namespace is the namespace argument value. + Namespace string + // Selector is the selector argument value. + Selector labels.Selector + } + } +} + +// Get calls GetFunc. +func (mock *CisConfigListerMock) Get(namespace string, name string) (*v3.CisConfig, error) { + if mock.GetFunc == nil { + panic("CisConfigListerMock.GetFunc: method is nil but CisConfigLister.Get was just called") + } + callInfo := struct { + Namespace string + Name string + }{ + Namespace: namespace, + Name: name, + } + lockCisConfigListerMockGet.Lock() + mock.calls.Get = append(mock.calls.Get, callInfo) + lockCisConfigListerMockGet.Unlock() + return mock.GetFunc(namespace, name) +} + +// GetCalls gets all the calls that were made to Get. +// Check the length with: +// len(mockedCisConfigLister.GetCalls()) +func (mock *CisConfigListerMock) GetCalls() []struct { + Namespace string + Name string +} { + var calls []struct { + Namespace string + Name string + } + lockCisConfigListerMockGet.RLock() + calls = mock.calls.Get + lockCisConfigListerMockGet.RUnlock() + return calls +} + +// List calls ListFunc. +func (mock *CisConfigListerMock) List(namespace string, selector labels.Selector) ([]*v3.CisConfig, error) { + if mock.ListFunc == nil { + panic("CisConfigListerMock.ListFunc: method is nil but CisConfigLister.List was just called") + } + callInfo := struct { + Namespace string + Selector labels.Selector + }{ + Namespace: namespace, + Selector: selector, + } + lockCisConfigListerMockList.Lock() + mock.calls.List = append(mock.calls.List, callInfo) + lockCisConfigListerMockList.Unlock() + return mock.ListFunc(namespace, selector) +} + +// ListCalls gets all the calls that were made to List. +// Check the length with: +// len(mockedCisConfigLister.ListCalls()) +func (mock *CisConfigListerMock) ListCalls() []struct { + Namespace string + Selector labels.Selector +} { + var calls []struct { + Namespace string + Selector labels.Selector + } + lockCisConfigListerMockList.RLock() + calls = mock.calls.List + lockCisConfigListerMockList.RUnlock() + return calls +} + +var ( + lockCisConfigControllerMockAddClusterScopedFeatureHandler sync.RWMutex + lockCisConfigControllerMockAddClusterScopedHandler sync.RWMutex + lockCisConfigControllerMockAddFeatureHandler sync.RWMutex + lockCisConfigControllerMockAddHandler sync.RWMutex + lockCisConfigControllerMockEnqueue sync.RWMutex + lockCisConfigControllerMockGeneric sync.RWMutex + lockCisConfigControllerMockInformer sync.RWMutex + lockCisConfigControllerMockLister sync.RWMutex + lockCisConfigControllerMockStart sync.RWMutex + lockCisConfigControllerMockSync sync.RWMutex +) + +// Ensure, that CisConfigControllerMock does implement CisConfigController. +// If this is not the case, regenerate this file with moq. +var _ v3.CisConfigController = &CisConfigControllerMock{} + +// CisConfigControllerMock is a mock implementation of CisConfigController. +// +// func TestSomethingThatUsesCisConfigController(t *testing.T) { +// +// // make and configure a mocked CisConfigController +// mockedCisConfigController := &CisConfigControllerMock{ +// AddClusterScopedFeatureHandlerFunc: func(ctx context.Context, enabled func() bool, name string, clusterName string, handler v3.CisConfigHandlerFunc) { +// panic("mock out the AddClusterScopedFeatureHandler method") +// }, +// AddClusterScopedHandlerFunc: func(ctx context.Context, name string, clusterName string, handler v3.CisConfigHandlerFunc) { +// panic("mock out the AddClusterScopedHandler method") +// }, +// AddFeatureHandlerFunc: func(ctx context.Context, enabled func() bool, name string, sync v3.CisConfigHandlerFunc) { +// panic("mock out the AddFeatureHandler method") +// }, +// AddHandlerFunc: func(ctx context.Context, name string, handler v3.CisConfigHandlerFunc) { +// panic("mock out the AddHandler method") +// }, +// EnqueueFunc: func(namespace string, name string) { +// panic("mock out the Enqueue method") +// }, +// GenericFunc: func() controller.GenericController { +// panic("mock out the Generic method") +// }, +// InformerFunc: func() cache.SharedIndexInformer { +// panic("mock out the Informer method") +// }, +// ListerFunc: func() v3.CisConfigLister { +// panic("mock out the Lister method") +// }, +// StartFunc: func(ctx context.Context, threadiness int) error { +// panic("mock out the Start method") +// }, +// SyncFunc: func(ctx context.Context) error { +// panic("mock out the Sync method") +// }, +// } +// +// // use mockedCisConfigController in code that requires CisConfigController +// // and then make assertions. +// +// } +type CisConfigControllerMock struct { + // AddClusterScopedFeatureHandlerFunc mocks the AddClusterScopedFeatureHandler method. + AddClusterScopedFeatureHandlerFunc func(ctx context.Context, enabled func() bool, name string, clusterName string, handler v3.CisConfigHandlerFunc) + + // AddClusterScopedHandlerFunc mocks the AddClusterScopedHandler method. + AddClusterScopedHandlerFunc func(ctx context.Context, name string, clusterName string, handler v3.CisConfigHandlerFunc) + + // AddFeatureHandlerFunc mocks the AddFeatureHandler method. + AddFeatureHandlerFunc func(ctx context.Context, enabled func() bool, name string, sync v3.CisConfigHandlerFunc) + + // AddHandlerFunc mocks the AddHandler method. + AddHandlerFunc func(ctx context.Context, name string, handler v3.CisConfigHandlerFunc) + + // EnqueueFunc mocks the Enqueue method. + EnqueueFunc func(namespace string, name string) + + // GenericFunc mocks the Generic method. + GenericFunc func() controller.GenericController + + // InformerFunc mocks the Informer method. + InformerFunc func() cache.SharedIndexInformer + + // ListerFunc mocks the Lister method. + ListerFunc func() v3.CisConfigLister + + // StartFunc mocks the Start method. + StartFunc func(ctx context.Context, threadiness int) error + + // SyncFunc mocks the Sync method. + SyncFunc func(ctx context.Context) error + + // 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 v3.CisConfigHandlerFunc + } + // AddClusterScopedHandler holds details about calls to the AddClusterScopedHandler method. + AddClusterScopedHandler []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Name is the name argument value. + Name string + // ClusterName is the clusterName argument value. + ClusterName string + // Handler is the handler argument value. + Handler v3.CisConfigHandlerFunc + } + // 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 v3.CisConfigHandlerFunc + } + // AddHandler holds details about calls to the AddHandler method. + AddHandler []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Name is the name argument value. + Name string + // Handler is the handler argument value. + Handler v3.CisConfigHandlerFunc + } + // Enqueue holds details about calls to the Enqueue method. + Enqueue []struct { + // Namespace is the namespace argument value. + Namespace string + // Name is the name argument value. + Name string + } + // Generic holds details about calls to the Generic method. + Generic []struct { + } + // Informer holds details about calls to the Informer method. + Informer []struct { + } + // Lister holds details about calls to the Lister method. + Lister []struct { + } + // Start holds details about calls to the Start method. + Start []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Threadiness is the threadiness argument value. + Threadiness int + } + // Sync holds details about calls to the Sync method. + Sync []struct { + // Ctx is the ctx argument value. + Ctx context.Context + } + } +} + +// AddClusterScopedFeatureHandler calls AddClusterScopedFeatureHandlerFunc. +func (mock *CisConfigControllerMock) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name string, clusterName string, handler v3.CisConfigHandlerFunc) { + if mock.AddClusterScopedFeatureHandlerFunc == nil { + panic("CisConfigControllerMock.AddClusterScopedFeatureHandlerFunc: method is nil but CisConfigController.AddClusterScopedFeatureHandler was just called") + } + callInfo := struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Handler v3.CisConfigHandlerFunc + }{ + Ctx: ctx, + Enabled: enabled, + Name: name, + ClusterName: clusterName, + Handler: handler, + } + lockCisConfigControllerMockAddClusterScopedFeatureHandler.Lock() + mock.calls.AddClusterScopedFeatureHandler = append(mock.calls.AddClusterScopedFeatureHandler, callInfo) + lockCisConfigControllerMockAddClusterScopedFeatureHandler.Unlock() + mock.AddClusterScopedFeatureHandlerFunc(ctx, enabled, name, clusterName, handler) +} + +// AddClusterScopedFeatureHandlerCalls gets all the calls that were made to AddClusterScopedFeatureHandler. +// Check the length with: +// len(mockedCisConfigController.AddClusterScopedFeatureHandlerCalls()) +func (mock *CisConfigControllerMock) AddClusterScopedFeatureHandlerCalls() []struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Handler v3.CisConfigHandlerFunc +} { + var calls []struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Handler v3.CisConfigHandlerFunc + } + lockCisConfigControllerMockAddClusterScopedFeatureHandler.RLock() + calls = mock.calls.AddClusterScopedFeatureHandler + lockCisConfigControllerMockAddClusterScopedFeatureHandler.RUnlock() + return calls +} + +// AddClusterScopedHandler calls AddClusterScopedHandlerFunc. +func (mock *CisConfigControllerMock) AddClusterScopedHandler(ctx context.Context, name string, clusterName string, handler v3.CisConfigHandlerFunc) { + if mock.AddClusterScopedHandlerFunc == nil { + panic("CisConfigControllerMock.AddClusterScopedHandlerFunc: method is nil but CisConfigController.AddClusterScopedHandler was just called") + } + callInfo := struct { + Ctx context.Context + Name string + ClusterName string + Handler v3.CisConfigHandlerFunc + }{ + Ctx: ctx, + Name: name, + ClusterName: clusterName, + Handler: handler, + } + lockCisConfigControllerMockAddClusterScopedHandler.Lock() + mock.calls.AddClusterScopedHandler = append(mock.calls.AddClusterScopedHandler, callInfo) + lockCisConfigControllerMockAddClusterScopedHandler.Unlock() + mock.AddClusterScopedHandlerFunc(ctx, name, clusterName, handler) +} + +// AddClusterScopedHandlerCalls gets all the calls that were made to AddClusterScopedHandler. +// Check the length with: +// len(mockedCisConfigController.AddClusterScopedHandlerCalls()) +func (mock *CisConfigControllerMock) AddClusterScopedHandlerCalls() []struct { + Ctx context.Context + Name string + ClusterName string + Handler v3.CisConfigHandlerFunc +} { + var calls []struct { + Ctx context.Context + Name string + ClusterName string + Handler v3.CisConfigHandlerFunc + } + lockCisConfigControllerMockAddClusterScopedHandler.RLock() + calls = mock.calls.AddClusterScopedHandler + lockCisConfigControllerMockAddClusterScopedHandler.RUnlock() + return calls +} + +// AddFeatureHandler calls AddFeatureHandlerFunc. +func (mock *CisConfigControllerMock) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync v3.CisConfigHandlerFunc) { + if mock.AddFeatureHandlerFunc == nil { + panic("CisConfigControllerMock.AddFeatureHandlerFunc: method is nil but CisConfigController.AddFeatureHandler was just called") + } + callInfo := struct { + Ctx context.Context + Enabled func() bool + Name string + Sync v3.CisConfigHandlerFunc + }{ + Ctx: ctx, + Enabled: enabled, + Name: name, + Sync: sync, + } + lockCisConfigControllerMockAddFeatureHandler.Lock() + mock.calls.AddFeatureHandler = append(mock.calls.AddFeatureHandler, callInfo) + lockCisConfigControllerMockAddFeatureHandler.Unlock() + mock.AddFeatureHandlerFunc(ctx, enabled, name, sync) +} + +// AddFeatureHandlerCalls gets all the calls that were made to AddFeatureHandler. +// Check the length with: +// len(mockedCisConfigController.AddFeatureHandlerCalls()) +func (mock *CisConfigControllerMock) AddFeatureHandlerCalls() []struct { + Ctx context.Context + Enabled func() bool + Name string + Sync v3.CisConfigHandlerFunc +} { + var calls []struct { + Ctx context.Context + Enabled func() bool + Name string + Sync v3.CisConfigHandlerFunc + } + lockCisConfigControllerMockAddFeatureHandler.RLock() + calls = mock.calls.AddFeatureHandler + lockCisConfigControllerMockAddFeatureHandler.RUnlock() + return calls +} + +// AddHandler calls AddHandlerFunc. +func (mock *CisConfigControllerMock) AddHandler(ctx context.Context, name string, handler v3.CisConfigHandlerFunc) { + if mock.AddHandlerFunc == nil { + panic("CisConfigControllerMock.AddHandlerFunc: method is nil but CisConfigController.AddHandler was just called") + } + callInfo := struct { + Ctx context.Context + Name string + Handler v3.CisConfigHandlerFunc + }{ + Ctx: ctx, + Name: name, + Handler: handler, + } + lockCisConfigControllerMockAddHandler.Lock() + mock.calls.AddHandler = append(mock.calls.AddHandler, callInfo) + lockCisConfigControllerMockAddHandler.Unlock() + mock.AddHandlerFunc(ctx, name, handler) +} + +// AddHandlerCalls gets all the calls that were made to AddHandler. +// Check the length with: +// len(mockedCisConfigController.AddHandlerCalls()) +func (mock *CisConfigControllerMock) AddHandlerCalls() []struct { + Ctx context.Context + Name string + Handler v3.CisConfigHandlerFunc +} { + var calls []struct { + Ctx context.Context + Name string + Handler v3.CisConfigHandlerFunc + } + lockCisConfigControllerMockAddHandler.RLock() + calls = mock.calls.AddHandler + lockCisConfigControllerMockAddHandler.RUnlock() + return calls +} + +// Enqueue calls EnqueueFunc. +func (mock *CisConfigControllerMock) Enqueue(namespace string, name string) { + if mock.EnqueueFunc == nil { + panic("CisConfigControllerMock.EnqueueFunc: method is nil but CisConfigController.Enqueue was just called") + } + callInfo := struct { + Namespace string + Name string + }{ + Namespace: namespace, + Name: name, + } + lockCisConfigControllerMockEnqueue.Lock() + mock.calls.Enqueue = append(mock.calls.Enqueue, callInfo) + lockCisConfigControllerMockEnqueue.Unlock() + mock.EnqueueFunc(namespace, name) +} + +// EnqueueCalls gets all the calls that were made to Enqueue. +// Check the length with: +// len(mockedCisConfigController.EnqueueCalls()) +func (mock *CisConfigControllerMock) EnqueueCalls() []struct { + Namespace string + Name string +} { + var calls []struct { + Namespace string + Name string + } + lockCisConfigControllerMockEnqueue.RLock() + calls = mock.calls.Enqueue + lockCisConfigControllerMockEnqueue.RUnlock() + return calls +} + +// Generic calls GenericFunc. +func (mock *CisConfigControllerMock) Generic() controller.GenericController { + if mock.GenericFunc == nil { + panic("CisConfigControllerMock.GenericFunc: method is nil but CisConfigController.Generic was just called") + } + callInfo := struct { + }{} + lockCisConfigControllerMockGeneric.Lock() + mock.calls.Generic = append(mock.calls.Generic, callInfo) + lockCisConfigControllerMockGeneric.Unlock() + return mock.GenericFunc() +} + +// GenericCalls gets all the calls that were made to Generic. +// Check the length with: +// len(mockedCisConfigController.GenericCalls()) +func (mock *CisConfigControllerMock) GenericCalls() []struct { +} { + var calls []struct { + } + lockCisConfigControllerMockGeneric.RLock() + calls = mock.calls.Generic + lockCisConfigControllerMockGeneric.RUnlock() + return calls +} + +// Informer calls InformerFunc. +func (mock *CisConfigControllerMock) Informer() cache.SharedIndexInformer { + if mock.InformerFunc == nil { + panic("CisConfigControllerMock.InformerFunc: method is nil but CisConfigController.Informer was just called") + } + callInfo := struct { + }{} + lockCisConfigControllerMockInformer.Lock() + mock.calls.Informer = append(mock.calls.Informer, callInfo) + lockCisConfigControllerMockInformer.Unlock() + return mock.InformerFunc() +} + +// InformerCalls gets all the calls that were made to Informer. +// Check the length with: +// len(mockedCisConfigController.InformerCalls()) +func (mock *CisConfigControllerMock) InformerCalls() []struct { +} { + var calls []struct { + } + lockCisConfigControllerMockInformer.RLock() + calls = mock.calls.Informer + lockCisConfigControllerMockInformer.RUnlock() + return calls +} + +// Lister calls ListerFunc. +func (mock *CisConfigControllerMock) Lister() v3.CisConfigLister { + if mock.ListerFunc == nil { + panic("CisConfigControllerMock.ListerFunc: method is nil but CisConfigController.Lister was just called") + } + callInfo := struct { + }{} + lockCisConfigControllerMockLister.Lock() + mock.calls.Lister = append(mock.calls.Lister, callInfo) + lockCisConfigControllerMockLister.Unlock() + return mock.ListerFunc() +} + +// ListerCalls gets all the calls that were made to Lister. +// Check the length with: +// len(mockedCisConfigController.ListerCalls()) +func (mock *CisConfigControllerMock) ListerCalls() []struct { +} { + var calls []struct { + } + lockCisConfigControllerMockLister.RLock() + calls = mock.calls.Lister + lockCisConfigControllerMockLister.RUnlock() + return calls +} + +// Start calls StartFunc. +func (mock *CisConfigControllerMock) Start(ctx context.Context, threadiness int) error { + if mock.StartFunc == nil { + panic("CisConfigControllerMock.StartFunc: method is nil but CisConfigController.Start was just called") + } + callInfo := struct { + Ctx context.Context + Threadiness int + }{ + Ctx: ctx, + Threadiness: threadiness, + } + lockCisConfigControllerMockStart.Lock() + mock.calls.Start = append(mock.calls.Start, callInfo) + lockCisConfigControllerMockStart.Unlock() + return mock.StartFunc(ctx, threadiness) +} + +// StartCalls gets all the calls that were made to Start. +// Check the length with: +// len(mockedCisConfigController.StartCalls()) +func (mock *CisConfigControllerMock) StartCalls() []struct { + Ctx context.Context + Threadiness int +} { + var calls []struct { + Ctx context.Context + Threadiness int + } + lockCisConfigControllerMockStart.RLock() + calls = mock.calls.Start + lockCisConfigControllerMockStart.RUnlock() + return calls +} + +// Sync calls SyncFunc. +func (mock *CisConfigControllerMock) Sync(ctx context.Context) error { + if mock.SyncFunc == nil { + panic("CisConfigControllerMock.SyncFunc: method is nil but CisConfigController.Sync was just called") + } + callInfo := struct { + Ctx context.Context + }{ + Ctx: ctx, + } + lockCisConfigControllerMockSync.Lock() + mock.calls.Sync = append(mock.calls.Sync, callInfo) + lockCisConfigControllerMockSync.Unlock() + return mock.SyncFunc(ctx) +} + +// SyncCalls gets all the calls that were made to Sync. +// Check the length with: +// len(mockedCisConfigController.SyncCalls()) +func (mock *CisConfigControllerMock) SyncCalls() []struct { + Ctx context.Context +} { + var calls []struct { + Ctx context.Context + } + lockCisConfigControllerMockSync.RLock() + calls = mock.calls.Sync + lockCisConfigControllerMockSync.RUnlock() + return calls +} + +var ( + lockCisConfigInterfaceMockAddClusterScopedFeatureHandler sync.RWMutex + lockCisConfigInterfaceMockAddClusterScopedFeatureLifecycle sync.RWMutex + lockCisConfigInterfaceMockAddClusterScopedHandler sync.RWMutex + lockCisConfigInterfaceMockAddClusterScopedLifecycle sync.RWMutex + lockCisConfigInterfaceMockAddFeatureHandler sync.RWMutex + lockCisConfigInterfaceMockAddFeatureLifecycle sync.RWMutex + lockCisConfigInterfaceMockAddHandler sync.RWMutex + lockCisConfigInterfaceMockAddLifecycle sync.RWMutex + lockCisConfigInterfaceMockController sync.RWMutex + lockCisConfigInterfaceMockCreate sync.RWMutex + lockCisConfigInterfaceMockDelete sync.RWMutex + lockCisConfigInterfaceMockDeleteCollection sync.RWMutex + lockCisConfigInterfaceMockDeleteNamespaced sync.RWMutex + lockCisConfigInterfaceMockGet sync.RWMutex + lockCisConfigInterfaceMockGetNamespaced sync.RWMutex + lockCisConfigInterfaceMockList sync.RWMutex + lockCisConfigInterfaceMockListNamespaced sync.RWMutex + lockCisConfigInterfaceMockObjectClient sync.RWMutex + lockCisConfigInterfaceMockUpdate sync.RWMutex + lockCisConfigInterfaceMockWatch sync.RWMutex +) + +// Ensure, that CisConfigInterfaceMock does implement CisConfigInterface. +// If this is not the case, regenerate this file with moq. +var _ v3.CisConfigInterface = &CisConfigInterfaceMock{} + +// CisConfigInterfaceMock is a mock implementation of CisConfigInterface. +// +// func TestSomethingThatUsesCisConfigInterface(t *testing.T) { +// +// // make and configure a mocked CisConfigInterface +// mockedCisConfigInterface := &CisConfigInterfaceMock{ +// AddClusterScopedFeatureHandlerFunc: func(ctx context.Context, enabled func() bool, name string, clusterName string, sync v3.CisConfigHandlerFunc) { +// panic("mock out the AddClusterScopedFeatureHandler method") +// }, +// AddClusterScopedFeatureLifecycleFunc: func(ctx context.Context, enabled func() bool, name string, clusterName string, lifecycle v3.CisConfigLifecycle) { +// panic("mock out the AddClusterScopedFeatureLifecycle method") +// }, +// AddClusterScopedHandlerFunc: func(ctx context.Context, name string, clusterName string, sync v3.CisConfigHandlerFunc) { +// panic("mock out the AddClusterScopedHandler method") +// }, +// AddClusterScopedLifecycleFunc: func(ctx context.Context, name string, clusterName string, lifecycle v3.CisConfigLifecycle) { +// panic("mock out the AddClusterScopedLifecycle method") +// }, +// AddFeatureHandlerFunc: func(ctx context.Context, enabled func() bool, name string, sync v3.CisConfigHandlerFunc) { +// panic("mock out the AddFeatureHandler method") +// }, +// AddFeatureLifecycleFunc: func(ctx context.Context, enabled func() bool, name string, lifecycle v3.CisConfigLifecycle) { +// panic("mock out the AddFeatureLifecycle method") +// }, +// AddHandlerFunc: func(ctx context.Context, name string, sync v3.CisConfigHandlerFunc) { +// panic("mock out the AddHandler method") +// }, +// AddLifecycleFunc: func(ctx context.Context, name string, lifecycle v3.CisConfigLifecycle) { +// panic("mock out the AddLifecycle method") +// }, +// ControllerFunc: func() v3.CisConfigController { +// panic("mock out the Controller method") +// }, +// CreateFunc: func(in1 *v3.CisConfig) (*v3.CisConfig, error) { +// panic("mock out the Create method") +// }, +// DeleteFunc: func(name string, options *v1.DeleteOptions) error { +// panic("mock out the Delete method") +// }, +// DeleteCollectionFunc: func(deleteOpts *v1.DeleteOptions, listOpts v1.ListOptions) error { +// panic("mock out the DeleteCollection method") +// }, +// DeleteNamespacedFunc: func(namespace string, name string, options *v1.DeleteOptions) error { +// panic("mock out the DeleteNamespaced method") +// }, +// GetFunc: func(name string, opts v1.GetOptions) (*v3.CisConfig, error) { +// panic("mock out the Get method") +// }, +// GetNamespacedFunc: func(namespace string, name string, opts v1.GetOptions) (*v3.CisConfig, error) { +// panic("mock out the GetNamespaced method") +// }, +// ListFunc: func(opts v1.ListOptions) (*v3.CisConfigList, error) { +// panic("mock out the List method") +// }, +// ListNamespacedFunc: func(namespace string, opts v1.ListOptions) (*v3.CisConfigList, error) { +// panic("mock out the ListNamespaced method") +// }, +// ObjectClientFunc: func() *objectclient.ObjectClient { +// panic("mock out the ObjectClient method") +// }, +// UpdateFunc: func(in1 *v3.CisConfig) (*v3.CisConfig, error) { +// panic("mock out the Update method") +// }, +// WatchFunc: func(opts v1.ListOptions) (watch.Interface, error) { +// panic("mock out the Watch method") +// }, +// } +// +// // use mockedCisConfigInterface in code that requires CisConfigInterface +// // and then make assertions. +// +// } +type CisConfigInterfaceMock struct { + // AddClusterScopedFeatureHandlerFunc mocks the AddClusterScopedFeatureHandler method. + AddClusterScopedFeatureHandlerFunc func(ctx context.Context, enabled func() bool, name string, clusterName string, sync v3.CisConfigHandlerFunc) + + // AddClusterScopedFeatureLifecycleFunc mocks the AddClusterScopedFeatureLifecycle method. + AddClusterScopedFeatureLifecycleFunc func(ctx context.Context, enabled func() bool, name string, clusterName string, lifecycle v3.CisConfigLifecycle) + + // AddClusterScopedHandlerFunc mocks the AddClusterScopedHandler method. + AddClusterScopedHandlerFunc func(ctx context.Context, name string, clusterName string, sync v3.CisConfigHandlerFunc) + + // AddClusterScopedLifecycleFunc mocks the AddClusterScopedLifecycle method. + AddClusterScopedLifecycleFunc func(ctx context.Context, name string, clusterName string, lifecycle v3.CisConfigLifecycle) + + // AddFeatureHandlerFunc mocks the AddFeatureHandler method. + AddFeatureHandlerFunc func(ctx context.Context, enabled func() bool, name string, sync v3.CisConfigHandlerFunc) + + // AddFeatureLifecycleFunc mocks the AddFeatureLifecycle method. + AddFeatureLifecycleFunc func(ctx context.Context, enabled func() bool, name string, lifecycle v3.CisConfigLifecycle) + + // AddHandlerFunc mocks the AddHandler method. + AddHandlerFunc func(ctx context.Context, name string, sync v3.CisConfigHandlerFunc) + + // AddLifecycleFunc mocks the AddLifecycle method. + AddLifecycleFunc func(ctx context.Context, name string, lifecycle v3.CisConfigLifecycle) + + // ControllerFunc mocks the Controller method. + ControllerFunc func() v3.CisConfigController + + // CreateFunc mocks the Create method. + CreateFunc func(in1 *v3.CisConfig) (*v3.CisConfig, error) + + // DeleteFunc mocks the Delete method. + DeleteFunc func(name string, options *v1.DeleteOptions) error + + // DeleteCollectionFunc mocks the DeleteCollection method. + DeleteCollectionFunc func(deleteOpts *v1.DeleteOptions, listOpts v1.ListOptions) error + + // DeleteNamespacedFunc mocks the DeleteNamespaced method. + DeleteNamespacedFunc func(namespace string, name string, options *v1.DeleteOptions) error + + // GetFunc mocks the Get method. + GetFunc func(name string, opts v1.GetOptions) (*v3.CisConfig, error) + + // GetNamespacedFunc mocks the GetNamespaced method. + GetNamespacedFunc func(namespace string, name string, opts v1.GetOptions) (*v3.CisConfig, error) + + // ListFunc mocks the List method. + ListFunc func(opts v1.ListOptions) (*v3.CisConfigList, error) + + // ListNamespacedFunc mocks the ListNamespaced method. + ListNamespacedFunc func(namespace string, opts v1.ListOptions) (*v3.CisConfigList, error) + + // ObjectClientFunc mocks the ObjectClient method. + ObjectClientFunc func() *objectclient.ObjectClient + + // UpdateFunc mocks the Update method. + UpdateFunc func(in1 *v3.CisConfig) (*v3.CisConfig, error) + + // WatchFunc mocks the Watch method. + WatchFunc func(opts v1.ListOptions) (watch.Interface, error) + + // 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 v3.CisConfigHandlerFunc + } + // 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 v3.CisConfigLifecycle + } + // AddClusterScopedHandler holds details about calls to the AddClusterScopedHandler method. + AddClusterScopedHandler []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Name is the name argument value. + Name string + // ClusterName is the clusterName argument value. + ClusterName string + // Sync is the sync argument value. + Sync v3.CisConfigHandlerFunc + } + // AddClusterScopedLifecycle holds details about calls to the AddClusterScopedLifecycle method. + AddClusterScopedLifecycle []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Name is the name argument value. + Name string + // ClusterName is the clusterName argument value. + ClusterName string + // Lifecycle is the lifecycle argument value. + Lifecycle v3.CisConfigLifecycle + } + // 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 v3.CisConfigHandlerFunc + } + // 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 v3.CisConfigLifecycle + } + // AddHandler holds details about calls to the AddHandler method. + AddHandler []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Name is the name argument value. + Name string + // Sync is the sync argument value. + Sync v3.CisConfigHandlerFunc + } + // AddLifecycle holds details about calls to the AddLifecycle method. + AddLifecycle []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Name is the name argument value. + Name string + // Lifecycle is the lifecycle argument value. + Lifecycle v3.CisConfigLifecycle + } + // Controller holds details about calls to the Controller method. + Controller []struct { + } + // Create holds details about calls to the Create method. + Create []struct { + // In1 is the in1 argument value. + In1 *v3.CisConfig + } + // Delete holds details about calls to the Delete method. + Delete []struct { + // Name is the name argument value. + Name string + // Options is the options argument value. + Options *v1.DeleteOptions + } + // DeleteCollection holds details about calls to the DeleteCollection method. + DeleteCollection []struct { + // DeleteOpts is the deleteOpts argument value. + DeleteOpts *v1.DeleteOptions + // ListOpts is the listOpts argument value. + ListOpts v1.ListOptions + } + // DeleteNamespaced holds details about calls to the DeleteNamespaced method. + DeleteNamespaced []struct { + // Namespace is the namespace argument value. + Namespace string + // Name is the name argument value. + Name string + // Options is the options argument value. + Options *v1.DeleteOptions + } + // Get holds details about calls to the Get method. + Get []struct { + // Name is the name argument value. + Name string + // Opts is the opts argument value. + Opts v1.GetOptions + } + // GetNamespaced holds details about calls to the GetNamespaced method. + GetNamespaced []struct { + // Namespace is the namespace argument value. + Namespace string + // Name is the name argument value. + Name string + // Opts is the opts argument value. + Opts v1.GetOptions + } + // List holds details about calls to the List method. + List []struct { + // Opts is the opts argument value. + Opts v1.ListOptions + } + // ListNamespaced holds details about calls to the ListNamespaced method. + ListNamespaced []struct { + // Namespace is the namespace argument value. + Namespace string + // Opts is the opts argument value. + Opts v1.ListOptions + } + // ObjectClient holds details about calls to the ObjectClient method. + ObjectClient []struct { + } + // Update holds details about calls to the Update method. + Update []struct { + // In1 is the in1 argument value. + In1 *v3.CisConfig + } + // Watch holds details about calls to the Watch method. + Watch []struct { + // Opts is the opts argument value. + Opts v1.ListOptions + } + } +} + +// AddClusterScopedFeatureHandler calls AddClusterScopedFeatureHandlerFunc. +func (mock *CisConfigInterfaceMock) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name string, clusterName string, sync v3.CisConfigHandlerFunc) { + if mock.AddClusterScopedFeatureHandlerFunc == nil { + panic("CisConfigInterfaceMock.AddClusterScopedFeatureHandlerFunc: method is nil but CisConfigInterface.AddClusterScopedFeatureHandler was just called") + } + callInfo := struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Sync v3.CisConfigHandlerFunc + }{ + Ctx: ctx, + Enabled: enabled, + Name: name, + ClusterName: clusterName, + Sync: sync, + } + lockCisConfigInterfaceMockAddClusterScopedFeatureHandler.Lock() + mock.calls.AddClusterScopedFeatureHandler = append(mock.calls.AddClusterScopedFeatureHandler, callInfo) + lockCisConfigInterfaceMockAddClusterScopedFeatureHandler.Unlock() + mock.AddClusterScopedFeatureHandlerFunc(ctx, enabled, name, clusterName, sync) +} + +// AddClusterScopedFeatureHandlerCalls gets all the calls that were made to AddClusterScopedFeatureHandler. +// Check the length with: +// len(mockedCisConfigInterface.AddClusterScopedFeatureHandlerCalls()) +func (mock *CisConfigInterfaceMock) AddClusterScopedFeatureHandlerCalls() []struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Sync v3.CisConfigHandlerFunc +} { + var calls []struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Sync v3.CisConfigHandlerFunc + } + lockCisConfigInterfaceMockAddClusterScopedFeatureHandler.RLock() + calls = mock.calls.AddClusterScopedFeatureHandler + lockCisConfigInterfaceMockAddClusterScopedFeatureHandler.RUnlock() + return calls +} + +// AddClusterScopedFeatureLifecycle calls AddClusterScopedFeatureLifecycleFunc. +func (mock *CisConfigInterfaceMock) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name string, clusterName string, lifecycle v3.CisConfigLifecycle) { + if mock.AddClusterScopedFeatureLifecycleFunc == nil { + panic("CisConfigInterfaceMock.AddClusterScopedFeatureLifecycleFunc: method is nil but CisConfigInterface.AddClusterScopedFeatureLifecycle was just called") + } + callInfo := struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Lifecycle v3.CisConfigLifecycle + }{ + Ctx: ctx, + Enabled: enabled, + Name: name, + ClusterName: clusterName, + Lifecycle: lifecycle, + } + lockCisConfigInterfaceMockAddClusterScopedFeatureLifecycle.Lock() + mock.calls.AddClusterScopedFeatureLifecycle = append(mock.calls.AddClusterScopedFeatureLifecycle, callInfo) + lockCisConfigInterfaceMockAddClusterScopedFeatureLifecycle.Unlock() + mock.AddClusterScopedFeatureLifecycleFunc(ctx, enabled, name, clusterName, lifecycle) +} + +// AddClusterScopedFeatureLifecycleCalls gets all the calls that were made to AddClusterScopedFeatureLifecycle. +// Check the length with: +// len(mockedCisConfigInterface.AddClusterScopedFeatureLifecycleCalls()) +func (mock *CisConfigInterfaceMock) AddClusterScopedFeatureLifecycleCalls() []struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Lifecycle v3.CisConfigLifecycle +} { + var calls []struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Lifecycle v3.CisConfigLifecycle + } + lockCisConfigInterfaceMockAddClusterScopedFeatureLifecycle.RLock() + calls = mock.calls.AddClusterScopedFeatureLifecycle + lockCisConfigInterfaceMockAddClusterScopedFeatureLifecycle.RUnlock() + return calls +} + +// AddClusterScopedHandler calls AddClusterScopedHandlerFunc. +func (mock *CisConfigInterfaceMock) AddClusterScopedHandler(ctx context.Context, name string, clusterName string, sync v3.CisConfigHandlerFunc) { + if mock.AddClusterScopedHandlerFunc == nil { + panic("CisConfigInterfaceMock.AddClusterScopedHandlerFunc: method is nil but CisConfigInterface.AddClusterScopedHandler was just called") + } + callInfo := struct { + Ctx context.Context + Name string + ClusterName string + Sync v3.CisConfigHandlerFunc + }{ + Ctx: ctx, + Name: name, + ClusterName: clusterName, + Sync: sync, + } + lockCisConfigInterfaceMockAddClusterScopedHandler.Lock() + mock.calls.AddClusterScopedHandler = append(mock.calls.AddClusterScopedHandler, callInfo) + lockCisConfigInterfaceMockAddClusterScopedHandler.Unlock() + mock.AddClusterScopedHandlerFunc(ctx, name, clusterName, sync) +} + +// AddClusterScopedHandlerCalls gets all the calls that were made to AddClusterScopedHandler. +// Check the length with: +// len(mockedCisConfigInterface.AddClusterScopedHandlerCalls()) +func (mock *CisConfigInterfaceMock) AddClusterScopedHandlerCalls() []struct { + Ctx context.Context + Name string + ClusterName string + Sync v3.CisConfigHandlerFunc +} { + var calls []struct { + Ctx context.Context + Name string + ClusterName string + Sync v3.CisConfigHandlerFunc + } + lockCisConfigInterfaceMockAddClusterScopedHandler.RLock() + calls = mock.calls.AddClusterScopedHandler + lockCisConfigInterfaceMockAddClusterScopedHandler.RUnlock() + return calls +} + +// AddClusterScopedLifecycle calls AddClusterScopedLifecycleFunc. +func (mock *CisConfigInterfaceMock) AddClusterScopedLifecycle(ctx context.Context, name string, clusterName string, lifecycle v3.CisConfigLifecycle) { + if mock.AddClusterScopedLifecycleFunc == nil { + panic("CisConfigInterfaceMock.AddClusterScopedLifecycleFunc: method is nil but CisConfigInterface.AddClusterScopedLifecycle was just called") + } + callInfo := struct { + Ctx context.Context + Name string + ClusterName string + Lifecycle v3.CisConfigLifecycle + }{ + Ctx: ctx, + Name: name, + ClusterName: clusterName, + Lifecycle: lifecycle, + } + lockCisConfigInterfaceMockAddClusterScopedLifecycle.Lock() + mock.calls.AddClusterScopedLifecycle = append(mock.calls.AddClusterScopedLifecycle, callInfo) + lockCisConfigInterfaceMockAddClusterScopedLifecycle.Unlock() + mock.AddClusterScopedLifecycleFunc(ctx, name, clusterName, lifecycle) +} + +// AddClusterScopedLifecycleCalls gets all the calls that were made to AddClusterScopedLifecycle. +// Check the length with: +// len(mockedCisConfigInterface.AddClusterScopedLifecycleCalls()) +func (mock *CisConfigInterfaceMock) AddClusterScopedLifecycleCalls() []struct { + Ctx context.Context + Name string + ClusterName string + Lifecycle v3.CisConfigLifecycle +} { + var calls []struct { + Ctx context.Context + Name string + ClusterName string + Lifecycle v3.CisConfigLifecycle + } + lockCisConfigInterfaceMockAddClusterScopedLifecycle.RLock() + calls = mock.calls.AddClusterScopedLifecycle + lockCisConfigInterfaceMockAddClusterScopedLifecycle.RUnlock() + return calls +} + +// AddFeatureHandler calls AddFeatureHandlerFunc. +func (mock *CisConfigInterfaceMock) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync v3.CisConfigHandlerFunc) { + if mock.AddFeatureHandlerFunc == nil { + panic("CisConfigInterfaceMock.AddFeatureHandlerFunc: method is nil but CisConfigInterface.AddFeatureHandler was just called") + } + callInfo := struct { + Ctx context.Context + Enabled func() bool + Name string + Sync v3.CisConfigHandlerFunc + }{ + Ctx: ctx, + Enabled: enabled, + Name: name, + Sync: sync, + } + lockCisConfigInterfaceMockAddFeatureHandler.Lock() + mock.calls.AddFeatureHandler = append(mock.calls.AddFeatureHandler, callInfo) + lockCisConfigInterfaceMockAddFeatureHandler.Unlock() + mock.AddFeatureHandlerFunc(ctx, enabled, name, sync) +} + +// AddFeatureHandlerCalls gets all the calls that were made to AddFeatureHandler. +// Check the length with: +// len(mockedCisConfigInterface.AddFeatureHandlerCalls()) +func (mock *CisConfigInterfaceMock) AddFeatureHandlerCalls() []struct { + Ctx context.Context + Enabled func() bool + Name string + Sync v3.CisConfigHandlerFunc +} { + var calls []struct { + Ctx context.Context + Enabled func() bool + Name string + Sync v3.CisConfigHandlerFunc + } + lockCisConfigInterfaceMockAddFeatureHandler.RLock() + calls = mock.calls.AddFeatureHandler + lockCisConfigInterfaceMockAddFeatureHandler.RUnlock() + return calls +} + +// AddFeatureLifecycle calls AddFeatureLifecycleFunc. +func (mock *CisConfigInterfaceMock) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle v3.CisConfigLifecycle) { + if mock.AddFeatureLifecycleFunc == nil { + panic("CisConfigInterfaceMock.AddFeatureLifecycleFunc: method is nil but CisConfigInterface.AddFeatureLifecycle was just called") + } + callInfo := struct { + Ctx context.Context + Enabled func() bool + Name string + Lifecycle v3.CisConfigLifecycle + }{ + Ctx: ctx, + Enabled: enabled, + Name: name, + Lifecycle: lifecycle, + } + lockCisConfigInterfaceMockAddFeatureLifecycle.Lock() + mock.calls.AddFeatureLifecycle = append(mock.calls.AddFeatureLifecycle, callInfo) + lockCisConfigInterfaceMockAddFeatureLifecycle.Unlock() + mock.AddFeatureLifecycleFunc(ctx, enabled, name, lifecycle) +} + +// AddFeatureLifecycleCalls gets all the calls that were made to AddFeatureLifecycle. +// Check the length with: +// len(mockedCisConfigInterface.AddFeatureLifecycleCalls()) +func (mock *CisConfigInterfaceMock) AddFeatureLifecycleCalls() []struct { + Ctx context.Context + Enabled func() bool + Name string + Lifecycle v3.CisConfigLifecycle +} { + var calls []struct { + Ctx context.Context + Enabled func() bool + Name string + Lifecycle v3.CisConfigLifecycle + } + lockCisConfigInterfaceMockAddFeatureLifecycle.RLock() + calls = mock.calls.AddFeatureLifecycle + lockCisConfigInterfaceMockAddFeatureLifecycle.RUnlock() + return calls +} + +// AddHandler calls AddHandlerFunc. +func (mock *CisConfigInterfaceMock) AddHandler(ctx context.Context, name string, sync v3.CisConfigHandlerFunc) { + if mock.AddHandlerFunc == nil { + panic("CisConfigInterfaceMock.AddHandlerFunc: method is nil but CisConfigInterface.AddHandler was just called") + } + callInfo := struct { + Ctx context.Context + Name string + Sync v3.CisConfigHandlerFunc + }{ + Ctx: ctx, + Name: name, + Sync: sync, + } + lockCisConfigInterfaceMockAddHandler.Lock() + mock.calls.AddHandler = append(mock.calls.AddHandler, callInfo) + lockCisConfigInterfaceMockAddHandler.Unlock() + mock.AddHandlerFunc(ctx, name, sync) +} + +// AddHandlerCalls gets all the calls that were made to AddHandler. +// Check the length with: +// len(mockedCisConfigInterface.AddHandlerCalls()) +func (mock *CisConfigInterfaceMock) AddHandlerCalls() []struct { + Ctx context.Context + Name string + Sync v3.CisConfigHandlerFunc +} { + var calls []struct { + Ctx context.Context + Name string + Sync v3.CisConfigHandlerFunc + } + lockCisConfigInterfaceMockAddHandler.RLock() + calls = mock.calls.AddHandler + lockCisConfigInterfaceMockAddHandler.RUnlock() + return calls +} + +// AddLifecycle calls AddLifecycleFunc. +func (mock *CisConfigInterfaceMock) AddLifecycle(ctx context.Context, name string, lifecycle v3.CisConfigLifecycle) { + if mock.AddLifecycleFunc == nil { + panic("CisConfigInterfaceMock.AddLifecycleFunc: method is nil but CisConfigInterface.AddLifecycle was just called") + } + callInfo := struct { + Ctx context.Context + Name string + Lifecycle v3.CisConfigLifecycle + }{ + Ctx: ctx, + Name: name, + Lifecycle: lifecycle, + } + lockCisConfigInterfaceMockAddLifecycle.Lock() + mock.calls.AddLifecycle = append(mock.calls.AddLifecycle, callInfo) + lockCisConfigInterfaceMockAddLifecycle.Unlock() + mock.AddLifecycleFunc(ctx, name, lifecycle) +} + +// AddLifecycleCalls gets all the calls that were made to AddLifecycle. +// Check the length with: +// len(mockedCisConfigInterface.AddLifecycleCalls()) +func (mock *CisConfigInterfaceMock) AddLifecycleCalls() []struct { + Ctx context.Context + Name string + Lifecycle v3.CisConfigLifecycle +} { + var calls []struct { + Ctx context.Context + Name string + Lifecycle v3.CisConfigLifecycle + } + lockCisConfigInterfaceMockAddLifecycle.RLock() + calls = mock.calls.AddLifecycle + lockCisConfigInterfaceMockAddLifecycle.RUnlock() + return calls +} + +// Controller calls ControllerFunc. +func (mock *CisConfigInterfaceMock) Controller() v3.CisConfigController { + if mock.ControllerFunc == nil { + panic("CisConfigInterfaceMock.ControllerFunc: method is nil but CisConfigInterface.Controller was just called") + } + callInfo := struct { + }{} + lockCisConfigInterfaceMockController.Lock() + mock.calls.Controller = append(mock.calls.Controller, callInfo) + lockCisConfigInterfaceMockController.Unlock() + return mock.ControllerFunc() +} + +// ControllerCalls gets all the calls that were made to Controller. +// Check the length with: +// len(mockedCisConfigInterface.ControllerCalls()) +func (mock *CisConfigInterfaceMock) ControllerCalls() []struct { +} { + var calls []struct { + } + lockCisConfigInterfaceMockController.RLock() + calls = mock.calls.Controller + lockCisConfigInterfaceMockController.RUnlock() + return calls +} + +// Create calls CreateFunc. +func (mock *CisConfigInterfaceMock) Create(in1 *v3.CisConfig) (*v3.CisConfig, error) { + if mock.CreateFunc == nil { + panic("CisConfigInterfaceMock.CreateFunc: method is nil but CisConfigInterface.Create was just called") + } + callInfo := struct { + In1 *v3.CisConfig + }{ + In1: in1, + } + lockCisConfigInterfaceMockCreate.Lock() + mock.calls.Create = append(mock.calls.Create, callInfo) + lockCisConfigInterfaceMockCreate.Unlock() + return mock.CreateFunc(in1) +} + +// CreateCalls gets all the calls that were made to Create. +// Check the length with: +// len(mockedCisConfigInterface.CreateCalls()) +func (mock *CisConfigInterfaceMock) CreateCalls() []struct { + In1 *v3.CisConfig +} { + var calls []struct { + In1 *v3.CisConfig + } + lockCisConfigInterfaceMockCreate.RLock() + calls = mock.calls.Create + lockCisConfigInterfaceMockCreate.RUnlock() + return calls +} + +// Delete calls DeleteFunc. +func (mock *CisConfigInterfaceMock) Delete(name string, options *v1.DeleteOptions) error { + if mock.DeleteFunc == nil { + panic("CisConfigInterfaceMock.DeleteFunc: method is nil but CisConfigInterface.Delete was just called") + } + callInfo := struct { + Name string + Options *v1.DeleteOptions + }{ + Name: name, + Options: options, + } + lockCisConfigInterfaceMockDelete.Lock() + mock.calls.Delete = append(mock.calls.Delete, callInfo) + lockCisConfigInterfaceMockDelete.Unlock() + return mock.DeleteFunc(name, options) +} + +// DeleteCalls gets all the calls that were made to Delete. +// Check the length with: +// len(mockedCisConfigInterface.DeleteCalls()) +func (mock *CisConfigInterfaceMock) DeleteCalls() []struct { + Name string + Options *v1.DeleteOptions +} { + var calls []struct { + Name string + Options *v1.DeleteOptions + } + lockCisConfigInterfaceMockDelete.RLock() + calls = mock.calls.Delete + lockCisConfigInterfaceMockDelete.RUnlock() + return calls +} + +// DeleteCollection calls DeleteCollectionFunc. +func (mock *CisConfigInterfaceMock) DeleteCollection(deleteOpts *v1.DeleteOptions, listOpts v1.ListOptions) error { + if mock.DeleteCollectionFunc == nil { + panic("CisConfigInterfaceMock.DeleteCollectionFunc: method is nil but CisConfigInterface.DeleteCollection was just called") + } + callInfo := struct { + DeleteOpts *v1.DeleteOptions + ListOpts v1.ListOptions + }{ + DeleteOpts: deleteOpts, + ListOpts: listOpts, + } + lockCisConfigInterfaceMockDeleteCollection.Lock() + mock.calls.DeleteCollection = append(mock.calls.DeleteCollection, callInfo) + lockCisConfigInterfaceMockDeleteCollection.Unlock() + return mock.DeleteCollectionFunc(deleteOpts, listOpts) +} + +// DeleteCollectionCalls gets all the calls that were made to DeleteCollection. +// Check the length with: +// len(mockedCisConfigInterface.DeleteCollectionCalls()) +func (mock *CisConfigInterfaceMock) DeleteCollectionCalls() []struct { + DeleteOpts *v1.DeleteOptions + ListOpts v1.ListOptions +} { + var calls []struct { + DeleteOpts *v1.DeleteOptions + ListOpts v1.ListOptions + } + lockCisConfigInterfaceMockDeleteCollection.RLock() + calls = mock.calls.DeleteCollection + lockCisConfigInterfaceMockDeleteCollection.RUnlock() + return calls +} + +// DeleteNamespaced calls DeleteNamespacedFunc. +func (mock *CisConfigInterfaceMock) DeleteNamespaced(namespace string, name string, options *v1.DeleteOptions) error { + if mock.DeleteNamespacedFunc == nil { + panic("CisConfigInterfaceMock.DeleteNamespacedFunc: method is nil but CisConfigInterface.DeleteNamespaced was just called") + } + callInfo := struct { + Namespace string + Name string + Options *v1.DeleteOptions + }{ + Namespace: namespace, + Name: name, + Options: options, + } + lockCisConfigInterfaceMockDeleteNamespaced.Lock() + mock.calls.DeleteNamespaced = append(mock.calls.DeleteNamespaced, callInfo) + lockCisConfigInterfaceMockDeleteNamespaced.Unlock() + return mock.DeleteNamespacedFunc(namespace, name, options) +} + +// DeleteNamespacedCalls gets all the calls that were made to DeleteNamespaced. +// Check the length with: +// len(mockedCisConfigInterface.DeleteNamespacedCalls()) +func (mock *CisConfigInterfaceMock) DeleteNamespacedCalls() []struct { + Namespace string + Name string + Options *v1.DeleteOptions +} { + var calls []struct { + Namespace string + Name string + Options *v1.DeleteOptions + } + lockCisConfigInterfaceMockDeleteNamespaced.RLock() + calls = mock.calls.DeleteNamespaced + lockCisConfigInterfaceMockDeleteNamespaced.RUnlock() + return calls +} + +// Get calls GetFunc. +func (mock *CisConfigInterfaceMock) Get(name string, opts v1.GetOptions) (*v3.CisConfig, error) { + if mock.GetFunc == nil { + panic("CisConfigInterfaceMock.GetFunc: method is nil but CisConfigInterface.Get was just called") + } + callInfo := struct { + Name string + Opts v1.GetOptions + }{ + Name: name, + Opts: opts, + } + lockCisConfigInterfaceMockGet.Lock() + mock.calls.Get = append(mock.calls.Get, callInfo) + lockCisConfigInterfaceMockGet.Unlock() + return mock.GetFunc(name, opts) +} + +// GetCalls gets all the calls that were made to Get. +// Check the length with: +// len(mockedCisConfigInterface.GetCalls()) +func (mock *CisConfigInterfaceMock) GetCalls() []struct { + Name string + Opts v1.GetOptions +} { + var calls []struct { + Name string + Opts v1.GetOptions + } + lockCisConfigInterfaceMockGet.RLock() + calls = mock.calls.Get + lockCisConfigInterfaceMockGet.RUnlock() + return calls +} + +// GetNamespaced calls GetNamespacedFunc. +func (mock *CisConfigInterfaceMock) GetNamespaced(namespace string, name string, opts v1.GetOptions) (*v3.CisConfig, error) { + if mock.GetNamespacedFunc == nil { + panic("CisConfigInterfaceMock.GetNamespacedFunc: method is nil but CisConfigInterface.GetNamespaced was just called") + } + callInfo := struct { + Namespace string + Name string + Opts v1.GetOptions + }{ + Namespace: namespace, + Name: name, + Opts: opts, + } + lockCisConfigInterfaceMockGetNamespaced.Lock() + mock.calls.GetNamespaced = append(mock.calls.GetNamespaced, callInfo) + lockCisConfigInterfaceMockGetNamespaced.Unlock() + return mock.GetNamespacedFunc(namespace, name, opts) +} + +// GetNamespacedCalls gets all the calls that were made to GetNamespaced. +// Check the length with: +// len(mockedCisConfigInterface.GetNamespacedCalls()) +func (mock *CisConfigInterfaceMock) GetNamespacedCalls() []struct { + Namespace string + Name string + Opts v1.GetOptions +} { + var calls []struct { + Namespace string + Name string + Opts v1.GetOptions + } + lockCisConfigInterfaceMockGetNamespaced.RLock() + calls = mock.calls.GetNamespaced + lockCisConfigInterfaceMockGetNamespaced.RUnlock() + return calls +} + +// List calls ListFunc. +func (mock *CisConfigInterfaceMock) List(opts v1.ListOptions) (*v3.CisConfigList, error) { + if mock.ListFunc == nil { + panic("CisConfigInterfaceMock.ListFunc: method is nil but CisConfigInterface.List was just called") + } + callInfo := struct { + Opts v1.ListOptions + }{ + Opts: opts, + } + lockCisConfigInterfaceMockList.Lock() + mock.calls.List = append(mock.calls.List, callInfo) + lockCisConfigInterfaceMockList.Unlock() + return mock.ListFunc(opts) +} + +// ListCalls gets all the calls that were made to List. +// Check the length with: +// len(mockedCisConfigInterface.ListCalls()) +func (mock *CisConfigInterfaceMock) ListCalls() []struct { + Opts v1.ListOptions +} { + var calls []struct { + Opts v1.ListOptions + } + lockCisConfigInterfaceMockList.RLock() + calls = mock.calls.List + lockCisConfigInterfaceMockList.RUnlock() + return calls +} + +// ListNamespaced calls ListNamespacedFunc. +func (mock *CisConfigInterfaceMock) ListNamespaced(namespace string, opts v1.ListOptions) (*v3.CisConfigList, error) { + if mock.ListNamespacedFunc == nil { + panic("CisConfigInterfaceMock.ListNamespacedFunc: method is nil but CisConfigInterface.ListNamespaced was just called") + } + callInfo := struct { + Namespace string + Opts v1.ListOptions + }{ + Namespace: namespace, + Opts: opts, + } + lockCisConfigInterfaceMockListNamespaced.Lock() + mock.calls.ListNamespaced = append(mock.calls.ListNamespaced, callInfo) + lockCisConfigInterfaceMockListNamespaced.Unlock() + return mock.ListNamespacedFunc(namespace, opts) +} + +// ListNamespacedCalls gets all the calls that were made to ListNamespaced. +// Check the length with: +// len(mockedCisConfigInterface.ListNamespacedCalls()) +func (mock *CisConfigInterfaceMock) ListNamespacedCalls() []struct { + Namespace string + Opts v1.ListOptions +} { + var calls []struct { + Namespace string + Opts v1.ListOptions + } + lockCisConfigInterfaceMockListNamespaced.RLock() + calls = mock.calls.ListNamespaced + lockCisConfigInterfaceMockListNamespaced.RUnlock() + return calls +} + +// ObjectClient calls ObjectClientFunc. +func (mock *CisConfigInterfaceMock) ObjectClient() *objectclient.ObjectClient { + if mock.ObjectClientFunc == nil { + panic("CisConfigInterfaceMock.ObjectClientFunc: method is nil but CisConfigInterface.ObjectClient was just called") + } + callInfo := struct { + }{} + lockCisConfigInterfaceMockObjectClient.Lock() + mock.calls.ObjectClient = append(mock.calls.ObjectClient, callInfo) + lockCisConfigInterfaceMockObjectClient.Unlock() + return mock.ObjectClientFunc() +} + +// ObjectClientCalls gets all the calls that were made to ObjectClient. +// Check the length with: +// len(mockedCisConfigInterface.ObjectClientCalls()) +func (mock *CisConfigInterfaceMock) ObjectClientCalls() []struct { +} { + var calls []struct { + } + lockCisConfigInterfaceMockObjectClient.RLock() + calls = mock.calls.ObjectClient + lockCisConfigInterfaceMockObjectClient.RUnlock() + return calls +} + +// Update calls UpdateFunc. +func (mock *CisConfigInterfaceMock) Update(in1 *v3.CisConfig) (*v3.CisConfig, error) { + if mock.UpdateFunc == nil { + panic("CisConfigInterfaceMock.UpdateFunc: method is nil but CisConfigInterface.Update was just called") + } + callInfo := struct { + In1 *v3.CisConfig + }{ + In1: in1, + } + lockCisConfigInterfaceMockUpdate.Lock() + mock.calls.Update = append(mock.calls.Update, callInfo) + lockCisConfigInterfaceMockUpdate.Unlock() + return mock.UpdateFunc(in1) +} + +// UpdateCalls gets all the calls that were made to Update. +// Check the length with: +// len(mockedCisConfigInterface.UpdateCalls()) +func (mock *CisConfigInterfaceMock) UpdateCalls() []struct { + In1 *v3.CisConfig +} { + var calls []struct { + In1 *v3.CisConfig + } + lockCisConfigInterfaceMockUpdate.RLock() + calls = mock.calls.Update + lockCisConfigInterfaceMockUpdate.RUnlock() + return calls +} + +// Watch calls WatchFunc. +func (mock *CisConfigInterfaceMock) Watch(opts v1.ListOptions) (watch.Interface, error) { + if mock.WatchFunc == nil { + panic("CisConfigInterfaceMock.WatchFunc: method is nil but CisConfigInterface.Watch was just called") + } + callInfo := struct { + Opts v1.ListOptions + }{ + Opts: opts, + } + lockCisConfigInterfaceMockWatch.Lock() + mock.calls.Watch = append(mock.calls.Watch, callInfo) + lockCisConfigInterfaceMockWatch.Unlock() + return mock.WatchFunc(opts) +} + +// WatchCalls gets all the calls that were made to Watch. +// Check the length with: +// len(mockedCisConfigInterface.WatchCalls()) +func (mock *CisConfigInterfaceMock) WatchCalls() []struct { + Opts v1.ListOptions +} { + var calls []struct { + Opts v1.ListOptions + } + lockCisConfigInterfaceMockWatch.RLock() + calls = mock.calls.Watch + lockCisConfigInterfaceMockWatch.RUnlock() + return calls +} + +var ( + lockCisConfigsGetterMockCisConfigs sync.RWMutex +) + +// Ensure, that CisConfigsGetterMock does implement CisConfigsGetter. +// If this is not the case, regenerate this file with moq. +var _ v3.CisConfigsGetter = &CisConfigsGetterMock{} + +// CisConfigsGetterMock is a mock implementation of CisConfigsGetter. +// +// func TestSomethingThatUsesCisConfigsGetter(t *testing.T) { +// +// // make and configure a mocked CisConfigsGetter +// mockedCisConfigsGetter := &CisConfigsGetterMock{ +// CisConfigsFunc: func(namespace string) v3.CisConfigInterface { +// panic("mock out the CisConfigs method") +// }, +// } +// +// // use mockedCisConfigsGetter in code that requires CisConfigsGetter +// // and then make assertions. +// +// } +type CisConfigsGetterMock struct { + // CisConfigsFunc mocks the CisConfigs method. + CisConfigsFunc func(namespace string) v3.CisConfigInterface + + // calls tracks calls to the methods. + calls struct { + // CisConfigs holds details about calls to the CisConfigs method. + CisConfigs []struct { + // Namespace is the namespace argument value. + Namespace string + } + } +} + +// CisConfigs calls CisConfigsFunc. +func (mock *CisConfigsGetterMock) CisConfigs(namespace string) v3.CisConfigInterface { + if mock.CisConfigsFunc == nil { + panic("CisConfigsGetterMock.CisConfigsFunc: method is nil but CisConfigsGetter.CisConfigs was just called") + } + callInfo := struct { + Namespace string + }{ + Namespace: namespace, + } + lockCisConfigsGetterMockCisConfigs.Lock() + mock.calls.CisConfigs = append(mock.calls.CisConfigs, callInfo) + lockCisConfigsGetterMockCisConfigs.Unlock() + return mock.CisConfigsFunc(namespace) +} + +// CisConfigsCalls gets all the calls that were made to CisConfigs. +// Check the length with: +// len(mockedCisConfigsGetter.CisConfigsCalls()) +func (mock *CisConfigsGetterMock) CisConfigsCalls() []struct { + Namespace string +} { + var calls []struct { + Namespace string + } + lockCisConfigsGetterMockCisConfigs.RLock() + calls = mock.calls.CisConfigs + lockCisConfigsGetterMockCisConfigs.RUnlock() + return calls +} diff --git a/apis/management.cattle.io/v3/zz_generated_cis_benchmark_version_controller.go b/apis/management.cattle.io/v3/zz_generated_cis_benchmark_version_controller.go new file mode 100644 index 00000000..ba4ac07c --- /dev/null +++ b/apis/management.cattle.io/v3/zz_generated_cis_benchmark_version_controller.go @@ -0,0 +1,509 @@ +package v3 + +import ( + "context" + + "github.com/rancher/norman/controller" + "github.com/rancher/norman/objectclient" + "github.com/rancher/norman/resource" + "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/tools/cache" +) + +var ( + CisBenchmarkVersionGroupVersionKind = schema.GroupVersionKind{ + Version: Version, + Group: GroupName, + Kind: "CisBenchmarkVersion", + } + CisBenchmarkVersionResource = metav1.APIResource{ + Name: "cisbenchmarkversions", + SingularName: "cisbenchmarkversion", + Namespaced: true, + + Kind: CisBenchmarkVersionGroupVersionKind.Kind, + } + + CisBenchmarkVersionGroupVersionResource = schema.GroupVersionResource{ + Group: GroupName, + Version: Version, + Resource: "cisbenchmarkversions", + } +) + +func init() { + resource.Put(CisBenchmarkVersionGroupVersionResource) +} + +func NewCisBenchmarkVersion(namespace, name string, obj CisBenchmarkVersion) *CisBenchmarkVersion { + obj.APIVersion, obj.Kind = CisBenchmarkVersionGroupVersionKind.ToAPIVersionAndKind() + obj.Name = name + obj.Namespace = namespace + return &obj +} + +type CisBenchmarkVersionList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []CisBenchmarkVersion `json:"items"` +} + +type CisBenchmarkVersionHandlerFunc func(key string, obj *CisBenchmarkVersion) (runtime.Object, error) + +type CisBenchmarkVersionChangeHandlerFunc func(obj *CisBenchmarkVersion) (runtime.Object, error) + +type CisBenchmarkVersionLister interface { + List(namespace string, selector labels.Selector) (ret []*CisBenchmarkVersion, err error) + Get(namespace, name string) (*CisBenchmarkVersion, error) +} + +type CisBenchmarkVersionController interface { + Generic() controller.GenericController + Informer() cache.SharedIndexInformer + Lister() CisBenchmarkVersionLister + AddHandler(ctx context.Context, name string, handler CisBenchmarkVersionHandlerFunc) + AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync CisBenchmarkVersionHandlerFunc) + AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler CisBenchmarkVersionHandlerFunc) + AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler CisBenchmarkVersionHandlerFunc) + Enqueue(namespace, name string) + Sync(ctx context.Context) error + Start(ctx context.Context, threadiness int) error +} + +type CisBenchmarkVersionInterface interface { + ObjectClient() *objectclient.ObjectClient + Create(*CisBenchmarkVersion) (*CisBenchmarkVersion, error) + GetNamespaced(namespace, name string, opts metav1.GetOptions) (*CisBenchmarkVersion, error) + Get(name string, opts metav1.GetOptions) (*CisBenchmarkVersion, error) + Update(*CisBenchmarkVersion) (*CisBenchmarkVersion, error) + Delete(name string, options *metav1.DeleteOptions) error + DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error + List(opts metav1.ListOptions) (*CisBenchmarkVersionList, error) + ListNamespaced(namespace string, opts metav1.ListOptions) (*CisBenchmarkVersionList, error) + Watch(opts metav1.ListOptions) (watch.Interface, error) + DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Controller() CisBenchmarkVersionController + AddHandler(ctx context.Context, name string, sync CisBenchmarkVersionHandlerFunc) + AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync CisBenchmarkVersionHandlerFunc) + AddLifecycle(ctx context.Context, name string, lifecycle CisBenchmarkVersionLifecycle) + AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle CisBenchmarkVersionLifecycle) + AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync CisBenchmarkVersionHandlerFunc) + AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync CisBenchmarkVersionHandlerFunc) + AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle CisBenchmarkVersionLifecycle) + AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle CisBenchmarkVersionLifecycle) +} + +type cisBenchmarkVersionLister struct { + controller *cisBenchmarkVersionController +} + +func (l *cisBenchmarkVersionLister) List(namespace string, selector labels.Selector) (ret []*CisBenchmarkVersion, err error) { + err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { + ret = append(ret, obj.(*CisBenchmarkVersion)) + }) + return +} + +func (l *cisBenchmarkVersionLister) Get(namespace, name string) (*CisBenchmarkVersion, error) { + var key string + if namespace != "" { + key = namespace + "/" + name + } else { + key = name + } + obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(schema.GroupResource{ + Group: CisBenchmarkVersionGroupVersionKind.Group, + Resource: "cisBenchmarkVersion", + }, key) + } + return obj.(*CisBenchmarkVersion), nil +} + +type cisBenchmarkVersionController struct { + controller.GenericController +} + +func (c *cisBenchmarkVersionController) Generic() controller.GenericController { + return c.GenericController +} + +func (c *cisBenchmarkVersionController) Lister() CisBenchmarkVersionLister { + return &cisBenchmarkVersionLister{ + controller: c, + } +} + +func (c *cisBenchmarkVersionController) AddHandler(ctx context.Context, name string, handler CisBenchmarkVersionHandlerFunc) { + c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { + if obj == nil { + return handler(key, nil) + } else if v, ok := obj.(*CisBenchmarkVersion); ok { + return handler(key, v) + } else { + return nil, nil + } + }) +} + +func (c *cisBenchmarkVersionController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler CisBenchmarkVersionHandlerFunc) { + 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.(*CisBenchmarkVersion); ok { + return handler(key, v) + } else { + return nil, nil + } + }) +} + +func (c *cisBenchmarkVersionController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler CisBenchmarkVersionHandlerFunc) { + c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { + if obj == nil { + return handler(key, nil) + } else if v, ok := obj.(*CisBenchmarkVersion); ok && controller.ObjectInCluster(cluster, obj) { + return handler(key, v) + } else { + return nil, nil + } + }) +} + +func (c *cisBenchmarkVersionController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler CisBenchmarkVersionHandlerFunc) { + 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.(*CisBenchmarkVersion); ok && controller.ObjectInCluster(cluster, obj) { + return handler(key, v) + } else { + return nil, nil + } + }) +} + +type cisBenchmarkVersionFactory struct { +} + +func (c cisBenchmarkVersionFactory) Object() runtime.Object { + return &CisBenchmarkVersion{} +} + +func (c cisBenchmarkVersionFactory) List() runtime.Object { + return &CisBenchmarkVersionList{} +} + +func (s *cisBenchmarkVersionClient) Controller() CisBenchmarkVersionController { + s.client.Lock() + defer s.client.Unlock() + + c, ok := s.client.cisBenchmarkVersionControllers[s.ns] + if ok { + return c + } + + genericController := controller.NewGenericController(CisBenchmarkVersionGroupVersionKind.Kind+"Controller", + s.objectClient) + + c = &cisBenchmarkVersionController{ + GenericController: genericController, + } + + s.client.cisBenchmarkVersionControllers[s.ns] = c + s.client.starters = append(s.client.starters, c) + + return c +} + +type cisBenchmarkVersionClient struct { + client *Client + ns string + objectClient *objectclient.ObjectClient + controller CisBenchmarkVersionController +} + +func (s *cisBenchmarkVersionClient) ObjectClient() *objectclient.ObjectClient { + return s.objectClient +} + +func (s *cisBenchmarkVersionClient) Create(o *CisBenchmarkVersion) (*CisBenchmarkVersion, error) { + obj, err := s.objectClient.Create(o) + return obj.(*CisBenchmarkVersion), err +} + +func (s *cisBenchmarkVersionClient) Get(name string, opts metav1.GetOptions) (*CisBenchmarkVersion, error) { + obj, err := s.objectClient.Get(name, opts) + return obj.(*CisBenchmarkVersion), err +} + +func (s *cisBenchmarkVersionClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*CisBenchmarkVersion, error) { + obj, err := s.objectClient.GetNamespaced(namespace, name, opts) + return obj.(*CisBenchmarkVersion), err +} + +func (s *cisBenchmarkVersionClient) Update(o *CisBenchmarkVersion) (*CisBenchmarkVersion, error) { + obj, err := s.objectClient.Update(o.Name, o) + return obj.(*CisBenchmarkVersion), err +} + +func (s *cisBenchmarkVersionClient) Delete(name string, options *metav1.DeleteOptions) error { + return s.objectClient.Delete(name, options) +} + +func (s *cisBenchmarkVersionClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { + return s.objectClient.DeleteNamespaced(namespace, name, options) +} + +func (s *cisBenchmarkVersionClient) List(opts metav1.ListOptions) (*CisBenchmarkVersionList, error) { + obj, err := s.objectClient.List(opts) + return obj.(*CisBenchmarkVersionList), err +} + +func (s *cisBenchmarkVersionClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*CisBenchmarkVersionList, error) { + obj, err := s.objectClient.ListNamespaced(namespace, opts) + return obj.(*CisBenchmarkVersionList), err +} + +func (s *cisBenchmarkVersionClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { + return s.objectClient.Watch(opts) +} + +// Patch applies the patch and returns the patched deployment. +func (s *cisBenchmarkVersionClient) Patch(o *CisBenchmarkVersion, patchType types.PatchType, data []byte, subresources ...string) (*CisBenchmarkVersion, error) { + obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) + return obj.(*CisBenchmarkVersion), err +} + +func (s *cisBenchmarkVersionClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return s.objectClient.DeleteCollection(deleteOpts, listOpts) +} + +func (s *cisBenchmarkVersionClient) AddHandler(ctx context.Context, name string, sync CisBenchmarkVersionHandlerFunc) { + s.Controller().AddHandler(ctx, name, sync) +} + +func (s *cisBenchmarkVersionClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync CisBenchmarkVersionHandlerFunc) { + s.Controller().AddFeatureHandler(ctx, enabled, name, sync) +} + +func (s *cisBenchmarkVersionClient) AddLifecycle(ctx context.Context, name string, lifecycle CisBenchmarkVersionLifecycle) { + sync := NewCisBenchmarkVersionLifecycleAdapter(name, false, s, lifecycle) + s.Controller().AddHandler(ctx, name, sync) +} + +func (s *cisBenchmarkVersionClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle CisBenchmarkVersionLifecycle) { + sync := NewCisBenchmarkVersionLifecycleAdapter(name, false, s, lifecycle) + s.Controller().AddFeatureHandler(ctx, enabled, name, sync) +} + +func (s *cisBenchmarkVersionClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync CisBenchmarkVersionHandlerFunc) { + s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) +} + +func (s *cisBenchmarkVersionClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync CisBenchmarkVersionHandlerFunc) { + s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) +} + +func (s *cisBenchmarkVersionClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle CisBenchmarkVersionLifecycle) { + sync := NewCisBenchmarkVersionLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) + s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) +} + +func (s *cisBenchmarkVersionClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle CisBenchmarkVersionLifecycle) { + sync := NewCisBenchmarkVersionLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) + s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) +} + +type CisBenchmarkVersionIndexer func(obj *CisBenchmarkVersion) ([]string, error) + +type CisBenchmarkVersionClientCache interface { + Get(namespace, name string) (*CisBenchmarkVersion, error) + List(namespace string, selector labels.Selector) ([]*CisBenchmarkVersion, error) + + Index(name string, indexer CisBenchmarkVersionIndexer) + GetIndexed(name, key string) ([]*CisBenchmarkVersion, error) +} + +type CisBenchmarkVersionClient interface { + Create(*CisBenchmarkVersion) (*CisBenchmarkVersion, error) + Get(namespace, name string, opts metav1.GetOptions) (*CisBenchmarkVersion, error) + Update(*CisBenchmarkVersion) (*CisBenchmarkVersion, error) + Delete(namespace, name string, options *metav1.DeleteOptions) error + List(namespace string, opts metav1.ListOptions) (*CisBenchmarkVersionList, error) + Watch(opts metav1.ListOptions) (watch.Interface, error) + + Cache() CisBenchmarkVersionClientCache + + OnCreate(ctx context.Context, name string, sync CisBenchmarkVersionChangeHandlerFunc) + OnChange(ctx context.Context, name string, sync CisBenchmarkVersionChangeHandlerFunc) + OnRemove(ctx context.Context, name string, sync CisBenchmarkVersionChangeHandlerFunc) + Enqueue(namespace, name string) + + Generic() controller.GenericController + ObjectClient() *objectclient.ObjectClient + Interface() CisBenchmarkVersionInterface +} + +type cisBenchmarkVersionClientCache struct { + client *cisBenchmarkVersionClient2 +} + +type cisBenchmarkVersionClient2 struct { + iface CisBenchmarkVersionInterface + controller CisBenchmarkVersionController +} + +func (n *cisBenchmarkVersionClient2) Interface() CisBenchmarkVersionInterface { + return n.iface +} + +func (n *cisBenchmarkVersionClient2) Generic() controller.GenericController { + return n.iface.Controller().Generic() +} + +func (n *cisBenchmarkVersionClient2) ObjectClient() *objectclient.ObjectClient { + return n.Interface().ObjectClient() +} + +func (n *cisBenchmarkVersionClient2) Enqueue(namespace, name string) { + n.iface.Controller().Enqueue(namespace, name) +} + +func (n *cisBenchmarkVersionClient2) Create(obj *CisBenchmarkVersion) (*CisBenchmarkVersion, error) { + return n.iface.Create(obj) +} + +func (n *cisBenchmarkVersionClient2) Get(namespace, name string, opts metav1.GetOptions) (*CisBenchmarkVersion, error) { + return n.iface.GetNamespaced(namespace, name, opts) +} + +func (n *cisBenchmarkVersionClient2) Update(obj *CisBenchmarkVersion) (*CisBenchmarkVersion, error) { + return n.iface.Update(obj) +} + +func (n *cisBenchmarkVersionClient2) Delete(namespace, name string, options *metav1.DeleteOptions) error { + return n.iface.DeleteNamespaced(namespace, name, options) +} + +func (n *cisBenchmarkVersionClient2) List(namespace string, opts metav1.ListOptions) (*CisBenchmarkVersionList, error) { + return n.iface.List(opts) +} + +func (n *cisBenchmarkVersionClient2) Watch(opts metav1.ListOptions) (watch.Interface, error) { + return n.iface.Watch(opts) +} + +func (n *cisBenchmarkVersionClientCache) Get(namespace, name string) (*CisBenchmarkVersion, error) { + return n.client.controller.Lister().Get(namespace, name) +} + +func (n *cisBenchmarkVersionClientCache) List(namespace string, selector labels.Selector) ([]*CisBenchmarkVersion, error) { + return n.client.controller.Lister().List(namespace, selector) +} + +func (n *cisBenchmarkVersionClient2) Cache() CisBenchmarkVersionClientCache { + n.loadController() + return &cisBenchmarkVersionClientCache{ + client: n, + } +} + +func (n *cisBenchmarkVersionClient2) OnCreate(ctx context.Context, name string, sync CisBenchmarkVersionChangeHandlerFunc) { + n.loadController() + n.iface.AddLifecycle(ctx, name+"-create", &cisBenchmarkVersionLifecycleDelegate{create: sync}) +} + +func (n *cisBenchmarkVersionClient2) OnChange(ctx context.Context, name string, sync CisBenchmarkVersionChangeHandlerFunc) { + n.loadController() + n.iface.AddLifecycle(ctx, name+"-change", &cisBenchmarkVersionLifecycleDelegate{update: sync}) +} + +func (n *cisBenchmarkVersionClient2) OnRemove(ctx context.Context, name string, sync CisBenchmarkVersionChangeHandlerFunc) { + n.loadController() + n.iface.AddLifecycle(ctx, name, &cisBenchmarkVersionLifecycleDelegate{remove: sync}) +} + +func (n *cisBenchmarkVersionClientCache) Index(name string, indexer CisBenchmarkVersionIndexer) { + err := n.client.controller.Informer().GetIndexer().AddIndexers(map[string]cache.IndexFunc{ + name: func(obj interface{}) ([]string, error) { + if v, ok := obj.(*CisBenchmarkVersion); ok { + return indexer(v) + } + return nil, nil + }, + }) + + if err != nil { + panic(err) + } +} + +func (n *cisBenchmarkVersionClientCache) GetIndexed(name, key string) ([]*CisBenchmarkVersion, error) { + var result []*CisBenchmarkVersion + objs, err := n.client.controller.Informer().GetIndexer().ByIndex(name, key) + if err != nil { + return nil, err + } + for _, obj := range objs { + if v, ok := obj.(*CisBenchmarkVersion); ok { + result = append(result, v) + } + } + + return result, nil +} + +func (n *cisBenchmarkVersionClient2) loadController() { + if n.controller == nil { + n.controller = n.iface.Controller() + } +} + +type cisBenchmarkVersionLifecycleDelegate struct { + create CisBenchmarkVersionChangeHandlerFunc + update CisBenchmarkVersionChangeHandlerFunc + remove CisBenchmarkVersionChangeHandlerFunc +} + +func (n *cisBenchmarkVersionLifecycleDelegate) HasCreate() bool { + return n.create != nil +} + +func (n *cisBenchmarkVersionLifecycleDelegate) Create(obj *CisBenchmarkVersion) (runtime.Object, error) { + if n.create == nil { + return obj, nil + } + return n.create(obj) +} + +func (n *cisBenchmarkVersionLifecycleDelegate) HasFinalize() bool { + return n.remove != nil +} + +func (n *cisBenchmarkVersionLifecycleDelegate) Remove(obj *CisBenchmarkVersion) (runtime.Object, error) { + if n.remove == nil { + return obj, nil + } + return n.remove(obj) +} + +func (n *cisBenchmarkVersionLifecycleDelegate) Updated(obj *CisBenchmarkVersion) (runtime.Object, error) { + if n.update == nil { + return obj, nil + } + return n.update(obj) +} diff --git a/apis/management.cattle.io/v3/zz_generated_cis_benchmark_version_lifecycle_adapter.go b/apis/management.cattle.io/v3/zz_generated_cis_benchmark_version_lifecycle_adapter.go new file mode 100644 index 00000000..01c5d293 --- /dev/null +++ b/apis/management.cattle.io/v3/zz_generated_cis_benchmark_version_lifecycle_adapter.go @@ -0,0 +1,66 @@ +package v3 + +import ( + "github.com/rancher/norman/lifecycle" + "github.com/rancher/norman/resource" + "k8s.io/apimachinery/pkg/runtime" +) + +type CisBenchmarkVersionLifecycle interface { + Create(obj *CisBenchmarkVersion) (runtime.Object, error) + Remove(obj *CisBenchmarkVersion) (runtime.Object, error) + Updated(obj *CisBenchmarkVersion) (runtime.Object, error) +} + +type cisBenchmarkVersionLifecycleAdapter struct { + lifecycle CisBenchmarkVersionLifecycle +} + +func (w *cisBenchmarkVersionLifecycleAdapter) HasCreate() bool { + o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) + return !ok || o.HasCreate() +} + +func (w *cisBenchmarkVersionLifecycleAdapter) HasFinalize() bool { + o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) + return !ok || o.HasFinalize() +} + +func (w *cisBenchmarkVersionLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { + o, err := w.lifecycle.Create(obj.(*CisBenchmarkVersion)) + if o == nil { + return nil, err + } + return o, err +} + +func (w *cisBenchmarkVersionLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { + o, err := w.lifecycle.Remove(obj.(*CisBenchmarkVersion)) + if o == nil { + return nil, err + } + return o, err +} + +func (w *cisBenchmarkVersionLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { + o, err := w.lifecycle.Updated(obj.(*CisBenchmarkVersion)) + if o == nil { + return nil, err + } + return o, err +} + +func NewCisBenchmarkVersionLifecycleAdapter(name string, clusterScoped bool, client CisBenchmarkVersionInterface, l CisBenchmarkVersionLifecycle) CisBenchmarkVersionHandlerFunc { + if clusterScoped { + resource.PutClusterScoped(CisBenchmarkVersionGroupVersionResource) + } + adapter := &cisBenchmarkVersionLifecycleAdapter{lifecycle: l} + syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) + return func(key string, obj *CisBenchmarkVersion) (runtime.Object, error) { + newObj, err := syncFn(key, obj) + if o, ok := newObj.(runtime.Object); ok { + return o, err + } + return nil, err + } +} diff --git a/apis/management.cattle.io/v3/zz_generated_cis_config_controller.go b/apis/management.cattle.io/v3/zz_generated_cis_config_controller.go new file mode 100644 index 00000000..29d17242 --- /dev/null +++ b/apis/management.cattle.io/v3/zz_generated_cis_config_controller.go @@ -0,0 +1,509 @@ +package v3 + +import ( + "context" + + "github.com/rancher/norman/controller" + "github.com/rancher/norman/objectclient" + "github.com/rancher/norman/resource" + "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/tools/cache" +) + +var ( + CisConfigGroupVersionKind = schema.GroupVersionKind{ + Version: Version, + Group: GroupName, + Kind: "CisConfig", + } + CisConfigResource = metav1.APIResource{ + Name: "cisconfigs", + SingularName: "cisconfig", + Namespaced: true, + + Kind: CisConfigGroupVersionKind.Kind, + } + + CisConfigGroupVersionResource = schema.GroupVersionResource{ + Group: GroupName, + Version: Version, + Resource: "cisconfigs", + } +) + +func init() { + resource.Put(CisConfigGroupVersionResource) +} + +func NewCisConfig(namespace, name string, obj CisConfig) *CisConfig { + obj.APIVersion, obj.Kind = CisConfigGroupVersionKind.ToAPIVersionAndKind() + obj.Name = name + obj.Namespace = namespace + return &obj +} + +type CisConfigList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []CisConfig `json:"items"` +} + +type CisConfigHandlerFunc func(key string, obj *CisConfig) (runtime.Object, error) + +type CisConfigChangeHandlerFunc func(obj *CisConfig) (runtime.Object, error) + +type CisConfigLister interface { + List(namespace string, selector labels.Selector) (ret []*CisConfig, err error) + Get(namespace, name string) (*CisConfig, error) +} + +type CisConfigController interface { + Generic() controller.GenericController + Informer() cache.SharedIndexInformer + Lister() CisConfigLister + AddHandler(ctx context.Context, name string, handler CisConfigHandlerFunc) + AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync CisConfigHandlerFunc) + AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler CisConfigHandlerFunc) + AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler CisConfigHandlerFunc) + Enqueue(namespace, name string) + Sync(ctx context.Context) error + Start(ctx context.Context, threadiness int) error +} + +type CisConfigInterface interface { + ObjectClient() *objectclient.ObjectClient + Create(*CisConfig) (*CisConfig, error) + GetNamespaced(namespace, name string, opts metav1.GetOptions) (*CisConfig, error) + Get(name string, opts metav1.GetOptions) (*CisConfig, error) + Update(*CisConfig) (*CisConfig, error) + Delete(name string, options *metav1.DeleteOptions) error + DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error + List(opts metav1.ListOptions) (*CisConfigList, error) + ListNamespaced(namespace string, opts metav1.ListOptions) (*CisConfigList, error) + Watch(opts metav1.ListOptions) (watch.Interface, error) + DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Controller() CisConfigController + AddHandler(ctx context.Context, name string, sync CisConfigHandlerFunc) + AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync CisConfigHandlerFunc) + AddLifecycle(ctx context.Context, name string, lifecycle CisConfigLifecycle) + AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle CisConfigLifecycle) + AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync CisConfigHandlerFunc) + AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync CisConfigHandlerFunc) + AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle CisConfigLifecycle) + AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle CisConfigLifecycle) +} + +type cisConfigLister struct { + controller *cisConfigController +} + +func (l *cisConfigLister) List(namespace string, selector labels.Selector) (ret []*CisConfig, err error) { + err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { + ret = append(ret, obj.(*CisConfig)) + }) + return +} + +func (l *cisConfigLister) Get(namespace, name string) (*CisConfig, error) { + var key string + if namespace != "" { + key = namespace + "/" + name + } else { + key = name + } + obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(schema.GroupResource{ + Group: CisConfigGroupVersionKind.Group, + Resource: "cisConfig", + }, key) + } + return obj.(*CisConfig), nil +} + +type cisConfigController struct { + controller.GenericController +} + +func (c *cisConfigController) Generic() controller.GenericController { + return c.GenericController +} + +func (c *cisConfigController) Lister() CisConfigLister { + return &cisConfigLister{ + controller: c, + } +} + +func (c *cisConfigController) AddHandler(ctx context.Context, name string, handler CisConfigHandlerFunc) { + c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { + if obj == nil { + return handler(key, nil) + } else if v, ok := obj.(*CisConfig); ok { + return handler(key, v) + } else { + return nil, nil + } + }) +} + +func (c *cisConfigController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler CisConfigHandlerFunc) { + 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.(*CisConfig); ok { + return handler(key, v) + } else { + return nil, nil + } + }) +} + +func (c *cisConfigController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler CisConfigHandlerFunc) { + c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { + if obj == nil { + return handler(key, nil) + } else if v, ok := obj.(*CisConfig); ok && controller.ObjectInCluster(cluster, obj) { + return handler(key, v) + } else { + return nil, nil + } + }) +} + +func (c *cisConfigController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler CisConfigHandlerFunc) { + 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.(*CisConfig); ok && controller.ObjectInCluster(cluster, obj) { + return handler(key, v) + } else { + return nil, nil + } + }) +} + +type cisConfigFactory struct { +} + +func (c cisConfigFactory) Object() runtime.Object { + return &CisConfig{} +} + +func (c cisConfigFactory) List() runtime.Object { + return &CisConfigList{} +} + +func (s *cisConfigClient) Controller() CisConfigController { + s.client.Lock() + defer s.client.Unlock() + + c, ok := s.client.cisConfigControllers[s.ns] + if ok { + return c + } + + genericController := controller.NewGenericController(CisConfigGroupVersionKind.Kind+"Controller", + s.objectClient) + + c = &cisConfigController{ + GenericController: genericController, + } + + s.client.cisConfigControllers[s.ns] = c + s.client.starters = append(s.client.starters, c) + + return c +} + +type cisConfigClient struct { + client *Client + ns string + objectClient *objectclient.ObjectClient + controller CisConfigController +} + +func (s *cisConfigClient) ObjectClient() *objectclient.ObjectClient { + return s.objectClient +} + +func (s *cisConfigClient) Create(o *CisConfig) (*CisConfig, error) { + obj, err := s.objectClient.Create(o) + return obj.(*CisConfig), err +} + +func (s *cisConfigClient) Get(name string, opts metav1.GetOptions) (*CisConfig, error) { + obj, err := s.objectClient.Get(name, opts) + return obj.(*CisConfig), err +} + +func (s *cisConfigClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*CisConfig, error) { + obj, err := s.objectClient.GetNamespaced(namespace, name, opts) + return obj.(*CisConfig), err +} + +func (s *cisConfigClient) Update(o *CisConfig) (*CisConfig, error) { + obj, err := s.objectClient.Update(o.Name, o) + return obj.(*CisConfig), err +} + +func (s *cisConfigClient) Delete(name string, options *metav1.DeleteOptions) error { + return s.objectClient.Delete(name, options) +} + +func (s *cisConfigClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { + return s.objectClient.DeleteNamespaced(namespace, name, options) +} + +func (s *cisConfigClient) List(opts metav1.ListOptions) (*CisConfigList, error) { + obj, err := s.objectClient.List(opts) + return obj.(*CisConfigList), err +} + +func (s *cisConfigClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*CisConfigList, error) { + obj, err := s.objectClient.ListNamespaced(namespace, opts) + return obj.(*CisConfigList), err +} + +func (s *cisConfigClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { + return s.objectClient.Watch(opts) +} + +// Patch applies the patch and returns the patched deployment. +func (s *cisConfigClient) Patch(o *CisConfig, patchType types.PatchType, data []byte, subresources ...string) (*CisConfig, error) { + obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) + return obj.(*CisConfig), err +} + +func (s *cisConfigClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return s.objectClient.DeleteCollection(deleteOpts, listOpts) +} + +func (s *cisConfigClient) AddHandler(ctx context.Context, name string, sync CisConfigHandlerFunc) { + s.Controller().AddHandler(ctx, name, sync) +} + +func (s *cisConfigClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync CisConfigHandlerFunc) { + s.Controller().AddFeatureHandler(ctx, enabled, name, sync) +} + +func (s *cisConfigClient) AddLifecycle(ctx context.Context, name string, lifecycle CisConfigLifecycle) { + sync := NewCisConfigLifecycleAdapter(name, false, s, lifecycle) + s.Controller().AddHandler(ctx, name, sync) +} + +func (s *cisConfigClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle CisConfigLifecycle) { + sync := NewCisConfigLifecycleAdapter(name, false, s, lifecycle) + s.Controller().AddFeatureHandler(ctx, enabled, name, sync) +} + +func (s *cisConfigClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync CisConfigHandlerFunc) { + s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) +} + +func (s *cisConfigClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync CisConfigHandlerFunc) { + s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) +} + +func (s *cisConfigClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle CisConfigLifecycle) { + sync := NewCisConfigLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) + s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) +} + +func (s *cisConfigClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle CisConfigLifecycle) { + sync := NewCisConfigLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) + s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) +} + +type CisConfigIndexer func(obj *CisConfig) ([]string, error) + +type CisConfigClientCache interface { + Get(namespace, name string) (*CisConfig, error) + List(namespace string, selector labels.Selector) ([]*CisConfig, error) + + Index(name string, indexer CisConfigIndexer) + GetIndexed(name, key string) ([]*CisConfig, error) +} + +type CisConfigClient interface { + Create(*CisConfig) (*CisConfig, error) + Get(namespace, name string, opts metav1.GetOptions) (*CisConfig, error) + Update(*CisConfig) (*CisConfig, error) + Delete(namespace, name string, options *metav1.DeleteOptions) error + List(namespace string, opts metav1.ListOptions) (*CisConfigList, error) + Watch(opts metav1.ListOptions) (watch.Interface, error) + + Cache() CisConfigClientCache + + OnCreate(ctx context.Context, name string, sync CisConfigChangeHandlerFunc) + OnChange(ctx context.Context, name string, sync CisConfigChangeHandlerFunc) + OnRemove(ctx context.Context, name string, sync CisConfigChangeHandlerFunc) + Enqueue(namespace, name string) + + Generic() controller.GenericController + ObjectClient() *objectclient.ObjectClient + Interface() CisConfigInterface +} + +type cisConfigClientCache struct { + client *cisConfigClient2 +} + +type cisConfigClient2 struct { + iface CisConfigInterface + controller CisConfigController +} + +func (n *cisConfigClient2) Interface() CisConfigInterface { + return n.iface +} + +func (n *cisConfigClient2) Generic() controller.GenericController { + return n.iface.Controller().Generic() +} + +func (n *cisConfigClient2) ObjectClient() *objectclient.ObjectClient { + return n.Interface().ObjectClient() +} + +func (n *cisConfigClient2) Enqueue(namespace, name string) { + n.iface.Controller().Enqueue(namespace, name) +} + +func (n *cisConfigClient2) Create(obj *CisConfig) (*CisConfig, error) { + return n.iface.Create(obj) +} + +func (n *cisConfigClient2) Get(namespace, name string, opts metav1.GetOptions) (*CisConfig, error) { + return n.iface.GetNamespaced(namespace, name, opts) +} + +func (n *cisConfigClient2) Update(obj *CisConfig) (*CisConfig, error) { + return n.iface.Update(obj) +} + +func (n *cisConfigClient2) Delete(namespace, name string, options *metav1.DeleteOptions) error { + return n.iface.DeleteNamespaced(namespace, name, options) +} + +func (n *cisConfigClient2) List(namespace string, opts metav1.ListOptions) (*CisConfigList, error) { + return n.iface.List(opts) +} + +func (n *cisConfigClient2) Watch(opts metav1.ListOptions) (watch.Interface, error) { + return n.iface.Watch(opts) +} + +func (n *cisConfigClientCache) Get(namespace, name string) (*CisConfig, error) { + return n.client.controller.Lister().Get(namespace, name) +} + +func (n *cisConfigClientCache) List(namespace string, selector labels.Selector) ([]*CisConfig, error) { + return n.client.controller.Lister().List(namespace, selector) +} + +func (n *cisConfigClient2) Cache() CisConfigClientCache { + n.loadController() + return &cisConfigClientCache{ + client: n, + } +} + +func (n *cisConfigClient2) OnCreate(ctx context.Context, name string, sync CisConfigChangeHandlerFunc) { + n.loadController() + n.iface.AddLifecycle(ctx, name+"-create", &cisConfigLifecycleDelegate{create: sync}) +} + +func (n *cisConfigClient2) OnChange(ctx context.Context, name string, sync CisConfigChangeHandlerFunc) { + n.loadController() + n.iface.AddLifecycle(ctx, name+"-change", &cisConfigLifecycleDelegate{update: sync}) +} + +func (n *cisConfigClient2) OnRemove(ctx context.Context, name string, sync CisConfigChangeHandlerFunc) { + n.loadController() + n.iface.AddLifecycle(ctx, name, &cisConfigLifecycleDelegate{remove: sync}) +} + +func (n *cisConfigClientCache) Index(name string, indexer CisConfigIndexer) { + err := n.client.controller.Informer().GetIndexer().AddIndexers(map[string]cache.IndexFunc{ + name: func(obj interface{}) ([]string, error) { + if v, ok := obj.(*CisConfig); ok { + return indexer(v) + } + return nil, nil + }, + }) + + if err != nil { + panic(err) + } +} + +func (n *cisConfigClientCache) GetIndexed(name, key string) ([]*CisConfig, error) { + var result []*CisConfig + objs, err := n.client.controller.Informer().GetIndexer().ByIndex(name, key) + if err != nil { + return nil, err + } + for _, obj := range objs { + if v, ok := obj.(*CisConfig); ok { + result = append(result, v) + } + } + + return result, nil +} + +func (n *cisConfigClient2) loadController() { + if n.controller == nil { + n.controller = n.iface.Controller() + } +} + +type cisConfigLifecycleDelegate struct { + create CisConfigChangeHandlerFunc + update CisConfigChangeHandlerFunc + remove CisConfigChangeHandlerFunc +} + +func (n *cisConfigLifecycleDelegate) HasCreate() bool { + return n.create != nil +} + +func (n *cisConfigLifecycleDelegate) Create(obj *CisConfig) (runtime.Object, error) { + if n.create == nil { + return obj, nil + } + return n.create(obj) +} + +func (n *cisConfigLifecycleDelegate) HasFinalize() bool { + return n.remove != nil +} + +func (n *cisConfigLifecycleDelegate) Remove(obj *CisConfig) (runtime.Object, error) { + if n.remove == nil { + return obj, nil + } + return n.remove(obj) +} + +func (n *cisConfigLifecycleDelegate) Updated(obj *CisConfig) (runtime.Object, error) { + if n.update == nil { + return obj, nil + } + return n.update(obj) +} diff --git a/apis/management.cattle.io/v3/zz_generated_cis_config_lifecycle_adapter.go b/apis/management.cattle.io/v3/zz_generated_cis_config_lifecycle_adapter.go new file mode 100644 index 00000000..08e8ae27 --- /dev/null +++ b/apis/management.cattle.io/v3/zz_generated_cis_config_lifecycle_adapter.go @@ -0,0 +1,66 @@ +package v3 + +import ( + "github.com/rancher/norman/lifecycle" + "github.com/rancher/norman/resource" + "k8s.io/apimachinery/pkg/runtime" +) + +type CisConfigLifecycle interface { + Create(obj *CisConfig) (runtime.Object, error) + Remove(obj *CisConfig) (runtime.Object, error) + Updated(obj *CisConfig) (runtime.Object, error) +} + +type cisConfigLifecycleAdapter struct { + lifecycle CisConfigLifecycle +} + +func (w *cisConfigLifecycleAdapter) HasCreate() bool { + o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) + return !ok || o.HasCreate() +} + +func (w *cisConfigLifecycleAdapter) HasFinalize() bool { + o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) + return !ok || o.HasFinalize() +} + +func (w *cisConfigLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { + o, err := w.lifecycle.Create(obj.(*CisConfig)) + if o == nil { + return nil, err + } + return o, err +} + +func (w *cisConfigLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { + o, err := w.lifecycle.Remove(obj.(*CisConfig)) + if o == nil { + return nil, err + } + return o, err +} + +func (w *cisConfigLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { + o, err := w.lifecycle.Updated(obj.(*CisConfig)) + if o == nil { + return nil, err + } + return o, err +} + +func NewCisConfigLifecycleAdapter(name string, clusterScoped bool, client CisConfigInterface, l CisConfigLifecycle) CisConfigHandlerFunc { + if clusterScoped { + resource.PutClusterScoped(CisConfigGroupVersionResource) + } + adapter := &cisConfigLifecycleAdapter{lifecycle: l} + syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) + return func(key string, obj *CisConfig) (runtime.Object, error) { + newObj, err := syncFn(key, obj) + if o, ok := newObj.(runtime.Object); ok { + return o, err + } + return nil, err + } +} diff --git a/apis/management.cattle.io/v3/zz_generated_deepcopy.go b/apis/management.cattle.io/v3/zz_generated_deepcopy.go index 9712cd63..439a61dc 100644 --- a/apis/management.cattle.io/v3/zz_generated_deepcopy.go +++ b/apis/management.cattle.io/v3/zz_generated_deepcopy.go @@ -924,6 +924,160 @@ func (in *ChangePasswordInput) DeepCopy() *ChangePasswordInput { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CisBenchmarkVersion) DeepCopyInto(out *CisBenchmarkVersion) { + *out = *in + out.Namespaced = in.Namespaced + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Info = in.Info + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CisBenchmarkVersion. +func (in *CisBenchmarkVersion) DeepCopy() *CisBenchmarkVersion { + if in == nil { + return nil + } + out := new(CisBenchmarkVersion) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *CisBenchmarkVersion) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CisBenchmarkVersionInfo) DeepCopyInto(out *CisBenchmarkVersionInfo) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CisBenchmarkVersionInfo. +func (in *CisBenchmarkVersionInfo) DeepCopy() *CisBenchmarkVersionInfo { + if in == nil { + return nil + } + out := new(CisBenchmarkVersionInfo) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CisBenchmarkVersionList) DeepCopyInto(out *CisBenchmarkVersionList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]CisBenchmarkVersion, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CisBenchmarkVersionList. +func (in *CisBenchmarkVersionList) DeepCopy() *CisBenchmarkVersionList { + if in == nil { + return nil + } + out := new(CisBenchmarkVersionList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *CisBenchmarkVersionList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CisConfig) DeepCopyInto(out *CisConfig) { + *out = *in + out.Namespaced = in.Namespaced + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Params = in.Params + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CisConfig. +func (in *CisConfig) DeepCopy() *CisConfig { + if in == nil { + return nil + } + out := new(CisConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *CisConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CisConfigList) DeepCopyInto(out *CisConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]CisConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CisConfigList. +func (in *CisConfigList) DeepCopy() *CisConfigList { + if in == nil { + return nil + } + out := new(CisConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *CisConfigList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CisConfigParams) DeepCopyInto(out *CisConfigParams) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CisConfigParams. +func (in *CisConfigParams) DeepCopy() *CisConfigParams { + if in == nil { + return nil + } + out := new(CisConfigParams) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CisScanConfig) DeepCopyInto(out *CisScanConfig) { *out = *in diff --git a/apis/management.cattle.io/v3/zz_generated_k8s_client.go b/apis/management.cattle.io/v3/zz_generated_k8s_client.go index bae1b2b0..f64e42c1 100644 --- a/apis/management.cattle.io/v3/zz_generated_k8s_client.go +++ b/apis/management.cattle.io/v3/zz_generated_k8s_client.go @@ -82,6 +82,8 @@ type Interface interface { RKEK8sSystemImagesGetter RKEK8sServiceOptionsGetter RKEAddonsGetter + CisConfigsGetter + CisBenchmarkVersionsGetter } type Clients struct { @@ -149,6 +151,8 @@ type Clients struct { RKEK8sSystemImage RKEK8sSystemImageClient RKEK8sServiceOption RKEK8sServiceOptionClient RKEAddon RKEAddonClient + CisConfig CisConfigClient + CisBenchmarkVersion CisBenchmarkVersionClient } type Client struct { @@ -218,6 +222,8 @@ type Client struct { rkeK8sSystemImageControllers map[string]RKEK8sSystemImageController rkeK8sServiceOptionControllers map[string]RKEK8sServiceOptionController rkeAddonControllers map[string]RKEAddonController + cisConfigControllers map[string]CisConfigController + cisBenchmarkVersionControllers map[string]CisBenchmarkVersionController } func Factory(ctx context.Context, config rest.Config) (context.Context, controller.Starter, error) { @@ -439,6 +445,12 @@ func NewClientsFromInterface(iface Interface) *Clients { RKEAddon: &rkeAddonClient2{ iface: iface.RKEAddons(""), }, + CisConfig: &cisConfigClient2{ + iface: iface.CisConfigs(""), + }, + CisBenchmarkVersion: &cisBenchmarkVersionClient2{ + iface: iface.CisBenchmarkVersions(""), + }, } } @@ -517,6 +529,8 @@ func NewForConfig(config rest.Config) (Interface, error) { rkeK8sSystemImageControllers: map[string]RKEK8sSystemImageController{}, rkeK8sServiceOptionControllers: map[string]RKEK8sServiceOptionController{}, rkeAddonControllers: map[string]RKEAddonController{}, + cisConfigControllers: map[string]CisConfigController{}, + cisBenchmarkVersionControllers: map[string]CisBenchmarkVersionController{}, }, nil } @@ -1337,3 +1351,29 @@ func (c *Client) RKEAddons(namespace string) RKEAddonInterface { objectClient: objectClient, } } + +type CisConfigsGetter interface { + CisConfigs(namespace string) CisConfigInterface +} + +func (c *Client) CisConfigs(namespace string) CisConfigInterface { + objectClient := objectclient.NewObjectClient(namespace, c.restClient, &CisConfigResource, CisConfigGroupVersionKind, cisConfigFactory{}) + return &cisConfigClient{ + ns: namespace, + client: c, + objectClient: objectClient, + } +} + +type CisBenchmarkVersionsGetter interface { + CisBenchmarkVersions(namespace string) CisBenchmarkVersionInterface +} + +func (c *Client) CisBenchmarkVersions(namespace string) CisBenchmarkVersionInterface { + objectClient := objectclient.NewObjectClient(namespace, c.restClient, &CisBenchmarkVersionResource, CisBenchmarkVersionGroupVersionKind, cisBenchmarkVersionFactory{}) + return &cisBenchmarkVersionClient{ + ns: namespace, + client: c, + objectClient: objectClient, + } +} diff --git a/apis/management.cattle.io/v3/zz_generated_scheme.go b/apis/management.cattle.io/v3/zz_generated_scheme.go index 801357bf..9bb65b88 100644 --- a/apis/management.cattle.io/v3/zz_generated_scheme.go +++ b/apis/management.cattle.io/v3/zz_generated_scheme.go @@ -157,6 +157,10 @@ func addKnownTypes(scheme *runtime.Scheme) error { &RKEK8sServiceOptionList{}, &RKEAddon{}, &RKEAddonList{}, + &CisConfig{}, + &CisConfigList{}, + &CisBenchmarkVersion{}, + &CisBenchmarkVersionList{}, ) metav1.AddToGroupVersion(scheme, SchemeGroupVersion) return nil diff --git a/client/management/v3/zz_generated_cis_benchmark_version.go b/client/management/v3/zz_generated_cis_benchmark_version.go new file mode 100644 index 00000000..17b1b390 --- /dev/null +++ b/client/management/v3/zz_generated_cis_benchmark_version.go @@ -0,0 +1,101 @@ +package client + +import ( + "github.com/rancher/norman/types" +) + +const ( + CisBenchmarkVersionType = "cisBenchmarkVersion" + CisBenchmarkVersionFieldAnnotations = "annotations" + CisBenchmarkVersionFieldCreated = "created" + CisBenchmarkVersionFieldCreatorID = "creatorId" + CisBenchmarkVersionFieldInfo = "info" + CisBenchmarkVersionFieldLabels = "labels" + CisBenchmarkVersionFieldName = "name" + CisBenchmarkVersionFieldOwnerReferences = "ownerReferences" + CisBenchmarkVersionFieldRemoved = "removed" + CisBenchmarkVersionFieldUUID = "uuid" +) + +type CisBenchmarkVersion struct { + types.Resource + Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` + Created string `json:"created,omitempty" yaml:"created,omitempty"` + CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` + Info *CisBenchmarkVersionInfo `json:"info,omitempty" yaml:"info,omitempty"` + Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` + Name string `json:"name,omitempty" yaml:"name,omitempty"` + OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type CisBenchmarkVersionCollection struct { + types.Collection + Data []CisBenchmarkVersion `json:"data,omitempty"` + client *CisBenchmarkVersionClient +} + +type CisBenchmarkVersionClient struct { + apiClient *Client +} + +type CisBenchmarkVersionOperations interface { + List(opts *types.ListOpts) (*CisBenchmarkVersionCollection, error) + Create(opts *CisBenchmarkVersion) (*CisBenchmarkVersion, error) + Update(existing *CisBenchmarkVersion, updates interface{}) (*CisBenchmarkVersion, error) + Replace(existing *CisBenchmarkVersion) (*CisBenchmarkVersion, error) + ByID(id string) (*CisBenchmarkVersion, error) + Delete(container *CisBenchmarkVersion) error +} + +func newCisBenchmarkVersionClient(apiClient *Client) *CisBenchmarkVersionClient { + return &CisBenchmarkVersionClient{ + apiClient: apiClient, + } +} + +func (c *CisBenchmarkVersionClient) Create(container *CisBenchmarkVersion) (*CisBenchmarkVersion, error) { + resp := &CisBenchmarkVersion{} + err := c.apiClient.Ops.DoCreate(CisBenchmarkVersionType, container, resp) + return resp, err +} + +func (c *CisBenchmarkVersionClient) Update(existing *CisBenchmarkVersion, updates interface{}) (*CisBenchmarkVersion, error) { + resp := &CisBenchmarkVersion{} + err := c.apiClient.Ops.DoUpdate(CisBenchmarkVersionType, &existing.Resource, updates, resp) + return resp, err +} + +func (c *CisBenchmarkVersionClient) Replace(obj *CisBenchmarkVersion) (*CisBenchmarkVersion, error) { + resp := &CisBenchmarkVersion{} + err := c.apiClient.Ops.DoReplace(CisBenchmarkVersionType, &obj.Resource, obj, resp) + return resp, err +} + +func (c *CisBenchmarkVersionClient) List(opts *types.ListOpts) (*CisBenchmarkVersionCollection, error) { + resp := &CisBenchmarkVersionCollection{} + err := c.apiClient.Ops.DoList(CisBenchmarkVersionType, opts, resp) + resp.client = c + return resp, err +} + +func (cc *CisBenchmarkVersionCollection) Next() (*CisBenchmarkVersionCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &CisBenchmarkVersionCollection{} + err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *CisBenchmarkVersionClient) ByID(id string) (*CisBenchmarkVersion, error) { + resp := &CisBenchmarkVersion{} + err := c.apiClient.Ops.DoByID(CisBenchmarkVersionType, id, resp) + return resp, err +} + +func (c *CisBenchmarkVersionClient) Delete(container *CisBenchmarkVersion) error { + return c.apiClient.Ops.DoResourceDelete(CisBenchmarkVersionType, &container.Resource) +} diff --git a/client/management/v3/zz_generated_cis_benchmark_version_info.go b/client/management/v3/zz_generated_cis_benchmark_version_info.go new file mode 100644 index 00000000..f6dda5b3 --- /dev/null +++ b/client/management/v3/zz_generated_cis_benchmark_version_info.go @@ -0,0 +1,10 @@ +package client + +const ( + CisBenchmarkVersionInfoType = "cisBenchmarkVersionInfo" + CisBenchmarkVersionInfoFieldMinKubernetesVersion = "minKubernetesVersion" +) + +type CisBenchmarkVersionInfo struct { + MinKubernetesVersion string `json:"minKubernetesVersion,omitempty" yaml:"minKubernetesVersion,omitempty"` +} diff --git a/client/management/v3/zz_generated_cis_config.go b/client/management/v3/zz_generated_cis_config.go new file mode 100644 index 00000000..5cb6b23e --- /dev/null +++ b/client/management/v3/zz_generated_cis_config.go @@ -0,0 +1,101 @@ +package client + +import ( + "github.com/rancher/norman/types" +) + +const ( + CisConfigType = "cisConfig" + CisConfigFieldAnnotations = "annotations" + CisConfigFieldCreated = "created" + CisConfigFieldCreatorID = "creatorId" + CisConfigFieldLabels = "labels" + CisConfigFieldName = "name" + CisConfigFieldOwnerReferences = "ownerReferences" + CisConfigFieldParams = "params" + CisConfigFieldRemoved = "removed" + CisConfigFieldUUID = "uuid" +) + +type CisConfig struct { + types.Resource + Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` + Created string `json:"created,omitempty" yaml:"created,omitempty"` + CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` + Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` + Name string `json:"name,omitempty" yaml:"name,omitempty"` + OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` + Params *CisConfigParams `json:"params,omitempty" yaml:"params,omitempty"` + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type CisConfigCollection struct { + types.Collection + Data []CisConfig `json:"data,omitempty"` + client *CisConfigClient +} + +type CisConfigClient struct { + apiClient *Client +} + +type CisConfigOperations interface { + List(opts *types.ListOpts) (*CisConfigCollection, error) + Create(opts *CisConfig) (*CisConfig, error) + Update(existing *CisConfig, updates interface{}) (*CisConfig, error) + Replace(existing *CisConfig) (*CisConfig, error) + ByID(id string) (*CisConfig, error) + Delete(container *CisConfig) error +} + +func newCisConfigClient(apiClient *Client) *CisConfigClient { + return &CisConfigClient{ + apiClient: apiClient, + } +} + +func (c *CisConfigClient) Create(container *CisConfig) (*CisConfig, error) { + resp := &CisConfig{} + err := c.apiClient.Ops.DoCreate(CisConfigType, container, resp) + return resp, err +} + +func (c *CisConfigClient) Update(existing *CisConfig, updates interface{}) (*CisConfig, error) { + resp := &CisConfig{} + err := c.apiClient.Ops.DoUpdate(CisConfigType, &existing.Resource, updates, resp) + return resp, err +} + +func (c *CisConfigClient) Replace(obj *CisConfig) (*CisConfig, error) { + resp := &CisConfig{} + err := c.apiClient.Ops.DoReplace(CisConfigType, &obj.Resource, obj, resp) + return resp, err +} + +func (c *CisConfigClient) List(opts *types.ListOpts) (*CisConfigCollection, error) { + resp := &CisConfigCollection{} + err := c.apiClient.Ops.DoList(CisConfigType, opts, resp) + resp.client = c + return resp, err +} + +func (cc *CisConfigCollection) Next() (*CisConfigCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &CisConfigCollection{} + err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *CisConfigClient) ByID(id string) (*CisConfig, error) { + resp := &CisConfig{} + err := c.apiClient.Ops.DoByID(CisConfigType, id, resp) + return resp, err +} + +func (c *CisConfigClient) Delete(container *CisConfig) error { + return c.apiClient.Ops.DoResourceDelete(CisConfigType, &container.Resource) +} diff --git a/client/management/v3/zz_generated_cis_config_params.go b/client/management/v3/zz_generated_cis_config_params.go new file mode 100644 index 00000000..df53f9ff --- /dev/null +++ b/client/management/v3/zz_generated_cis_config_params.go @@ -0,0 +1,10 @@ +package client + +const ( + CisConfigParamsType = "cisConfigParams" + CisConfigParamsFieldBenchmarkVersion = "benchmarkVersion" +) + +type CisConfigParams struct { + BenchmarkVersion string `json:"benchmarkVersion,omitempty" yaml:"benchmarkVersion,omitempty"` +} diff --git a/client/management/v3/zz_generated_client.go b/client/management/v3/zz_generated_client.go index 95362fe5..fafa2a35 100644 --- a/client/management/v3/zz_generated_client.go +++ b/client/management/v3/zz_generated_client.go @@ -69,6 +69,8 @@ type Client struct { RKEK8sSystemImage RKEK8sSystemImageOperations RKEK8sServiceOption RKEK8sServiceOptionOperations RKEAddon RKEAddonOperations + CisConfig CisConfigOperations + CisBenchmarkVersion CisBenchmarkVersionOperations } func NewClient(opts *clientbase.ClientOpts) (*Client, error) { @@ -143,6 +145,8 @@ func NewClient(opts *clientbase.ClientOpts) (*Client, error) { client.RKEK8sSystemImage = newRKEK8sSystemImageClient(client) client.RKEK8sServiceOption = newRKEK8sServiceOptionClient(client) client.RKEAddon = newRKEAddonClient(client) + client.CisConfig = newCisConfigClient(client) + client.CisBenchmarkVersion = newCisBenchmarkVersionClient(client) return client, nil } diff --git a/compose/zz_generated_compose.go b/compose/zz_generated_compose.go index 794445bb..751b28c6 100644 --- a/compose/zz_generated_compose.go +++ b/compose/zz_generated_compose.go @@ -68,6 +68,8 @@ type Config struct { RKEK8sSystemImages map[string]managementClient.RKEK8sSystemImage `json:"rkeK8sSystemImages,omitempty" yaml:"rkeK8sSystemImages,omitempty"` RKEK8sServiceOptions map[string]managementClient.RKEK8sServiceOption `json:"rkeK8sServiceOptions,omitempty" yaml:"rkeK8sServiceOptions,omitempty"` RKEAddons map[string]managementClient.RKEAddon `json:"rkeAddons,omitempty" yaml:"rkeAddons,omitempty"` + CisConfigs map[string]managementClient.CisConfig `json:"cisConfigs,omitempty" yaml:"cisConfigs,omitempty"` + CisBenchmarkVersions map[string]managementClient.CisBenchmarkVersion `json:"cisBenchmarkVersions,omitempty" yaml:"cisBenchmarkVersions,omitempty"` // Cluster Client Namespaces map[string]clusterClient.Namespace `json:"namespaces,omitempty" yaml:"namespaces,omitempty"`