diff --git a/apis/apiregistration.k8s.io/v1/fakes/zz_generated_api_service_mock.go b/apis/apiregistration.k8s.io/v1/fakes/zz_generated_api_service_mock.go new file mode 100644 index 00000000..b496d11a --- /dev/null +++ b/apis/apiregistration.k8s.io/v1/fakes/zz_generated_api_service_mock.go @@ -0,0 +1,1741 @@ +// 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" + v1a "github.com/rancher/types/apis/apiregistration.k8s.io/v1" + v1b "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" + v1 "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1" +) + +var ( + lockAPIServiceListerMockGet sync.RWMutex + lockAPIServiceListerMockList sync.RWMutex +) + +// Ensure, that APIServiceListerMock does implement APIServiceLister. +// If this is not the case, regenerate this file with moq. +var _ v1a.APIServiceLister = &APIServiceListerMock{} + +// APIServiceListerMock is a mock implementation of APIServiceLister. +// +// func TestSomethingThatUsesAPIServiceLister(t *testing.T) { +// +// // make and configure a mocked APIServiceLister +// mockedAPIServiceLister := &APIServiceListerMock{ +// GetFunc: func(namespace string, name string) (*v1.APIService, error) { +// panic("mock out the Get method") +// }, +// ListFunc: func(namespace string, selector labels.Selector) ([]*v1.APIService, error) { +// panic("mock out the List method") +// }, +// } +// +// // use mockedAPIServiceLister in code that requires APIServiceLister +// // and then make assertions. +// +// } +type APIServiceListerMock struct { + // GetFunc mocks the Get method. + GetFunc func(namespace string, name string) (*v1.APIService, error) + + // ListFunc mocks the List method. + ListFunc func(namespace string, selector labels.Selector) ([]*v1.APIService, 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 *APIServiceListerMock) Get(namespace string, name string) (*v1.APIService, error) { + if mock.GetFunc == nil { + panic("APIServiceListerMock.GetFunc: method is nil but APIServiceLister.Get was just called") + } + callInfo := struct { + Namespace string + Name string + }{ + Namespace: namespace, + Name: name, + } + lockAPIServiceListerMockGet.Lock() + mock.calls.Get = append(mock.calls.Get, callInfo) + lockAPIServiceListerMockGet.Unlock() + return mock.GetFunc(namespace, name) +} + +// GetCalls gets all the calls that were made to Get. +// Check the length with: +// len(mockedAPIServiceLister.GetCalls()) +func (mock *APIServiceListerMock) GetCalls() []struct { + Namespace string + Name string +} { + var calls []struct { + Namespace string + Name string + } + lockAPIServiceListerMockGet.RLock() + calls = mock.calls.Get + lockAPIServiceListerMockGet.RUnlock() + return calls +} + +// List calls ListFunc. +func (mock *APIServiceListerMock) List(namespace string, selector labels.Selector) ([]*v1.APIService, error) { + if mock.ListFunc == nil { + panic("APIServiceListerMock.ListFunc: method is nil but APIServiceLister.List was just called") + } + callInfo := struct { + Namespace string + Selector labels.Selector + }{ + Namespace: namespace, + Selector: selector, + } + lockAPIServiceListerMockList.Lock() + mock.calls.List = append(mock.calls.List, callInfo) + lockAPIServiceListerMockList.Unlock() + return mock.ListFunc(namespace, selector) +} + +// ListCalls gets all the calls that were made to List. +// Check the length with: +// len(mockedAPIServiceLister.ListCalls()) +func (mock *APIServiceListerMock) ListCalls() []struct { + Namespace string + Selector labels.Selector +} { + var calls []struct { + Namespace string + Selector labels.Selector + } + lockAPIServiceListerMockList.RLock() + calls = mock.calls.List + lockAPIServiceListerMockList.RUnlock() + return calls +} + +var ( + lockAPIServiceControllerMockAddClusterScopedFeatureHandler sync.RWMutex + lockAPIServiceControllerMockAddClusterScopedHandler sync.RWMutex + lockAPIServiceControllerMockAddFeatureHandler sync.RWMutex + lockAPIServiceControllerMockAddHandler sync.RWMutex + lockAPIServiceControllerMockEnqueue sync.RWMutex + lockAPIServiceControllerMockGeneric sync.RWMutex + lockAPIServiceControllerMockInformer sync.RWMutex + lockAPIServiceControllerMockLister sync.RWMutex + lockAPIServiceControllerMockStart sync.RWMutex + lockAPIServiceControllerMockSync sync.RWMutex +) + +// Ensure, that APIServiceControllerMock does implement APIServiceController. +// If this is not the case, regenerate this file with moq. +var _ v1a.APIServiceController = &APIServiceControllerMock{} + +// APIServiceControllerMock is a mock implementation of APIServiceController. +// +// func TestSomethingThatUsesAPIServiceController(t *testing.T) { +// +// // make and configure a mocked APIServiceController +// mockedAPIServiceController := &APIServiceControllerMock{ +// AddClusterScopedFeatureHandlerFunc: func(ctx context.Context, enabled func() bool, name string, clusterName string, handler v1a.APIServiceHandlerFunc) { +// panic("mock out the AddClusterScopedFeatureHandler method") +// }, +// AddClusterScopedHandlerFunc: func(ctx context.Context, name string, clusterName string, handler v1a.APIServiceHandlerFunc) { +// panic("mock out the AddClusterScopedHandler method") +// }, +// AddFeatureHandlerFunc: func(ctx context.Context, enabled func() bool, name string, sync v1a.APIServiceHandlerFunc) { +// panic("mock out the AddFeatureHandler method") +// }, +// AddHandlerFunc: func(ctx context.Context, name string, handler v1a.APIServiceHandlerFunc) { +// 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() v1a.APIServiceLister { +// 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 mockedAPIServiceController in code that requires APIServiceController +// // and then make assertions. +// +// } +type APIServiceControllerMock struct { + // AddClusterScopedFeatureHandlerFunc mocks the AddClusterScopedFeatureHandler method. + AddClusterScopedFeatureHandlerFunc func(ctx context.Context, enabled func() bool, name string, clusterName string, handler v1a.APIServiceHandlerFunc) + + // AddClusterScopedHandlerFunc mocks the AddClusterScopedHandler method. + AddClusterScopedHandlerFunc func(ctx context.Context, name string, clusterName string, handler v1a.APIServiceHandlerFunc) + + // AddFeatureHandlerFunc mocks the AddFeatureHandler method. + AddFeatureHandlerFunc func(ctx context.Context, enabled func() bool, name string, sync v1a.APIServiceHandlerFunc) + + // AddHandlerFunc mocks the AddHandler method. + AddHandlerFunc func(ctx context.Context, name string, handler v1a.APIServiceHandlerFunc) + + // 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() v1a.APIServiceLister + + // 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 v1a.APIServiceHandlerFunc + } + // 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 v1a.APIServiceHandlerFunc + } + // AddFeatureHandler holds details about calls to the AddFeatureHandler method. + AddFeatureHandler []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Enabled is the enabled argument value. + Enabled func() bool + // Name is the name argument value. + Name string + // Sync is the sync argument value. + Sync v1a.APIServiceHandlerFunc + } + // 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 v1a.APIServiceHandlerFunc + } + // 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 *APIServiceControllerMock) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name string, clusterName string, handler v1a.APIServiceHandlerFunc) { + if mock.AddClusterScopedFeatureHandlerFunc == nil { + panic("APIServiceControllerMock.AddClusterScopedFeatureHandlerFunc: method is nil but APIServiceController.AddClusterScopedFeatureHandler was just called") + } + callInfo := struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Handler v1a.APIServiceHandlerFunc + }{ + Ctx: ctx, + Enabled: enabled, + Name: name, + ClusterName: clusterName, + Handler: handler, + } + lockAPIServiceControllerMockAddClusterScopedFeatureHandler.Lock() + mock.calls.AddClusterScopedFeatureHandler = append(mock.calls.AddClusterScopedFeatureHandler, callInfo) + lockAPIServiceControllerMockAddClusterScopedFeatureHandler.Unlock() + mock.AddClusterScopedFeatureHandlerFunc(ctx, enabled, name, clusterName, handler) +} + +// AddClusterScopedFeatureHandlerCalls gets all the calls that were made to AddClusterScopedFeatureHandler. +// Check the length with: +// len(mockedAPIServiceController.AddClusterScopedFeatureHandlerCalls()) +func (mock *APIServiceControllerMock) AddClusterScopedFeatureHandlerCalls() []struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Handler v1a.APIServiceHandlerFunc +} { + var calls []struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Handler v1a.APIServiceHandlerFunc + } + lockAPIServiceControllerMockAddClusterScopedFeatureHandler.RLock() + calls = mock.calls.AddClusterScopedFeatureHandler + lockAPIServiceControllerMockAddClusterScopedFeatureHandler.RUnlock() + return calls +} + +// AddClusterScopedHandler calls AddClusterScopedHandlerFunc. +func (mock *APIServiceControllerMock) AddClusterScopedHandler(ctx context.Context, name string, clusterName string, handler v1a.APIServiceHandlerFunc) { + if mock.AddClusterScopedHandlerFunc == nil { + panic("APIServiceControllerMock.AddClusterScopedHandlerFunc: method is nil but APIServiceController.AddClusterScopedHandler was just called") + } + callInfo := struct { + Ctx context.Context + Name string + ClusterName string + Handler v1a.APIServiceHandlerFunc + }{ + Ctx: ctx, + Name: name, + ClusterName: clusterName, + Handler: handler, + } + lockAPIServiceControllerMockAddClusterScopedHandler.Lock() + mock.calls.AddClusterScopedHandler = append(mock.calls.AddClusterScopedHandler, callInfo) + lockAPIServiceControllerMockAddClusterScopedHandler.Unlock() + mock.AddClusterScopedHandlerFunc(ctx, name, clusterName, handler) +} + +// AddClusterScopedHandlerCalls gets all the calls that were made to AddClusterScopedHandler. +// Check the length with: +// len(mockedAPIServiceController.AddClusterScopedHandlerCalls()) +func (mock *APIServiceControllerMock) AddClusterScopedHandlerCalls() []struct { + Ctx context.Context + Name string + ClusterName string + Handler v1a.APIServiceHandlerFunc +} { + var calls []struct { + Ctx context.Context + Name string + ClusterName string + Handler v1a.APIServiceHandlerFunc + } + lockAPIServiceControllerMockAddClusterScopedHandler.RLock() + calls = mock.calls.AddClusterScopedHandler + lockAPIServiceControllerMockAddClusterScopedHandler.RUnlock() + return calls +} + +// AddFeatureHandler calls AddFeatureHandlerFunc. +func (mock *APIServiceControllerMock) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync v1a.APIServiceHandlerFunc) { + if mock.AddFeatureHandlerFunc == nil { + panic("APIServiceControllerMock.AddFeatureHandlerFunc: method is nil but APIServiceController.AddFeatureHandler was just called") + } + callInfo := struct { + Ctx context.Context + Enabled func() bool + Name string + Sync v1a.APIServiceHandlerFunc + }{ + Ctx: ctx, + Enabled: enabled, + Name: name, + Sync: sync, + } + lockAPIServiceControllerMockAddFeatureHandler.Lock() + mock.calls.AddFeatureHandler = append(mock.calls.AddFeatureHandler, callInfo) + lockAPIServiceControllerMockAddFeatureHandler.Unlock() + mock.AddFeatureHandlerFunc(ctx, enabled, name, sync) +} + +// AddFeatureHandlerCalls gets all the calls that were made to AddFeatureHandler. +// Check the length with: +// len(mockedAPIServiceController.AddFeatureHandlerCalls()) +func (mock *APIServiceControllerMock) AddFeatureHandlerCalls() []struct { + Ctx context.Context + Enabled func() bool + Name string + Sync v1a.APIServiceHandlerFunc +} { + var calls []struct { + Ctx context.Context + Enabled func() bool + Name string + Sync v1a.APIServiceHandlerFunc + } + lockAPIServiceControllerMockAddFeatureHandler.RLock() + calls = mock.calls.AddFeatureHandler + lockAPIServiceControllerMockAddFeatureHandler.RUnlock() + return calls +} + +// AddHandler calls AddHandlerFunc. +func (mock *APIServiceControllerMock) AddHandler(ctx context.Context, name string, handler v1a.APIServiceHandlerFunc) { + if mock.AddHandlerFunc == nil { + panic("APIServiceControllerMock.AddHandlerFunc: method is nil but APIServiceController.AddHandler was just called") + } + callInfo := struct { + Ctx context.Context + Name string + Handler v1a.APIServiceHandlerFunc + }{ + Ctx: ctx, + Name: name, + Handler: handler, + } + lockAPIServiceControllerMockAddHandler.Lock() + mock.calls.AddHandler = append(mock.calls.AddHandler, callInfo) + lockAPIServiceControllerMockAddHandler.Unlock() + mock.AddHandlerFunc(ctx, name, handler) +} + +// AddHandlerCalls gets all the calls that were made to AddHandler. +// Check the length with: +// len(mockedAPIServiceController.AddHandlerCalls()) +func (mock *APIServiceControllerMock) AddHandlerCalls() []struct { + Ctx context.Context + Name string + Handler v1a.APIServiceHandlerFunc +} { + var calls []struct { + Ctx context.Context + Name string + Handler v1a.APIServiceHandlerFunc + } + lockAPIServiceControllerMockAddHandler.RLock() + calls = mock.calls.AddHandler + lockAPIServiceControllerMockAddHandler.RUnlock() + return calls +} + +// Enqueue calls EnqueueFunc. +func (mock *APIServiceControllerMock) Enqueue(namespace string, name string) { + if mock.EnqueueFunc == nil { + panic("APIServiceControllerMock.EnqueueFunc: method is nil but APIServiceController.Enqueue was just called") + } + callInfo := struct { + Namespace string + Name string + }{ + Namespace: namespace, + Name: name, + } + lockAPIServiceControllerMockEnqueue.Lock() + mock.calls.Enqueue = append(mock.calls.Enqueue, callInfo) + lockAPIServiceControllerMockEnqueue.Unlock() + mock.EnqueueFunc(namespace, name) +} + +// EnqueueCalls gets all the calls that were made to Enqueue. +// Check the length with: +// len(mockedAPIServiceController.EnqueueCalls()) +func (mock *APIServiceControllerMock) EnqueueCalls() []struct { + Namespace string + Name string +} { + var calls []struct { + Namespace string + Name string + } + lockAPIServiceControllerMockEnqueue.RLock() + calls = mock.calls.Enqueue + lockAPIServiceControllerMockEnqueue.RUnlock() + return calls +} + +// Generic calls GenericFunc. +func (mock *APIServiceControllerMock) Generic() controller.GenericController { + if mock.GenericFunc == nil { + panic("APIServiceControllerMock.GenericFunc: method is nil but APIServiceController.Generic was just called") + } + callInfo := struct { + }{} + lockAPIServiceControllerMockGeneric.Lock() + mock.calls.Generic = append(mock.calls.Generic, callInfo) + lockAPIServiceControllerMockGeneric.Unlock() + return mock.GenericFunc() +} + +// GenericCalls gets all the calls that were made to Generic. +// Check the length with: +// len(mockedAPIServiceController.GenericCalls()) +func (mock *APIServiceControllerMock) GenericCalls() []struct { +} { + var calls []struct { + } + lockAPIServiceControllerMockGeneric.RLock() + calls = mock.calls.Generic + lockAPIServiceControllerMockGeneric.RUnlock() + return calls +} + +// Informer calls InformerFunc. +func (mock *APIServiceControllerMock) Informer() cache.SharedIndexInformer { + if mock.InformerFunc == nil { + panic("APIServiceControllerMock.InformerFunc: method is nil but APIServiceController.Informer was just called") + } + callInfo := struct { + }{} + lockAPIServiceControllerMockInformer.Lock() + mock.calls.Informer = append(mock.calls.Informer, callInfo) + lockAPIServiceControllerMockInformer.Unlock() + return mock.InformerFunc() +} + +// InformerCalls gets all the calls that were made to Informer. +// Check the length with: +// len(mockedAPIServiceController.InformerCalls()) +func (mock *APIServiceControllerMock) InformerCalls() []struct { +} { + var calls []struct { + } + lockAPIServiceControllerMockInformer.RLock() + calls = mock.calls.Informer + lockAPIServiceControllerMockInformer.RUnlock() + return calls +} + +// Lister calls ListerFunc. +func (mock *APIServiceControllerMock) Lister() v1a.APIServiceLister { + if mock.ListerFunc == nil { + panic("APIServiceControllerMock.ListerFunc: method is nil but APIServiceController.Lister was just called") + } + callInfo := struct { + }{} + lockAPIServiceControllerMockLister.Lock() + mock.calls.Lister = append(mock.calls.Lister, callInfo) + lockAPIServiceControllerMockLister.Unlock() + return mock.ListerFunc() +} + +// ListerCalls gets all the calls that were made to Lister. +// Check the length with: +// len(mockedAPIServiceController.ListerCalls()) +func (mock *APIServiceControllerMock) ListerCalls() []struct { +} { + var calls []struct { + } + lockAPIServiceControllerMockLister.RLock() + calls = mock.calls.Lister + lockAPIServiceControllerMockLister.RUnlock() + return calls +} + +// Start calls StartFunc. +func (mock *APIServiceControllerMock) Start(ctx context.Context, threadiness int) error { + if mock.StartFunc == nil { + panic("APIServiceControllerMock.StartFunc: method is nil but APIServiceController.Start was just called") + } + callInfo := struct { + Ctx context.Context + Threadiness int + }{ + Ctx: ctx, + Threadiness: threadiness, + } + lockAPIServiceControllerMockStart.Lock() + mock.calls.Start = append(mock.calls.Start, callInfo) + lockAPIServiceControllerMockStart.Unlock() + return mock.StartFunc(ctx, threadiness) +} + +// StartCalls gets all the calls that were made to Start. +// Check the length with: +// len(mockedAPIServiceController.StartCalls()) +func (mock *APIServiceControllerMock) StartCalls() []struct { + Ctx context.Context + Threadiness int +} { + var calls []struct { + Ctx context.Context + Threadiness int + } + lockAPIServiceControllerMockStart.RLock() + calls = mock.calls.Start + lockAPIServiceControllerMockStart.RUnlock() + return calls +} + +// Sync calls SyncFunc. +func (mock *APIServiceControllerMock) Sync(ctx context.Context) error { + if mock.SyncFunc == nil { + panic("APIServiceControllerMock.SyncFunc: method is nil but APIServiceController.Sync was just called") + } + callInfo := struct { + Ctx context.Context + }{ + Ctx: ctx, + } + lockAPIServiceControllerMockSync.Lock() + mock.calls.Sync = append(mock.calls.Sync, callInfo) + lockAPIServiceControllerMockSync.Unlock() + return mock.SyncFunc(ctx) +} + +// SyncCalls gets all the calls that were made to Sync. +// Check the length with: +// len(mockedAPIServiceController.SyncCalls()) +func (mock *APIServiceControllerMock) SyncCalls() []struct { + Ctx context.Context +} { + var calls []struct { + Ctx context.Context + } + lockAPIServiceControllerMockSync.RLock() + calls = mock.calls.Sync + lockAPIServiceControllerMockSync.RUnlock() + return calls +} + +var ( + lockAPIServiceInterfaceMockAddClusterScopedFeatureHandler sync.RWMutex + lockAPIServiceInterfaceMockAddClusterScopedFeatureLifecycle sync.RWMutex + lockAPIServiceInterfaceMockAddClusterScopedHandler sync.RWMutex + lockAPIServiceInterfaceMockAddClusterScopedLifecycle sync.RWMutex + lockAPIServiceInterfaceMockAddFeatureHandler sync.RWMutex + lockAPIServiceInterfaceMockAddFeatureLifecycle sync.RWMutex + lockAPIServiceInterfaceMockAddHandler sync.RWMutex + lockAPIServiceInterfaceMockAddLifecycle sync.RWMutex + lockAPIServiceInterfaceMockController sync.RWMutex + lockAPIServiceInterfaceMockCreate sync.RWMutex + lockAPIServiceInterfaceMockDelete sync.RWMutex + lockAPIServiceInterfaceMockDeleteCollection sync.RWMutex + lockAPIServiceInterfaceMockDeleteNamespaced sync.RWMutex + lockAPIServiceInterfaceMockGet sync.RWMutex + lockAPIServiceInterfaceMockGetNamespaced sync.RWMutex + lockAPIServiceInterfaceMockList sync.RWMutex + lockAPIServiceInterfaceMockObjectClient sync.RWMutex + lockAPIServiceInterfaceMockUpdate sync.RWMutex + lockAPIServiceInterfaceMockWatch sync.RWMutex +) + +// Ensure, that APIServiceInterfaceMock does implement APIServiceInterface. +// If this is not the case, regenerate this file with moq. +var _ v1a.APIServiceInterface = &APIServiceInterfaceMock{} + +// APIServiceInterfaceMock is a mock implementation of APIServiceInterface. +// +// func TestSomethingThatUsesAPIServiceInterface(t *testing.T) { +// +// // make and configure a mocked APIServiceInterface +// mockedAPIServiceInterface := &APIServiceInterfaceMock{ +// AddClusterScopedFeatureHandlerFunc: func(ctx context.Context, enabled func() bool, name string, clusterName string, sync v1a.APIServiceHandlerFunc) { +// panic("mock out the AddClusterScopedFeatureHandler method") +// }, +// AddClusterScopedFeatureLifecycleFunc: func(ctx context.Context, enabled func() bool, name string, clusterName string, lifecycle v1a.APIServiceLifecycle) { +// panic("mock out the AddClusterScopedFeatureLifecycle method") +// }, +// AddClusterScopedHandlerFunc: func(ctx context.Context, name string, clusterName string, sync v1a.APIServiceHandlerFunc) { +// panic("mock out the AddClusterScopedHandler method") +// }, +// AddClusterScopedLifecycleFunc: func(ctx context.Context, name string, clusterName string, lifecycle v1a.APIServiceLifecycle) { +// panic("mock out the AddClusterScopedLifecycle method") +// }, +// AddFeatureHandlerFunc: func(ctx context.Context, enabled func() bool, name string, sync v1a.APIServiceHandlerFunc) { +// panic("mock out the AddFeatureHandler method") +// }, +// AddFeatureLifecycleFunc: func(ctx context.Context, enabled func() bool, name string, lifecycle v1a.APIServiceLifecycle) { +// panic("mock out the AddFeatureLifecycle method") +// }, +// AddHandlerFunc: func(ctx context.Context, name string, sync v1a.APIServiceHandlerFunc) { +// panic("mock out the AddHandler method") +// }, +// AddLifecycleFunc: func(ctx context.Context, name string, lifecycle v1a.APIServiceLifecycle) { +// panic("mock out the AddLifecycle method") +// }, +// ControllerFunc: func() v1a.APIServiceController { +// panic("mock out the Controller method") +// }, +// CreateFunc: func(in1 *v1.APIService) (*v1.APIService, error) { +// panic("mock out the Create method") +// }, +// DeleteFunc: func(name string, options *v1b.DeleteOptions) error { +// panic("mock out the Delete method") +// }, +// DeleteCollectionFunc: func(deleteOpts *v1b.DeleteOptions, listOpts v1b.ListOptions) error { +// panic("mock out the DeleteCollection method") +// }, +// DeleteNamespacedFunc: func(namespace string, name string, options *v1b.DeleteOptions) error { +// panic("mock out the DeleteNamespaced method") +// }, +// GetFunc: func(name string, opts v1b.GetOptions) (*v1.APIService, error) { +// panic("mock out the Get method") +// }, +// GetNamespacedFunc: func(namespace string, name string, opts v1b.GetOptions) (*v1.APIService, error) { +// panic("mock out the GetNamespaced method") +// }, +// ListFunc: func(opts v1b.ListOptions) (*v1a.APIServiceList, error) { +// panic("mock out the List method") +// }, +// ObjectClientFunc: func() *objectclient.ObjectClient { +// panic("mock out the ObjectClient method") +// }, +// UpdateFunc: func(in1 *v1.APIService) (*v1.APIService, error) { +// panic("mock out the Update method") +// }, +// WatchFunc: func(opts v1b.ListOptions) (watch.Interface, error) { +// panic("mock out the Watch method") +// }, +// } +// +// // use mockedAPIServiceInterface in code that requires APIServiceInterface +// // and then make assertions. +// +// } +type APIServiceInterfaceMock struct { + // AddClusterScopedFeatureHandlerFunc mocks the AddClusterScopedFeatureHandler method. + AddClusterScopedFeatureHandlerFunc func(ctx context.Context, enabled func() bool, name string, clusterName string, sync v1a.APIServiceHandlerFunc) + + // AddClusterScopedFeatureLifecycleFunc mocks the AddClusterScopedFeatureLifecycle method. + AddClusterScopedFeatureLifecycleFunc func(ctx context.Context, enabled func() bool, name string, clusterName string, lifecycle v1a.APIServiceLifecycle) + + // AddClusterScopedHandlerFunc mocks the AddClusterScopedHandler method. + AddClusterScopedHandlerFunc func(ctx context.Context, name string, clusterName string, sync v1a.APIServiceHandlerFunc) + + // AddClusterScopedLifecycleFunc mocks the AddClusterScopedLifecycle method. + AddClusterScopedLifecycleFunc func(ctx context.Context, name string, clusterName string, lifecycle v1a.APIServiceLifecycle) + + // AddFeatureHandlerFunc mocks the AddFeatureHandler method. + AddFeatureHandlerFunc func(ctx context.Context, enabled func() bool, name string, sync v1a.APIServiceHandlerFunc) + + // AddFeatureLifecycleFunc mocks the AddFeatureLifecycle method. + AddFeatureLifecycleFunc func(ctx context.Context, enabled func() bool, name string, lifecycle v1a.APIServiceLifecycle) + + // AddHandlerFunc mocks the AddHandler method. + AddHandlerFunc func(ctx context.Context, name string, sync v1a.APIServiceHandlerFunc) + + // AddLifecycleFunc mocks the AddLifecycle method. + AddLifecycleFunc func(ctx context.Context, name string, lifecycle v1a.APIServiceLifecycle) + + // ControllerFunc mocks the Controller method. + ControllerFunc func() v1a.APIServiceController + + // CreateFunc mocks the Create method. + CreateFunc func(in1 *v1.APIService) (*v1.APIService, error) + + // DeleteFunc mocks the Delete method. + DeleteFunc func(name string, options *v1b.DeleteOptions) error + + // DeleteCollectionFunc mocks the DeleteCollection method. + DeleteCollectionFunc func(deleteOpts *v1b.DeleteOptions, listOpts v1b.ListOptions) error + + // DeleteNamespacedFunc mocks the DeleteNamespaced method. + DeleteNamespacedFunc func(namespace string, name string, options *v1b.DeleteOptions) error + + // GetFunc mocks the Get method. + GetFunc func(name string, opts v1b.GetOptions) (*v1.APIService, error) + + // GetNamespacedFunc mocks the GetNamespaced method. + GetNamespacedFunc func(namespace string, name string, opts v1b.GetOptions) (*v1.APIService, error) + + // ListFunc mocks the List method. + ListFunc func(opts v1b.ListOptions) (*v1a.APIServiceList, error) + + // ObjectClientFunc mocks the ObjectClient method. + ObjectClientFunc func() *objectclient.ObjectClient + + // UpdateFunc mocks the Update method. + UpdateFunc func(in1 *v1.APIService) (*v1.APIService, error) + + // WatchFunc mocks the Watch method. + WatchFunc func(opts v1b.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 v1a.APIServiceHandlerFunc + } + // AddClusterScopedFeatureLifecycle holds details about calls to the AddClusterScopedFeatureLifecycle method. + AddClusterScopedFeatureLifecycle []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Enabled is the enabled argument value. + Enabled func() bool + // Name is the name argument value. + Name string + // ClusterName is the clusterName argument value. + ClusterName string + // Lifecycle is the lifecycle argument value. + Lifecycle v1a.APIServiceLifecycle + } + // 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 v1a.APIServiceHandlerFunc + } + // 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 v1a.APIServiceLifecycle + } + // AddFeatureHandler holds details about calls to the AddFeatureHandler method. + AddFeatureHandler []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Enabled is the enabled argument value. + Enabled func() bool + // Name is the name argument value. + Name string + // Sync is the sync argument value. + Sync v1a.APIServiceHandlerFunc + } + // AddFeatureLifecycle holds details about calls to the AddFeatureLifecycle method. + AddFeatureLifecycle []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Enabled is the enabled argument value. + Enabled func() bool + // Name is the name argument value. + Name string + // Lifecycle is the lifecycle argument value. + Lifecycle v1a.APIServiceLifecycle + } + // 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 v1a.APIServiceHandlerFunc + } + // 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 v1a.APIServiceLifecycle + } + // 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 *v1.APIService + } + // 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 *v1b.DeleteOptions + } + // DeleteCollection holds details about calls to the DeleteCollection method. + DeleteCollection []struct { + // DeleteOpts is the deleteOpts argument value. + DeleteOpts *v1b.DeleteOptions + // ListOpts is the listOpts argument value. + ListOpts v1b.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 *v1b.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 v1b.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 v1b.GetOptions + } + // List holds details about calls to the List method. + List []struct { + // Opts is the opts argument value. + Opts v1b.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 *v1.APIService + } + // Watch holds details about calls to the Watch method. + Watch []struct { + // Opts is the opts argument value. + Opts v1b.ListOptions + } + } +} + +// AddClusterScopedFeatureHandler calls AddClusterScopedFeatureHandlerFunc. +func (mock *APIServiceInterfaceMock) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name string, clusterName string, sync v1a.APIServiceHandlerFunc) { + if mock.AddClusterScopedFeatureHandlerFunc == nil { + panic("APIServiceInterfaceMock.AddClusterScopedFeatureHandlerFunc: method is nil but APIServiceInterface.AddClusterScopedFeatureHandler was just called") + } + callInfo := struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Sync v1a.APIServiceHandlerFunc + }{ + Ctx: ctx, + Enabled: enabled, + Name: name, + ClusterName: clusterName, + Sync: sync, + } + lockAPIServiceInterfaceMockAddClusterScopedFeatureHandler.Lock() + mock.calls.AddClusterScopedFeatureHandler = append(mock.calls.AddClusterScopedFeatureHandler, callInfo) + lockAPIServiceInterfaceMockAddClusterScopedFeatureHandler.Unlock() + mock.AddClusterScopedFeatureHandlerFunc(ctx, enabled, name, clusterName, sync) +} + +// AddClusterScopedFeatureHandlerCalls gets all the calls that were made to AddClusterScopedFeatureHandler. +// Check the length with: +// len(mockedAPIServiceInterface.AddClusterScopedFeatureHandlerCalls()) +func (mock *APIServiceInterfaceMock) AddClusterScopedFeatureHandlerCalls() []struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Sync v1a.APIServiceHandlerFunc +} { + var calls []struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Sync v1a.APIServiceHandlerFunc + } + lockAPIServiceInterfaceMockAddClusterScopedFeatureHandler.RLock() + calls = mock.calls.AddClusterScopedFeatureHandler + lockAPIServiceInterfaceMockAddClusterScopedFeatureHandler.RUnlock() + return calls +} + +// AddClusterScopedFeatureLifecycle calls AddClusterScopedFeatureLifecycleFunc. +func (mock *APIServiceInterfaceMock) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name string, clusterName string, lifecycle v1a.APIServiceLifecycle) { + if mock.AddClusterScopedFeatureLifecycleFunc == nil { + panic("APIServiceInterfaceMock.AddClusterScopedFeatureLifecycleFunc: method is nil but APIServiceInterface.AddClusterScopedFeatureLifecycle was just called") + } + callInfo := struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Lifecycle v1a.APIServiceLifecycle + }{ + Ctx: ctx, + Enabled: enabled, + Name: name, + ClusterName: clusterName, + Lifecycle: lifecycle, + } + lockAPIServiceInterfaceMockAddClusterScopedFeatureLifecycle.Lock() + mock.calls.AddClusterScopedFeatureLifecycle = append(mock.calls.AddClusterScopedFeatureLifecycle, callInfo) + lockAPIServiceInterfaceMockAddClusterScopedFeatureLifecycle.Unlock() + mock.AddClusterScopedFeatureLifecycleFunc(ctx, enabled, name, clusterName, lifecycle) +} + +// AddClusterScopedFeatureLifecycleCalls gets all the calls that were made to AddClusterScopedFeatureLifecycle. +// Check the length with: +// len(mockedAPIServiceInterface.AddClusterScopedFeatureLifecycleCalls()) +func (mock *APIServiceInterfaceMock) AddClusterScopedFeatureLifecycleCalls() []struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Lifecycle v1a.APIServiceLifecycle +} { + var calls []struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Lifecycle v1a.APIServiceLifecycle + } + lockAPIServiceInterfaceMockAddClusterScopedFeatureLifecycle.RLock() + calls = mock.calls.AddClusterScopedFeatureLifecycle + lockAPIServiceInterfaceMockAddClusterScopedFeatureLifecycle.RUnlock() + return calls +} + +// AddClusterScopedHandler calls AddClusterScopedHandlerFunc. +func (mock *APIServiceInterfaceMock) AddClusterScopedHandler(ctx context.Context, name string, clusterName string, sync v1a.APIServiceHandlerFunc) { + if mock.AddClusterScopedHandlerFunc == nil { + panic("APIServiceInterfaceMock.AddClusterScopedHandlerFunc: method is nil but APIServiceInterface.AddClusterScopedHandler was just called") + } + callInfo := struct { + Ctx context.Context + Name string + ClusterName string + Sync v1a.APIServiceHandlerFunc + }{ + Ctx: ctx, + Name: name, + ClusterName: clusterName, + Sync: sync, + } + lockAPIServiceInterfaceMockAddClusterScopedHandler.Lock() + mock.calls.AddClusterScopedHandler = append(mock.calls.AddClusterScopedHandler, callInfo) + lockAPIServiceInterfaceMockAddClusterScopedHandler.Unlock() + mock.AddClusterScopedHandlerFunc(ctx, name, clusterName, sync) +} + +// AddClusterScopedHandlerCalls gets all the calls that were made to AddClusterScopedHandler. +// Check the length with: +// len(mockedAPIServiceInterface.AddClusterScopedHandlerCalls()) +func (mock *APIServiceInterfaceMock) AddClusterScopedHandlerCalls() []struct { + Ctx context.Context + Name string + ClusterName string + Sync v1a.APIServiceHandlerFunc +} { + var calls []struct { + Ctx context.Context + Name string + ClusterName string + Sync v1a.APIServiceHandlerFunc + } + lockAPIServiceInterfaceMockAddClusterScopedHandler.RLock() + calls = mock.calls.AddClusterScopedHandler + lockAPIServiceInterfaceMockAddClusterScopedHandler.RUnlock() + return calls +} + +// AddClusterScopedLifecycle calls AddClusterScopedLifecycleFunc. +func (mock *APIServiceInterfaceMock) AddClusterScopedLifecycle(ctx context.Context, name string, clusterName string, lifecycle v1a.APIServiceLifecycle) { + if mock.AddClusterScopedLifecycleFunc == nil { + panic("APIServiceInterfaceMock.AddClusterScopedLifecycleFunc: method is nil but APIServiceInterface.AddClusterScopedLifecycle was just called") + } + callInfo := struct { + Ctx context.Context + Name string + ClusterName string + Lifecycle v1a.APIServiceLifecycle + }{ + Ctx: ctx, + Name: name, + ClusterName: clusterName, + Lifecycle: lifecycle, + } + lockAPIServiceInterfaceMockAddClusterScopedLifecycle.Lock() + mock.calls.AddClusterScopedLifecycle = append(mock.calls.AddClusterScopedLifecycle, callInfo) + lockAPIServiceInterfaceMockAddClusterScopedLifecycle.Unlock() + mock.AddClusterScopedLifecycleFunc(ctx, name, clusterName, lifecycle) +} + +// AddClusterScopedLifecycleCalls gets all the calls that were made to AddClusterScopedLifecycle. +// Check the length with: +// len(mockedAPIServiceInterface.AddClusterScopedLifecycleCalls()) +func (mock *APIServiceInterfaceMock) AddClusterScopedLifecycleCalls() []struct { + Ctx context.Context + Name string + ClusterName string + Lifecycle v1a.APIServiceLifecycle +} { + var calls []struct { + Ctx context.Context + Name string + ClusterName string + Lifecycle v1a.APIServiceLifecycle + } + lockAPIServiceInterfaceMockAddClusterScopedLifecycle.RLock() + calls = mock.calls.AddClusterScopedLifecycle + lockAPIServiceInterfaceMockAddClusterScopedLifecycle.RUnlock() + return calls +} + +// AddFeatureHandler calls AddFeatureHandlerFunc. +func (mock *APIServiceInterfaceMock) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync v1a.APIServiceHandlerFunc) { + if mock.AddFeatureHandlerFunc == nil { + panic("APIServiceInterfaceMock.AddFeatureHandlerFunc: method is nil but APIServiceInterface.AddFeatureHandler was just called") + } + callInfo := struct { + Ctx context.Context + Enabled func() bool + Name string + Sync v1a.APIServiceHandlerFunc + }{ + Ctx: ctx, + Enabled: enabled, + Name: name, + Sync: sync, + } + lockAPIServiceInterfaceMockAddFeatureHandler.Lock() + mock.calls.AddFeatureHandler = append(mock.calls.AddFeatureHandler, callInfo) + lockAPIServiceInterfaceMockAddFeatureHandler.Unlock() + mock.AddFeatureHandlerFunc(ctx, enabled, name, sync) +} + +// AddFeatureHandlerCalls gets all the calls that were made to AddFeatureHandler. +// Check the length with: +// len(mockedAPIServiceInterface.AddFeatureHandlerCalls()) +func (mock *APIServiceInterfaceMock) AddFeatureHandlerCalls() []struct { + Ctx context.Context + Enabled func() bool + Name string + Sync v1a.APIServiceHandlerFunc +} { + var calls []struct { + Ctx context.Context + Enabled func() bool + Name string + Sync v1a.APIServiceHandlerFunc + } + lockAPIServiceInterfaceMockAddFeatureHandler.RLock() + calls = mock.calls.AddFeatureHandler + lockAPIServiceInterfaceMockAddFeatureHandler.RUnlock() + return calls +} + +// AddFeatureLifecycle calls AddFeatureLifecycleFunc. +func (mock *APIServiceInterfaceMock) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle v1a.APIServiceLifecycle) { + if mock.AddFeatureLifecycleFunc == nil { + panic("APIServiceInterfaceMock.AddFeatureLifecycleFunc: method is nil but APIServiceInterface.AddFeatureLifecycle was just called") + } + callInfo := struct { + Ctx context.Context + Enabled func() bool + Name string + Lifecycle v1a.APIServiceLifecycle + }{ + Ctx: ctx, + Enabled: enabled, + Name: name, + Lifecycle: lifecycle, + } + lockAPIServiceInterfaceMockAddFeatureLifecycle.Lock() + mock.calls.AddFeatureLifecycle = append(mock.calls.AddFeatureLifecycle, callInfo) + lockAPIServiceInterfaceMockAddFeatureLifecycle.Unlock() + mock.AddFeatureLifecycleFunc(ctx, enabled, name, lifecycle) +} + +// AddFeatureLifecycleCalls gets all the calls that were made to AddFeatureLifecycle. +// Check the length with: +// len(mockedAPIServiceInterface.AddFeatureLifecycleCalls()) +func (mock *APIServiceInterfaceMock) AddFeatureLifecycleCalls() []struct { + Ctx context.Context + Enabled func() bool + Name string + Lifecycle v1a.APIServiceLifecycle +} { + var calls []struct { + Ctx context.Context + Enabled func() bool + Name string + Lifecycle v1a.APIServiceLifecycle + } + lockAPIServiceInterfaceMockAddFeatureLifecycle.RLock() + calls = mock.calls.AddFeatureLifecycle + lockAPIServiceInterfaceMockAddFeatureLifecycle.RUnlock() + return calls +} + +// AddHandler calls AddHandlerFunc. +func (mock *APIServiceInterfaceMock) AddHandler(ctx context.Context, name string, sync v1a.APIServiceHandlerFunc) { + if mock.AddHandlerFunc == nil { + panic("APIServiceInterfaceMock.AddHandlerFunc: method is nil but APIServiceInterface.AddHandler was just called") + } + callInfo := struct { + Ctx context.Context + Name string + Sync v1a.APIServiceHandlerFunc + }{ + Ctx: ctx, + Name: name, + Sync: sync, + } + lockAPIServiceInterfaceMockAddHandler.Lock() + mock.calls.AddHandler = append(mock.calls.AddHandler, callInfo) + lockAPIServiceInterfaceMockAddHandler.Unlock() + mock.AddHandlerFunc(ctx, name, sync) +} + +// AddHandlerCalls gets all the calls that were made to AddHandler. +// Check the length with: +// len(mockedAPIServiceInterface.AddHandlerCalls()) +func (mock *APIServiceInterfaceMock) AddHandlerCalls() []struct { + Ctx context.Context + Name string + Sync v1a.APIServiceHandlerFunc +} { + var calls []struct { + Ctx context.Context + Name string + Sync v1a.APIServiceHandlerFunc + } + lockAPIServiceInterfaceMockAddHandler.RLock() + calls = mock.calls.AddHandler + lockAPIServiceInterfaceMockAddHandler.RUnlock() + return calls +} + +// AddLifecycle calls AddLifecycleFunc. +func (mock *APIServiceInterfaceMock) AddLifecycle(ctx context.Context, name string, lifecycle v1a.APIServiceLifecycle) { + if mock.AddLifecycleFunc == nil { + panic("APIServiceInterfaceMock.AddLifecycleFunc: method is nil but APIServiceInterface.AddLifecycle was just called") + } + callInfo := struct { + Ctx context.Context + Name string + Lifecycle v1a.APIServiceLifecycle + }{ + Ctx: ctx, + Name: name, + Lifecycle: lifecycle, + } + lockAPIServiceInterfaceMockAddLifecycle.Lock() + mock.calls.AddLifecycle = append(mock.calls.AddLifecycle, callInfo) + lockAPIServiceInterfaceMockAddLifecycle.Unlock() + mock.AddLifecycleFunc(ctx, name, lifecycle) +} + +// AddLifecycleCalls gets all the calls that were made to AddLifecycle. +// Check the length with: +// len(mockedAPIServiceInterface.AddLifecycleCalls()) +func (mock *APIServiceInterfaceMock) AddLifecycleCalls() []struct { + Ctx context.Context + Name string + Lifecycle v1a.APIServiceLifecycle +} { + var calls []struct { + Ctx context.Context + Name string + Lifecycle v1a.APIServiceLifecycle + } + lockAPIServiceInterfaceMockAddLifecycle.RLock() + calls = mock.calls.AddLifecycle + lockAPIServiceInterfaceMockAddLifecycle.RUnlock() + return calls +} + +// Controller calls ControllerFunc. +func (mock *APIServiceInterfaceMock) Controller() v1a.APIServiceController { + if mock.ControllerFunc == nil { + panic("APIServiceInterfaceMock.ControllerFunc: method is nil but APIServiceInterface.Controller was just called") + } + callInfo := struct { + }{} + lockAPIServiceInterfaceMockController.Lock() + mock.calls.Controller = append(mock.calls.Controller, callInfo) + lockAPIServiceInterfaceMockController.Unlock() + return mock.ControllerFunc() +} + +// ControllerCalls gets all the calls that were made to Controller. +// Check the length with: +// len(mockedAPIServiceInterface.ControllerCalls()) +func (mock *APIServiceInterfaceMock) ControllerCalls() []struct { +} { + var calls []struct { + } + lockAPIServiceInterfaceMockController.RLock() + calls = mock.calls.Controller + lockAPIServiceInterfaceMockController.RUnlock() + return calls +} + +// Create calls CreateFunc. +func (mock *APIServiceInterfaceMock) Create(in1 *v1.APIService) (*v1.APIService, error) { + if mock.CreateFunc == nil { + panic("APIServiceInterfaceMock.CreateFunc: method is nil but APIServiceInterface.Create was just called") + } + callInfo := struct { + In1 *v1.APIService + }{ + In1: in1, + } + lockAPIServiceInterfaceMockCreate.Lock() + mock.calls.Create = append(mock.calls.Create, callInfo) + lockAPIServiceInterfaceMockCreate.Unlock() + return mock.CreateFunc(in1) +} + +// CreateCalls gets all the calls that were made to Create. +// Check the length with: +// len(mockedAPIServiceInterface.CreateCalls()) +func (mock *APIServiceInterfaceMock) CreateCalls() []struct { + In1 *v1.APIService +} { + var calls []struct { + In1 *v1.APIService + } + lockAPIServiceInterfaceMockCreate.RLock() + calls = mock.calls.Create + lockAPIServiceInterfaceMockCreate.RUnlock() + return calls +} + +// Delete calls DeleteFunc. +func (mock *APIServiceInterfaceMock) Delete(name string, options *v1b.DeleteOptions) error { + if mock.DeleteFunc == nil { + panic("APIServiceInterfaceMock.DeleteFunc: method is nil but APIServiceInterface.Delete was just called") + } + callInfo := struct { + Name string + Options *v1b.DeleteOptions + }{ + Name: name, + Options: options, + } + lockAPIServiceInterfaceMockDelete.Lock() + mock.calls.Delete = append(mock.calls.Delete, callInfo) + lockAPIServiceInterfaceMockDelete.Unlock() + return mock.DeleteFunc(name, options) +} + +// DeleteCalls gets all the calls that were made to Delete. +// Check the length with: +// len(mockedAPIServiceInterface.DeleteCalls()) +func (mock *APIServiceInterfaceMock) DeleteCalls() []struct { + Name string + Options *v1b.DeleteOptions +} { + var calls []struct { + Name string + Options *v1b.DeleteOptions + } + lockAPIServiceInterfaceMockDelete.RLock() + calls = mock.calls.Delete + lockAPIServiceInterfaceMockDelete.RUnlock() + return calls +} + +// DeleteCollection calls DeleteCollectionFunc. +func (mock *APIServiceInterfaceMock) DeleteCollection(deleteOpts *v1b.DeleteOptions, listOpts v1b.ListOptions) error { + if mock.DeleteCollectionFunc == nil { + panic("APIServiceInterfaceMock.DeleteCollectionFunc: method is nil but APIServiceInterface.DeleteCollection was just called") + } + callInfo := struct { + DeleteOpts *v1b.DeleteOptions + ListOpts v1b.ListOptions + }{ + DeleteOpts: deleteOpts, + ListOpts: listOpts, + } + lockAPIServiceInterfaceMockDeleteCollection.Lock() + mock.calls.DeleteCollection = append(mock.calls.DeleteCollection, callInfo) + lockAPIServiceInterfaceMockDeleteCollection.Unlock() + return mock.DeleteCollectionFunc(deleteOpts, listOpts) +} + +// DeleteCollectionCalls gets all the calls that were made to DeleteCollection. +// Check the length with: +// len(mockedAPIServiceInterface.DeleteCollectionCalls()) +func (mock *APIServiceInterfaceMock) DeleteCollectionCalls() []struct { + DeleteOpts *v1b.DeleteOptions + ListOpts v1b.ListOptions +} { + var calls []struct { + DeleteOpts *v1b.DeleteOptions + ListOpts v1b.ListOptions + } + lockAPIServiceInterfaceMockDeleteCollection.RLock() + calls = mock.calls.DeleteCollection + lockAPIServiceInterfaceMockDeleteCollection.RUnlock() + return calls +} + +// DeleteNamespaced calls DeleteNamespacedFunc. +func (mock *APIServiceInterfaceMock) DeleteNamespaced(namespace string, name string, options *v1b.DeleteOptions) error { + if mock.DeleteNamespacedFunc == nil { + panic("APIServiceInterfaceMock.DeleteNamespacedFunc: method is nil but APIServiceInterface.DeleteNamespaced was just called") + } + callInfo := struct { + Namespace string + Name string + Options *v1b.DeleteOptions + }{ + Namespace: namespace, + Name: name, + Options: options, + } + lockAPIServiceInterfaceMockDeleteNamespaced.Lock() + mock.calls.DeleteNamespaced = append(mock.calls.DeleteNamespaced, callInfo) + lockAPIServiceInterfaceMockDeleteNamespaced.Unlock() + return mock.DeleteNamespacedFunc(namespace, name, options) +} + +// DeleteNamespacedCalls gets all the calls that were made to DeleteNamespaced. +// Check the length with: +// len(mockedAPIServiceInterface.DeleteNamespacedCalls()) +func (mock *APIServiceInterfaceMock) DeleteNamespacedCalls() []struct { + Namespace string + Name string + Options *v1b.DeleteOptions +} { + var calls []struct { + Namespace string + Name string + Options *v1b.DeleteOptions + } + lockAPIServiceInterfaceMockDeleteNamespaced.RLock() + calls = mock.calls.DeleteNamespaced + lockAPIServiceInterfaceMockDeleteNamespaced.RUnlock() + return calls +} + +// Get calls GetFunc. +func (mock *APIServiceInterfaceMock) Get(name string, opts v1b.GetOptions) (*v1.APIService, error) { + if mock.GetFunc == nil { + panic("APIServiceInterfaceMock.GetFunc: method is nil but APIServiceInterface.Get was just called") + } + callInfo := struct { + Name string + Opts v1b.GetOptions + }{ + Name: name, + Opts: opts, + } + lockAPIServiceInterfaceMockGet.Lock() + mock.calls.Get = append(mock.calls.Get, callInfo) + lockAPIServiceInterfaceMockGet.Unlock() + return mock.GetFunc(name, opts) +} + +// GetCalls gets all the calls that were made to Get. +// Check the length with: +// len(mockedAPIServiceInterface.GetCalls()) +func (mock *APIServiceInterfaceMock) GetCalls() []struct { + Name string + Opts v1b.GetOptions +} { + var calls []struct { + Name string + Opts v1b.GetOptions + } + lockAPIServiceInterfaceMockGet.RLock() + calls = mock.calls.Get + lockAPIServiceInterfaceMockGet.RUnlock() + return calls +} + +// GetNamespaced calls GetNamespacedFunc. +func (mock *APIServiceInterfaceMock) GetNamespaced(namespace string, name string, opts v1b.GetOptions) (*v1.APIService, error) { + if mock.GetNamespacedFunc == nil { + panic("APIServiceInterfaceMock.GetNamespacedFunc: method is nil but APIServiceInterface.GetNamespaced was just called") + } + callInfo := struct { + Namespace string + Name string + Opts v1b.GetOptions + }{ + Namespace: namespace, + Name: name, + Opts: opts, + } + lockAPIServiceInterfaceMockGetNamespaced.Lock() + mock.calls.GetNamespaced = append(mock.calls.GetNamespaced, callInfo) + lockAPIServiceInterfaceMockGetNamespaced.Unlock() + return mock.GetNamespacedFunc(namespace, name, opts) +} + +// GetNamespacedCalls gets all the calls that were made to GetNamespaced. +// Check the length with: +// len(mockedAPIServiceInterface.GetNamespacedCalls()) +func (mock *APIServiceInterfaceMock) GetNamespacedCalls() []struct { + Namespace string + Name string + Opts v1b.GetOptions +} { + var calls []struct { + Namespace string + Name string + Opts v1b.GetOptions + } + lockAPIServiceInterfaceMockGetNamespaced.RLock() + calls = mock.calls.GetNamespaced + lockAPIServiceInterfaceMockGetNamespaced.RUnlock() + return calls +} + +// List calls ListFunc. +func (mock *APIServiceInterfaceMock) List(opts v1b.ListOptions) (*v1a.APIServiceList, error) { + if mock.ListFunc == nil { + panic("APIServiceInterfaceMock.ListFunc: method is nil but APIServiceInterface.List was just called") + } + callInfo := struct { + Opts v1b.ListOptions + }{ + Opts: opts, + } + lockAPIServiceInterfaceMockList.Lock() + mock.calls.List = append(mock.calls.List, callInfo) + lockAPIServiceInterfaceMockList.Unlock() + return mock.ListFunc(opts) +} + +// ListCalls gets all the calls that were made to List. +// Check the length with: +// len(mockedAPIServiceInterface.ListCalls()) +func (mock *APIServiceInterfaceMock) ListCalls() []struct { + Opts v1b.ListOptions +} { + var calls []struct { + Opts v1b.ListOptions + } + lockAPIServiceInterfaceMockList.RLock() + calls = mock.calls.List + lockAPIServiceInterfaceMockList.RUnlock() + return calls +} + +// ObjectClient calls ObjectClientFunc. +func (mock *APIServiceInterfaceMock) ObjectClient() *objectclient.ObjectClient { + if mock.ObjectClientFunc == nil { + panic("APIServiceInterfaceMock.ObjectClientFunc: method is nil but APIServiceInterface.ObjectClient was just called") + } + callInfo := struct { + }{} + lockAPIServiceInterfaceMockObjectClient.Lock() + mock.calls.ObjectClient = append(mock.calls.ObjectClient, callInfo) + lockAPIServiceInterfaceMockObjectClient.Unlock() + return mock.ObjectClientFunc() +} + +// ObjectClientCalls gets all the calls that were made to ObjectClient. +// Check the length with: +// len(mockedAPIServiceInterface.ObjectClientCalls()) +func (mock *APIServiceInterfaceMock) ObjectClientCalls() []struct { +} { + var calls []struct { + } + lockAPIServiceInterfaceMockObjectClient.RLock() + calls = mock.calls.ObjectClient + lockAPIServiceInterfaceMockObjectClient.RUnlock() + return calls +} + +// Update calls UpdateFunc. +func (mock *APIServiceInterfaceMock) Update(in1 *v1.APIService) (*v1.APIService, error) { + if mock.UpdateFunc == nil { + panic("APIServiceInterfaceMock.UpdateFunc: method is nil but APIServiceInterface.Update was just called") + } + callInfo := struct { + In1 *v1.APIService + }{ + In1: in1, + } + lockAPIServiceInterfaceMockUpdate.Lock() + mock.calls.Update = append(mock.calls.Update, callInfo) + lockAPIServiceInterfaceMockUpdate.Unlock() + return mock.UpdateFunc(in1) +} + +// UpdateCalls gets all the calls that were made to Update. +// Check the length with: +// len(mockedAPIServiceInterface.UpdateCalls()) +func (mock *APIServiceInterfaceMock) UpdateCalls() []struct { + In1 *v1.APIService +} { + var calls []struct { + In1 *v1.APIService + } + lockAPIServiceInterfaceMockUpdate.RLock() + calls = mock.calls.Update + lockAPIServiceInterfaceMockUpdate.RUnlock() + return calls +} + +// Watch calls WatchFunc. +func (mock *APIServiceInterfaceMock) Watch(opts v1b.ListOptions) (watch.Interface, error) { + if mock.WatchFunc == nil { + panic("APIServiceInterfaceMock.WatchFunc: method is nil but APIServiceInterface.Watch was just called") + } + callInfo := struct { + Opts v1b.ListOptions + }{ + Opts: opts, + } + lockAPIServiceInterfaceMockWatch.Lock() + mock.calls.Watch = append(mock.calls.Watch, callInfo) + lockAPIServiceInterfaceMockWatch.Unlock() + return mock.WatchFunc(opts) +} + +// WatchCalls gets all the calls that were made to Watch. +// Check the length with: +// len(mockedAPIServiceInterface.WatchCalls()) +func (mock *APIServiceInterfaceMock) WatchCalls() []struct { + Opts v1b.ListOptions +} { + var calls []struct { + Opts v1b.ListOptions + } + lockAPIServiceInterfaceMockWatch.RLock() + calls = mock.calls.Watch + lockAPIServiceInterfaceMockWatch.RUnlock() + return calls +} + +var ( + lockAPIServicesGetterMockAPIServices sync.RWMutex +) + +// Ensure, that APIServicesGetterMock does implement APIServicesGetter. +// If this is not the case, regenerate this file with moq. +var _ v1a.APIServicesGetter = &APIServicesGetterMock{} + +// APIServicesGetterMock is a mock implementation of APIServicesGetter. +// +// func TestSomethingThatUsesAPIServicesGetter(t *testing.T) { +// +// // make and configure a mocked APIServicesGetter +// mockedAPIServicesGetter := &APIServicesGetterMock{ +// APIServicesFunc: func(namespace string) v1a.APIServiceInterface { +// panic("mock out the APIServices method") +// }, +// } +// +// // use mockedAPIServicesGetter in code that requires APIServicesGetter +// // and then make assertions. +// +// } +type APIServicesGetterMock struct { + // APIServicesFunc mocks the APIServices method. + APIServicesFunc func(namespace string) v1a.APIServiceInterface + + // calls tracks calls to the methods. + calls struct { + // APIServices holds details about calls to the APIServices method. + APIServices []struct { + // Namespace is the namespace argument value. + Namespace string + } + } +} + +// APIServices calls APIServicesFunc. +func (mock *APIServicesGetterMock) APIServices(namespace string) v1a.APIServiceInterface { + if mock.APIServicesFunc == nil { + panic("APIServicesGetterMock.APIServicesFunc: method is nil but APIServicesGetter.APIServices was just called") + } + callInfo := struct { + Namespace string + }{ + Namespace: namespace, + } + lockAPIServicesGetterMockAPIServices.Lock() + mock.calls.APIServices = append(mock.calls.APIServices, callInfo) + lockAPIServicesGetterMockAPIServices.Unlock() + return mock.APIServicesFunc(namespace) +} + +// APIServicesCalls gets all the calls that were made to APIServices. +// Check the length with: +// len(mockedAPIServicesGetter.APIServicesCalls()) +func (mock *APIServicesGetterMock) APIServicesCalls() []struct { + Namespace string +} { + var calls []struct { + Namespace string + } + lockAPIServicesGetterMockAPIServices.RLock() + calls = mock.calls.APIServices + lockAPIServicesGetterMockAPIServices.RUnlock() + return calls +} diff --git a/apis/apiregistration.k8s.io/v1/zz_generated_api_service_controller.go b/apis/apiregistration.k8s.io/v1/zz_generated_api_service_controller.go new file mode 100644 index 00000000..524a514d --- /dev/null +++ b/apis/apiregistration.k8s.io/v1/zz_generated_api_service_controller.go @@ -0,0 +1,505 @@ +package v1 + +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" + v1 "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1" +) + +var ( + APIServiceGroupVersionKind = schema.GroupVersionKind{ + Version: Version, + Group: GroupName, + Kind: "APIService", + } + APIServiceResource = metav1.APIResource{ + Name: "apiservices", + SingularName: "apiservice", + Namespaced: false, + Kind: APIServiceGroupVersionKind.Kind, + } + + APIServiceGroupVersionResource = schema.GroupVersionResource{ + Group: GroupName, + Version: Version, + Resource: "apiservices", + } +) + +func init() { + resource.Put(APIServiceGroupVersionResource) +} + +func NewAPIService(namespace, name string, obj v1.APIService) *v1.APIService { + obj.APIVersion, obj.Kind = APIServiceGroupVersionKind.ToAPIVersionAndKind() + obj.Name = name + obj.Namespace = namespace + return &obj +} + +type APIServiceList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []v1.APIService `json:"items"` +} + +type APIServiceHandlerFunc func(key string, obj *v1.APIService) (runtime.Object, error) + +type APIServiceChangeHandlerFunc func(obj *v1.APIService) (runtime.Object, error) + +type APIServiceLister interface { + List(namespace string, selector labels.Selector) (ret []*v1.APIService, err error) + Get(namespace, name string) (*v1.APIService, error) +} + +type APIServiceController interface { + Generic() controller.GenericController + Informer() cache.SharedIndexInformer + Lister() APIServiceLister + AddHandler(ctx context.Context, name string, handler APIServiceHandlerFunc) + AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync APIServiceHandlerFunc) + AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler APIServiceHandlerFunc) + AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler APIServiceHandlerFunc) + Enqueue(namespace, name string) + Sync(ctx context.Context) error + Start(ctx context.Context, threadiness int) error +} + +type APIServiceInterface interface { + ObjectClient() *objectclient.ObjectClient + Create(*v1.APIService) (*v1.APIService, error) + GetNamespaced(namespace, name string, opts metav1.GetOptions) (*v1.APIService, error) + Get(name string, opts metav1.GetOptions) (*v1.APIService, error) + Update(*v1.APIService) (*v1.APIService, error) + Delete(name string, options *metav1.DeleteOptions) error + DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error + List(opts metav1.ListOptions) (*APIServiceList, error) + Watch(opts metav1.ListOptions) (watch.Interface, error) + DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Controller() APIServiceController + AddHandler(ctx context.Context, name string, sync APIServiceHandlerFunc) + AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync APIServiceHandlerFunc) + AddLifecycle(ctx context.Context, name string, lifecycle APIServiceLifecycle) + AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle APIServiceLifecycle) + AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync APIServiceHandlerFunc) + AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync APIServiceHandlerFunc) + AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle APIServiceLifecycle) + AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle APIServiceLifecycle) +} + +type apiServiceLister struct { + controller *apiServiceController +} + +func (l *apiServiceLister) List(namespace string, selector labels.Selector) (ret []*v1.APIService, err error) { + err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { + ret = append(ret, obj.(*v1.APIService)) + }) + return +} + +func (l *apiServiceLister) Get(namespace, name string) (*v1.APIService, 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: APIServiceGroupVersionKind.Group, + Resource: "apiService", + }, key) + } + return obj.(*v1.APIService), nil +} + +type apiServiceController struct { + controller.GenericController +} + +func (c *apiServiceController) Generic() controller.GenericController { + return c.GenericController +} + +func (c *apiServiceController) Lister() APIServiceLister { + return &apiServiceLister{ + controller: c, + } +} + +func (c *apiServiceController) AddHandler(ctx context.Context, name string, handler APIServiceHandlerFunc) { + c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { + if obj == nil { + return handler(key, nil) + } else if v, ok := obj.(*v1.APIService); ok { + return handler(key, v) + } else { + return nil, nil + } + }) +} + +func (c *apiServiceController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler APIServiceHandlerFunc) { + c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { + if !enabled() { + return nil, nil + } else if obj == nil { + return handler(key, nil) + } else if v, ok := obj.(*v1.APIService); ok { + return handler(key, v) + } else { + return nil, nil + } + }) +} + +func (c *apiServiceController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler APIServiceHandlerFunc) { + resource.PutClusterScoped(APIServiceGroupVersionResource) + c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { + if obj == nil { + return handler(key, nil) + } else if v, ok := obj.(*v1.APIService); ok && controller.ObjectInCluster(cluster, obj) { + return handler(key, v) + } else { + return nil, nil + } + }) +} + +func (c *apiServiceController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler APIServiceHandlerFunc) { + resource.PutClusterScoped(APIServiceGroupVersionResource) + c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { + if !enabled() { + return nil, nil + } else if obj == nil { + return handler(key, nil) + } else if v, ok := obj.(*v1.APIService); ok && controller.ObjectInCluster(cluster, obj) { + return handler(key, v) + } else { + return nil, nil + } + }) +} + +type apiServiceFactory struct { +} + +func (c apiServiceFactory) Object() runtime.Object { + return &v1.APIService{} +} + +func (c apiServiceFactory) List() runtime.Object { + return &APIServiceList{} +} + +func (s *apiServiceClient) Controller() APIServiceController { + s.client.Lock() + defer s.client.Unlock() + + c, ok := s.client.apiServiceControllers[s.ns] + if ok { + return c + } + + genericController := controller.NewGenericController(APIServiceGroupVersionKind.Kind+"Controller", + s.objectClient) + + c = &apiServiceController{ + GenericController: genericController, + } + + s.client.apiServiceControllers[s.ns] = c + s.client.starters = append(s.client.starters, c) + + return c +} + +type apiServiceClient struct { + client *Client + ns string + objectClient *objectclient.ObjectClient + controller APIServiceController +} + +func (s *apiServiceClient) ObjectClient() *objectclient.ObjectClient { + return s.objectClient +} + +func (s *apiServiceClient) Create(o *v1.APIService) (*v1.APIService, error) { + obj, err := s.objectClient.Create(o) + return obj.(*v1.APIService), err +} + +func (s *apiServiceClient) Get(name string, opts metav1.GetOptions) (*v1.APIService, error) { + obj, err := s.objectClient.Get(name, opts) + return obj.(*v1.APIService), err +} + +func (s *apiServiceClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*v1.APIService, error) { + obj, err := s.objectClient.GetNamespaced(namespace, name, opts) + return obj.(*v1.APIService), err +} + +func (s *apiServiceClient) Update(o *v1.APIService) (*v1.APIService, error) { + obj, err := s.objectClient.Update(o.Name, o) + return obj.(*v1.APIService), err +} + +func (s *apiServiceClient) Delete(name string, options *metav1.DeleteOptions) error { + return s.objectClient.Delete(name, options) +} + +func (s *apiServiceClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { + return s.objectClient.DeleteNamespaced(namespace, name, options) +} + +func (s *apiServiceClient) List(opts metav1.ListOptions) (*APIServiceList, error) { + obj, err := s.objectClient.List(opts) + return obj.(*APIServiceList), err +} + +func (s *apiServiceClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { + return s.objectClient.Watch(opts) +} + +// Patch applies the patch and returns the patched deployment. +func (s *apiServiceClient) Patch(o *v1.APIService, patchType types.PatchType, data []byte, subresources ...string) (*v1.APIService, error) { + obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) + return obj.(*v1.APIService), err +} + +func (s *apiServiceClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return s.objectClient.DeleteCollection(deleteOpts, listOpts) +} + +func (s *apiServiceClient) AddHandler(ctx context.Context, name string, sync APIServiceHandlerFunc) { + s.Controller().AddHandler(ctx, name, sync) +} + +func (s *apiServiceClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync APIServiceHandlerFunc) { + s.Controller().AddFeatureHandler(ctx, enabled, name, sync) +} + +func (s *apiServiceClient) AddLifecycle(ctx context.Context, name string, lifecycle APIServiceLifecycle) { + sync := NewAPIServiceLifecycleAdapter(name, false, s, lifecycle) + s.Controller().AddHandler(ctx, name, sync) +} + +func (s *apiServiceClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle APIServiceLifecycle) { + sync := NewAPIServiceLifecycleAdapter(name, false, s, lifecycle) + s.Controller().AddFeatureHandler(ctx, enabled, name, sync) +} + +func (s *apiServiceClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync APIServiceHandlerFunc) { + s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) +} + +func (s *apiServiceClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync APIServiceHandlerFunc) { + s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) +} + +func (s *apiServiceClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle APIServiceLifecycle) { + sync := NewAPIServiceLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) + s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) +} + +func (s *apiServiceClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle APIServiceLifecycle) { + sync := NewAPIServiceLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) + s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) +} + +type APIServiceIndexer func(obj *v1.APIService) ([]string, error) + +type APIServiceClientCache interface { + Get(namespace, name string) (*v1.APIService, error) + List(namespace string, selector labels.Selector) ([]*v1.APIService, error) + + Index(name string, indexer APIServiceIndexer) + GetIndexed(name, key string) ([]*v1.APIService, error) +} + +type APIServiceClient interface { + Create(*v1.APIService) (*v1.APIService, error) + Get(namespace, name string, opts metav1.GetOptions) (*v1.APIService, error) + Update(*v1.APIService) (*v1.APIService, error) + Delete(namespace, name string, options *metav1.DeleteOptions) error + List(namespace string, opts metav1.ListOptions) (*APIServiceList, error) + Watch(opts metav1.ListOptions) (watch.Interface, error) + + Cache() APIServiceClientCache + + OnCreate(ctx context.Context, name string, sync APIServiceChangeHandlerFunc) + OnChange(ctx context.Context, name string, sync APIServiceChangeHandlerFunc) + OnRemove(ctx context.Context, name string, sync APIServiceChangeHandlerFunc) + Enqueue(namespace, name string) + + Generic() controller.GenericController + ObjectClient() *objectclient.ObjectClient + Interface() APIServiceInterface +} + +type apiServiceClientCache struct { + client *apiServiceClient2 +} + +type apiServiceClient2 struct { + iface APIServiceInterface + controller APIServiceController +} + +func (n *apiServiceClient2) Interface() APIServiceInterface { + return n.iface +} + +func (n *apiServiceClient2) Generic() controller.GenericController { + return n.iface.Controller().Generic() +} + +func (n *apiServiceClient2) ObjectClient() *objectclient.ObjectClient { + return n.Interface().ObjectClient() +} + +func (n *apiServiceClient2) Enqueue(namespace, name string) { + n.iface.Controller().Enqueue(namespace, name) +} + +func (n *apiServiceClient2) Create(obj *v1.APIService) (*v1.APIService, error) { + return n.iface.Create(obj) +} + +func (n *apiServiceClient2) Get(namespace, name string, opts metav1.GetOptions) (*v1.APIService, error) { + return n.iface.GetNamespaced(namespace, name, opts) +} + +func (n *apiServiceClient2) Update(obj *v1.APIService) (*v1.APIService, error) { + return n.iface.Update(obj) +} + +func (n *apiServiceClient2) Delete(namespace, name string, options *metav1.DeleteOptions) error { + return n.iface.DeleteNamespaced(namespace, name, options) +} + +func (n *apiServiceClient2) List(namespace string, opts metav1.ListOptions) (*APIServiceList, error) { + return n.iface.List(opts) +} + +func (n *apiServiceClient2) Watch(opts metav1.ListOptions) (watch.Interface, error) { + return n.iface.Watch(opts) +} + +func (n *apiServiceClientCache) Get(namespace, name string) (*v1.APIService, error) { + return n.client.controller.Lister().Get(namespace, name) +} + +func (n *apiServiceClientCache) List(namespace string, selector labels.Selector) ([]*v1.APIService, error) { + return n.client.controller.Lister().List(namespace, selector) +} + +func (n *apiServiceClient2) Cache() APIServiceClientCache { + n.loadController() + return &apiServiceClientCache{ + client: n, + } +} + +func (n *apiServiceClient2) OnCreate(ctx context.Context, name string, sync APIServiceChangeHandlerFunc) { + n.loadController() + n.iface.AddLifecycle(ctx, name+"-create", &apiServiceLifecycleDelegate{create: sync}) +} + +func (n *apiServiceClient2) OnChange(ctx context.Context, name string, sync APIServiceChangeHandlerFunc) { + n.loadController() + n.iface.AddLifecycle(ctx, name+"-change", &apiServiceLifecycleDelegate{update: sync}) +} + +func (n *apiServiceClient2) OnRemove(ctx context.Context, name string, sync APIServiceChangeHandlerFunc) { + n.loadController() + n.iface.AddLifecycle(ctx, name, &apiServiceLifecycleDelegate{remove: sync}) +} + +func (n *apiServiceClientCache) Index(name string, indexer APIServiceIndexer) { + err := n.client.controller.Informer().GetIndexer().AddIndexers(map[string]cache.IndexFunc{ + name: func(obj interface{}) ([]string, error) { + if v, ok := obj.(*v1.APIService); ok { + return indexer(v) + } + return nil, nil + }, + }) + + if err != nil { + panic(err) + } +} + +func (n *apiServiceClientCache) GetIndexed(name, key string) ([]*v1.APIService, error) { + var result []*v1.APIService + objs, err := n.client.controller.Informer().GetIndexer().ByIndex(name, key) + if err != nil { + return nil, err + } + for _, obj := range objs { + if v, ok := obj.(*v1.APIService); ok { + result = append(result, v) + } + } + + return result, nil +} + +func (n *apiServiceClient2) loadController() { + if n.controller == nil { + n.controller = n.iface.Controller() + } +} + +type apiServiceLifecycleDelegate struct { + create APIServiceChangeHandlerFunc + update APIServiceChangeHandlerFunc + remove APIServiceChangeHandlerFunc +} + +func (n *apiServiceLifecycleDelegate) HasCreate() bool { + return n.create != nil +} + +func (n *apiServiceLifecycleDelegate) Create(obj *v1.APIService) (runtime.Object, error) { + if n.create == nil { + return obj, nil + } + return n.create(obj) +} + +func (n *apiServiceLifecycleDelegate) HasFinalize() bool { + return n.remove != nil +} + +func (n *apiServiceLifecycleDelegate) Remove(obj *v1.APIService) (runtime.Object, error) { + if n.remove == nil { + return obj, nil + } + return n.remove(obj) +} + +func (n *apiServiceLifecycleDelegate) Updated(obj *v1.APIService) (runtime.Object, error) { + if n.update == nil { + return obj, nil + } + return n.update(obj) +} diff --git a/apis/apiregistration.k8s.io/v1/zz_generated_api_service_lifecycle_adapter.go b/apis/apiregistration.k8s.io/v1/zz_generated_api_service_lifecycle_adapter.go new file mode 100644 index 00000000..e89d0c7e --- /dev/null +++ b/apis/apiregistration.k8s.io/v1/zz_generated_api_service_lifecycle_adapter.go @@ -0,0 +1,63 @@ +package v1 + +import ( + "github.com/rancher/norman/lifecycle" + "k8s.io/apimachinery/pkg/runtime" + v1 "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1" +) + +type APIServiceLifecycle interface { + Create(obj *v1.APIService) (runtime.Object, error) + Remove(obj *v1.APIService) (runtime.Object, error) + Updated(obj *v1.APIService) (runtime.Object, error) +} + +type apiServiceLifecycleAdapter struct { + lifecycle APIServiceLifecycle +} + +func (w *apiServiceLifecycleAdapter) HasCreate() bool { + o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) + return !ok || o.HasCreate() +} + +func (w *apiServiceLifecycleAdapter) HasFinalize() bool { + o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) + return !ok || o.HasFinalize() +} + +func (w *apiServiceLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { + o, err := w.lifecycle.Create(obj.(*v1.APIService)) + if o == nil { + return nil, err + } + return o, err +} + +func (w *apiServiceLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { + o, err := w.lifecycle.Remove(obj.(*v1.APIService)) + if o == nil { + return nil, err + } + return o, err +} + +func (w *apiServiceLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { + o, err := w.lifecycle.Updated(obj.(*v1.APIService)) + if o == nil { + return nil, err + } + return o, err +} + +func NewAPIServiceLifecycleAdapter(name string, clusterScoped bool, client APIServiceInterface, l APIServiceLifecycle) APIServiceHandlerFunc { + adapter := &apiServiceLifecycleAdapter{lifecycle: l} + syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) + return func(key string, obj *v1.APIService) (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/apiregistration.k8s.io/v1/zz_generated_deepcopy.go b/apis/apiregistration.k8s.io/v1/zz_generated_deepcopy.go new file mode 100644 index 00000000..d7f35598 --- /dev/null +++ b/apis/apiregistration.k8s.io/v1/zz_generated_deepcopy.go @@ -0,0 +1,39 @@ +package v1 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" + apiregistrationv1 "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *APIServiceList) DeepCopyInto(out *APIServiceList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]apiregistrationv1.APIService, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIServiceList. +func (in *APIServiceList) DeepCopy() *APIServiceList { + if in == nil { + return nil + } + out := new(APIServiceList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *APIServiceList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} diff --git a/apis/apiregistration.k8s.io/v1/zz_generated_k8s_client.go b/apis/apiregistration.k8s.io/v1/zz_generated_k8s_client.go new file mode 100644 index 00000000..9a219557 --- /dev/null +++ b/apis/apiregistration.k8s.io/v1/zz_generated_k8s_client.go @@ -0,0 +1,119 @@ +package v1 + +import ( + "context" + "sync" + + "github.com/rancher/norman/controller" + "github.com/rancher/norman/objectclient" + "github.com/rancher/norman/objectclient/dynamic" + "github.com/rancher/norman/restwatch" + "k8s.io/client-go/rest" +) + +type ( + contextKeyType struct{} + contextClientsKeyType struct{} +) + +type Interface interface { + RESTClient() rest.Interface + controller.Starter + + APIServicesGetter +} + +type Clients struct { + Interface Interface + + APIService APIServiceClient +} + +type Client struct { + sync.Mutex + restClient rest.Interface + starters []controller.Starter + + apiServiceControllers map[string]APIServiceController +} + +func Factory(ctx context.Context, config rest.Config) (context.Context, controller.Starter, error) { + c, err := NewForConfig(config) + if err != nil { + return ctx, nil, err + } + + cs := NewClientsFromInterface(c) + + ctx = context.WithValue(ctx, contextKeyType{}, c) + ctx = context.WithValue(ctx, contextClientsKeyType{}, cs) + return ctx, c, nil +} + +func ClientsFrom(ctx context.Context) *Clients { + return ctx.Value(contextClientsKeyType{}).(*Clients) +} + +func From(ctx context.Context) Interface { + return ctx.Value(contextKeyType{}).(Interface) +} + +func NewClients(config rest.Config) (*Clients, error) { + iface, err := NewForConfig(config) + if err != nil { + return nil, err + } + return NewClientsFromInterface(iface), nil +} + +func NewClientsFromInterface(iface Interface) *Clients { + return &Clients{ + Interface: iface, + + APIService: &apiServiceClient2{ + iface: iface.APIServices(""), + }, + } +} + +func NewForConfig(config rest.Config) (Interface, error) { + if config.NegotiatedSerializer == nil { + config.NegotiatedSerializer = dynamic.NegotiatedSerializer + } + + restClient, err := restwatch.UnversionedRESTClientFor(&config) + if err != nil { + return nil, err + } + + return &Client{ + restClient: restClient, + + apiServiceControllers: map[string]APIServiceController{}, + }, nil +} + +func (c *Client) RESTClient() rest.Interface { + return c.restClient +} + +func (c *Client) Sync(ctx context.Context) error { + return controller.Sync(ctx, c.starters...) +} + +func (c *Client) Start(ctx context.Context, threadiness int) error { + return controller.Start(ctx, threadiness, c.starters...) +} + +type APIServicesGetter interface { + APIServices(namespace string) APIServiceInterface +} + +func (c *Client) APIServices(namespace string) APIServiceInterface { + objectClient := objectclient.NewObjectClient(namespace, c.restClient, &APIServiceResource, APIServiceGroupVersionKind, apiServiceFactory{}) + return &apiServiceClient{ + ns: namespace, + client: c, + objectClient: objectClient, + } +} diff --git a/apis/apiregistration.k8s.io/v1/zz_generated_scheme.go b/apis/apiregistration.k8s.io/v1/zz_generated_scheme.go new file mode 100644 index 00000000..f49665a9 --- /dev/null +++ b/apis/apiregistration.k8s.io/v1/zz_generated_scheme.go @@ -0,0 +1,41 @@ +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +const ( + GroupName = "apiregistration.k8s.io" + Version = "v1" +) + +// SchemeGroupVersion is group version used to register these objects +var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: Version} + +// Kind takes an unqualified kind and returns a Group qualified GroupKind +func Kind(kind string) schema.GroupKind { + return SchemeGroupVersion.WithKind(kind).GroupKind() +} + +// Resource takes an unqualified resource and returns a Group qualified GroupResource +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +var ( + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) + AddToScheme = SchemeBuilder.AddToScheme +) + +// Adds the list of known types to api.Scheme. +func addKnownTypes(scheme *runtime.Scheme) error { + // TODO this gets cleaned up when the types are fixed + scheme.AddKnownTypes(SchemeGroupVersion, + + &APIServiceList{}, + ) + metav1.AddToGroupVersion(scheme, SchemeGroupVersion) + return nil +} diff --git a/client/cluster/v3/zz_generated_api_service.go b/client/cluster/v3/zz_generated_api_service.go new file mode 100644 index 00000000..ceae702c --- /dev/null +++ b/client/cluster/v3/zz_generated_api_service.go @@ -0,0 +1,121 @@ +package client + +import ( + "github.com/rancher/norman/types" +) + +const ( + APIServiceType = "apiService" + APIServiceFieldAnnotations = "annotations" + APIServiceFieldCABundle = "caBundle" + APIServiceFieldConditions = "conditions" + APIServiceFieldCreated = "created" + APIServiceFieldCreatorID = "creatorId" + APIServiceFieldGroup = "group" + APIServiceFieldGroupPriorityMinimum = "groupPriorityMinimum" + APIServiceFieldInsecureSkipTLSVerify = "insecureSkipTLSVerify" + APIServiceFieldLabels = "labels" + APIServiceFieldName = "name" + APIServiceFieldOwnerReferences = "ownerReferences" + APIServiceFieldRemoved = "removed" + APIServiceFieldService = "service" + APIServiceFieldState = "state" + APIServiceFieldTransitioning = "transitioning" + APIServiceFieldTransitioningMessage = "transitioningMessage" + APIServiceFieldUUID = "uuid" + APIServiceFieldVersion = "version" + APIServiceFieldVersionPriority = "versionPriority" +) + +type APIService struct { + types.Resource + Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` + CABundle string `json:"caBundle,omitempty" yaml:"caBundle,omitempty"` + Conditions []APIServiceCondition `json:"conditions,omitempty" yaml:"conditions,omitempty"` + Created string `json:"created,omitempty" yaml:"created,omitempty"` + CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` + Group string `json:"group,omitempty" yaml:"group,omitempty"` + GroupPriorityMinimum int64 `json:"groupPriorityMinimum,omitempty" yaml:"groupPriorityMinimum,omitempty"` + InsecureSkipTLSVerify bool `json:"insecureSkipTLSVerify,omitempty" yaml:"insecureSkipTLSVerify,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"` + Service *ServiceReference `json:"service,omitempty" yaml:"service,omitempty"` + State string `json:"state,omitempty" yaml:"state,omitempty"` + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioningMessage,omitempty"` + UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` + Version string `json:"version,omitempty" yaml:"version,omitempty"` + VersionPriority int64 `json:"versionPriority,omitempty" yaml:"versionPriority,omitempty"` +} + +type APIServiceCollection struct { + types.Collection + Data []APIService `json:"data,omitempty"` + client *APIServiceClient +} + +type APIServiceClient struct { + apiClient *Client +} + +type APIServiceOperations interface { + List(opts *types.ListOpts) (*APIServiceCollection, error) + Create(opts *APIService) (*APIService, error) + Update(existing *APIService, updates interface{}) (*APIService, error) + Replace(existing *APIService) (*APIService, error) + ByID(id string) (*APIService, error) + Delete(container *APIService) error +} + +func newAPIServiceClient(apiClient *Client) *APIServiceClient { + return &APIServiceClient{ + apiClient: apiClient, + } +} + +func (c *APIServiceClient) Create(container *APIService) (*APIService, error) { + resp := &APIService{} + err := c.apiClient.Ops.DoCreate(APIServiceType, container, resp) + return resp, err +} + +func (c *APIServiceClient) Update(existing *APIService, updates interface{}) (*APIService, error) { + resp := &APIService{} + err := c.apiClient.Ops.DoUpdate(APIServiceType, &existing.Resource, updates, resp) + return resp, err +} + +func (c *APIServiceClient) Replace(obj *APIService) (*APIService, error) { + resp := &APIService{} + err := c.apiClient.Ops.DoReplace(APIServiceType, &obj.Resource, obj, resp) + return resp, err +} + +func (c *APIServiceClient) List(opts *types.ListOpts) (*APIServiceCollection, error) { + resp := &APIServiceCollection{} + err := c.apiClient.Ops.DoList(APIServiceType, opts, resp) + resp.client = c + return resp, err +} + +func (cc *APIServiceCollection) Next() (*APIServiceCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &APIServiceCollection{} + err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *APIServiceClient) ByID(id string) (*APIService, error) { + resp := &APIService{} + err := c.apiClient.Ops.DoByID(APIServiceType, id, resp) + return resp, err +} + +func (c *APIServiceClient) Delete(container *APIService) error { + return c.apiClient.Ops.DoResourceDelete(APIServiceType, &container.Resource) +} diff --git a/client/cluster/v3/zz_generated_api_service_condition.go b/client/cluster/v3/zz_generated_api_service_condition.go new file mode 100644 index 00000000..10b7f6cc --- /dev/null +++ b/client/cluster/v3/zz_generated_api_service_condition.go @@ -0,0 +1,18 @@ +package client + +const ( + APIServiceConditionType = "apiServiceCondition" + APIServiceConditionFieldLastTransitionTime = "lastTransitionTime" + APIServiceConditionFieldMessage = "message" + APIServiceConditionFieldReason = "reason" + APIServiceConditionFieldStatus = "status" + APIServiceConditionFieldType = "type" +) + +type APIServiceCondition struct { + LastTransitionTime string `json:"lastTransitionTime,omitempty" yaml:"lastTransitionTime,omitempty"` + Message string `json:"message,omitempty" yaml:"message,omitempty"` + Reason string `json:"reason,omitempty" yaml:"reason,omitempty"` + Status string `json:"status,omitempty" yaml:"status,omitempty"` + Type string `json:"type,omitempty" yaml:"type,omitempty"` +} diff --git a/client/cluster/v3/zz_generated_api_service_spec.go b/client/cluster/v3/zz_generated_api_service_spec.go new file mode 100644 index 00000000..b8509584 --- /dev/null +++ b/client/cluster/v3/zz_generated_api_service_spec.go @@ -0,0 +1,22 @@ +package client + +const ( + APIServiceSpecType = "apiServiceSpec" + APIServiceSpecFieldCABundle = "caBundle" + APIServiceSpecFieldGroup = "group" + APIServiceSpecFieldGroupPriorityMinimum = "groupPriorityMinimum" + APIServiceSpecFieldInsecureSkipTLSVerify = "insecureSkipTLSVerify" + APIServiceSpecFieldService = "service" + APIServiceSpecFieldVersion = "version" + APIServiceSpecFieldVersionPriority = "versionPriority" +) + +type APIServiceSpec struct { + CABundle string `json:"caBundle,omitempty" yaml:"caBundle,omitempty"` + Group string `json:"group,omitempty" yaml:"group,omitempty"` + GroupPriorityMinimum int64 `json:"groupPriorityMinimum,omitempty" yaml:"groupPriorityMinimum,omitempty"` + InsecureSkipTLSVerify bool `json:"insecureSkipTLSVerify,omitempty" yaml:"insecureSkipTLSVerify,omitempty"` + Service *ServiceReference `json:"service,omitempty" yaml:"service,omitempty"` + Version string `json:"version,omitempty" yaml:"version,omitempty"` + VersionPriority int64 `json:"versionPriority,omitempty" yaml:"versionPriority,omitempty"` +} diff --git a/client/cluster/v3/zz_generated_api_service_status.go b/client/cluster/v3/zz_generated_api_service_status.go new file mode 100644 index 00000000..4e9b11fb --- /dev/null +++ b/client/cluster/v3/zz_generated_api_service_status.go @@ -0,0 +1,10 @@ +package client + +const ( + APIServiceStatusType = "apiServiceStatus" + APIServiceStatusFieldConditions = "conditions" +) + +type APIServiceStatus struct { + Conditions []APIServiceCondition `json:"conditions,omitempty" yaml:"conditions,omitempty"` +} diff --git a/client/cluster/v3/zz_generated_client.go b/client/cluster/v3/zz_generated_client.go index 49b525ff..1f18a9b5 100644 --- a/client/cluster/v3/zz_generated_client.go +++ b/client/cluster/v3/zz_generated_client.go @@ -10,6 +10,7 @@ type Client struct { Namespace NamespaceOperations PersistentVolume PersistentVolumeOperations StorageClass StorageClassOperations + APIService APIServiceOperations } func NewClient(opts *clientbase.ClientOpts) (*Client, error) { @@ -25,6 +26,7 @@ func NewClient(opts *clientbase.ClientOpts) (*Client, error) { client.Namespace = newNamespaceClient(client) client.PersistentVolume = newPersistentVolumeClient(client) client.StorageClass = newStorageClassClient(client) + client.APIService = newAPIServiceClient(client) return client, nil } diff --git a/client/cluster/v3/zz_generated_service_reference.go b/client/cluster/v3/zz_generated_service_reference.go new file mode 100644 index 00000000..9795642e --- /dev/null +++ b/client/cluster/v3/zz_generated_service_reference.go @@ -0,0 +1,12 @@ +package client + +const ( + ServiceReferenceType = "serviceReference" + ServiceReferenceFieldName = "name" + ServiceReferenceFieldNamespace = "namespace" +) + +type ServiceReference struct { + Name string `json:"name,omitempty" yaml:"name,omitempty"` + Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"` +} diff --git a/compose/zz_generated_compose.go b/compose/zz_generated_compose.go index cfe1e3f9..cbaff78f 100644 --- a/compose/zz_generated_compose.go +++ b/compose/zz_generated_compose.go @@ -73,6 +73,7 @@ type Config struct { Namespaces map[string]clusterClient.Namespace `json:"namespaces,omitempty" yaml:"namespaces,omitempty"` PersistentVolumes map[string]clusterClient.PersistentVolume `json:"persistentVolumes,omitempty" yaml:"persistentVolumes,omitempty"` StorageClasss map[string]clusterClient.StorageClass `json:"storageClasses,omitempty" yaml:"storageClasses,omitempty"` + APIServices map[string]clusterClient.APIService `json:"apiServices,omitempty" yaml:"apiServices,omitempty"` // Project Client PersistentVolumeClaims map[string]projectClient.PersistentVolumeClaim `json:"persistentVolumeClaims,omitempty" yaml:"persistentVolumeClaims,omitempty"`