diff --git a/apis/autoscaling/v2beta2/fakes/zz_generated_horizontal_pod_autoscaler_mock.go b/apis/autoscaling/v2beta2/fakes/zz_generated_horizontal_pod_autoscaler_mock.go new file mode 100644 index 00000000..42affce6 --- /dev/null +++ b/apis/autoscaling/v2beta2/fakes/zz_generated_horizontal_pod_autoscaler_mock.go @@ -0,0 +1,1357 @@ +// 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" + v2beta2a "github.com/rancher/types/apis/autoscaling/v2beta2" + v2beta2 "k8s.io/api/autoscaling/v2beta2" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +var ( + lockHorizontalPodAutoscalerListerMockGet sync.RWMutex + lockHorizontalPodAutoscalerListerMockList sync.RWMutex +) + +// Ensure, that HorizontalPodAutoscalerListerMock does implement HorizontalPodAutoscalerLister. +// If this is not the case, regenerate this file with moq. +var _ v2beta2a.HorizontalPodAutoscalerLister = &HorizontalPodAutoscalerListerMock{} + +// HorizontalPodAutoscalerListerMock is a mock implementation of HorizontalPodAutoscalerLister. +// +// func TestSomethingThatUsesHorizontalPodAutoscalerLister(t *testing.T) { +// +// // make and configure a mocked HorizontalPodAutoscalerLister +// mockedHorizontalPodAutoscalerLister := &HorizontalPodAutoscalerListerMock{ +// GetFunc: func(namespace string, name string) (*v2beta2.HorizontalPodAutoscaler, error) { +// panic("mock out the Get method") +// }, +// ListFunc: func(namespace string, selector labels.Selector) ([]*v2beta2.HorizontalPodAutoscaler, error) { +// panic("mock out the List method") +// }, +// } +// +// // use mockedHorizontalPodAutoscalerLister in code that requires HorizontalPodAutoscalerLister +// // and then make assertions. +// +// } +type HorizontalPodAutoscalerListerMock struct { + // GetFunc mocks the Get method. + GetFunc func(namespace string, name string) (*v2beta2.HorizontalPodAutoscaler, error) + + // ListFunc mocks the List method. + ListFunc func(namespace string, selector labels.Selector) ([]*v2beta2.HorizontalPodAutoscaler, 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 *HorizontalPodAutoscalerListerMock) Get(namespace string, name string) (*v2beta2.HorizontalPodAutoscaler, error) { + if mock.GetFunc == nil { + panic("HorizontalPodAutoscalerListerMock.GetFunc: method is nil but HorizontalPodAutoscalerLister.Get was just called") + } + callInfo := struct { + Namespace string + Name string + }{ + Namespace: namespace, + Name: name, + } + lockHorizontalPodAutoscalerListerMockGet.Lock() + mock.calls.Get = append(mock.calls.Get, callInfo) + lockHorizontalPodAutoscalerListerMockGet.Unlock() + return mock.GetFunc(namespace, name) +} + +// GetCalls gets all the calls that were made to Get. +// Check the length with: +// len(mockedHorizontalPodAutoscalerLister.GetCalls()) +func (mock *HorizontalPodAutoscalerListerMock) GetCalls() []struct { + Namespace string + Name string +} { + var calls []struct { + Namespace string + Name string + } + lockHorizontalPodAutoscalerListerMockGet.RLock() + calls = mock.calls.Get + lockHorizontalPodAutoscalerListerMockGet.RUnlock() + return calls +} + +// List calls ListFunc. +func (mock *HorizontalPodAutoscalerListerMock) List(namespace string, selector labels.Selector) ([]*v2beta2.HorizontalPodAutoscaler, error) { + if mock.ListFunc == nil { + panic("HorizontalPodAutoscalerListerMock.ListFunc: method is nil but HorizontalPodAutoscalerLister.List was just called") + } + callInfo := struct { + Namespace string + Selector labels.Selector + }{ + Namespace: namespace, + Selector: selector, + } + lockHorizontalPodAutoscalerListerMockList.Lock() + mock.calls.List = append(mock.calls.List, callInfo) + lockHorizontalPodAutoscalerListerMockList.Unlock() + return mock.ListFunc(namespace, selector) +} + +// ListCalls gets all the calls that were made to List. +// Check the length with: +// len(mockedHorizontalPodAutoscalerLister.ListCalls()) +func (mock *HorizontalPodAutoscalerListerMock) ListCalls() []struct { + Namespace string + Selector labels.Selector +} { + var calls []struct { + Namespace string + Selector labels.Selector + } + lockHorizontalPodAutoscalerListerMockList.RLock() + calls = mock.calls.List + lockHorizontalPodAutoscalerListerMockList.RUnlock() + return calls +} + +var ( + lockHorizontalPodAutoscalerControllerMockAddClusterScopedHandler sync.RWMutex + lockHorizontalPodAutoscalerControllerMockAddHandler sync.RWMutex + lockHorizontalPodAutoscalerControllerMockEnqueue sync.RWMutex + lockHorizontalPodAutoscalerControllerMockGeneric sync.RWMutex + lockHorizontalPodAutoscalerControllerMockInformer sync.RWMutex + lockHorizontalPodAutoscalerControllerMockLister sync.RWMutex + lockHorizontalPodAutoscalerControllerMockStart sync.RWMutex + lockHorizontalPodAutoscalerControllerMockSync sync.RWMutex +) + +// Ensure, that HorizontalPodAutoscalerControllerMock does implement HorizontalPodAutoscalerController. +// If this is not the case, regenerate this file with moq. +var _ v2beta2a.HorizontalPodAutoscalerController = &HorizontalPodAutoscalerControllerMock{} + +// HorizontalPodAutoscalerControllerMock is a mock implementation of HorizontalPodAutoscalerController. +// +// func TestSomethingThatUsesHorizontalPodAutoscalerController(t *testing.T) { +// +// // make and configure a mocked HorizontalPodAutoscalerController +// mockedHorizontalPodAutoscalerController := &HorizontalPodAutoscalerControllerMock{ +// AddClusterScopedHandlerFunc: func(ctx context.Context, name string, clusterName string, handler v2beta2a.HorizontalPodAutoscalerHandlerFunc) { +// panic("mock out the AddClusterScopedHandler method") +// }, +// AddHandlerFunc: func(ctx context.Context, name string, handler v2beta2a.HorizontalPodAutoscalerHandlerFunc) { +// 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() v2beta2a.HorizontalPodAutoscalerLister { +// 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 mockedHorizontalPodAutoscalerController in code that requires HorizontalPodAutoscalerController +// // and then make assertions. +// +// } +type HorizontalPodAutoscalerControllerMock struct { + // AddClusterScopedHandlerFunc mocks the AddClusterScopedHandler method. + AddClusterScopedHandlerFunc func(ctx context.Context, name string, clusterName string, handler v2beta2a.HorizontalPodAutoscalerHandlerFunc) + + // AddHandlerFunc mocks the AddHandler method. + AddHandlerFunc func(ctx context.Context, name string, handler v2beta2a.HorizontalPodAutoscalerHandlerFunc) + + // 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() v2beta2a.HorizontalPodAutoscalerLister + + // 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 { + // 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 v2beta2a.HorizontalPodAutoscalerHandlerFunc + } + // 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 v2beta2a.HorizontalPodAutoscalerHandlerFunc + } + // 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 + } + } +} + +// AddClusterScopedHandler calls AddClusterScopedHandlerFunc. +func (mock *HorizontalPodAutoscalerControllerMock) AddClusterScopedHandler(ctx context.Context, name string, clusterName string, handler v2beta2a.HorizontalPodAutoscalerHandlerFunc) { + if mock.AddClusterScopedHandlerFunc == nil { + panic("HorizontalPodAutoscalerControllerMock.AddClusterScopedHandlerFunc: method is nil but HorizontalPodAutoscalerController.AddClusterScopedHandler was just called") + } + callInfo := struct { + Ctx context.Context + Name string + ClusterName string + Handler v2beta2a.HorizontalPodAutoscalerHandlerFunc + }{ + Ctx: ctx, + Name: name, + ClusterName: clusterName, + Handler: handler, + } + lockHorizontalPodAutoscalerControllerMockAddClusterScopedHandler.Lock() + mock.calls.AddClusterScopedHandler = append(mock.calls.AddClusterScopedHandler, callInfo) + lockHorizontalPodAutoscalerControllerMockAddClusterScopedHandler.Unlock() + mock.AddClusterScopedHandlerFunc(ctx, name, clusterName, handler) +} + +// AddClusterScopedHandlerCalls gets all the calls that were made to AddClusterScopedHandler. +// Check the length with: +// len(mockedHorizontalPodAutoscalerController.AddClusterScopedHandlerCalls()) +func (mock *HorizontalPodAutoscalerControllerMock) AddClusterScopedHandlerCalls() []struct { + Ctx context.Context + Name string + ClusterName string + Handler v2beta2a.HorizontalPodAutoscalerHandlerFunc +} { + var calls []struct { + Ctx context.Context + Name string + ClusterName string + Handler v2beta2a.HorizontalPodAutoscalerHandlerFunc + } + lockHorizontalPodAutoscalerControllerMockAddClusterScopedHandler.RLock() + calls = mock.calls.AddClusterScopedHandler + lockHorizontalPodAutoscalerControllerMockAddClusterScopedHandler.RUnlock() + return calls +} + +// AddHandler calls AddHandlerFunc. +func (mock *HorizontalPodAutoscalerControllerMock) AddHandler(ctx context.Context, name string, handler v2beta2a.HorizontalPodAutoscalerHandlerFunc) { + if mock.AddHandlerFunc == nil { + panic("HorizontalPodAutoscalerControllerMock.AddHandlerFunc: method is nil but HorizontalPodAutoscalerController.AddHandler was just called") + } + callInfo := struct { + Ctx context.Context + Name string + Handler v2beta2a.HorizontalPodAutoscalerHandlerFunc + }{ + Ctx: ctx, + Name: name, + Handler: handler, + } + lockHorizontalPodAutoscalerControllerMockAddHandler.Lock() + mock.calls.AddHandler = append(mock.calls.AddHandler, callInfo) + lockHorizontalPodAutoscalerControllerMockAddHandler.Unlock() + mock.AddHandlerFunc(ctx, name, handler) +} + +// AddHandlerCalls gets all the calls that were made to AddHandler. +// Check the length with: +// len(mockedHorizontalPodAutoscalerController.AddHandlerCalls()) +func (mock *HorizontalPodAutoscalerControllerMock) AddHandlerCalls() []struct { + Ctx context.Context + Name string + Handler v2beta2a.HorizontalPodAutoscalerHandlerFunc +} { + var calls []struct { + Ctx context.Context + Name string + Handler v2beta2a.HorizontalPodAutoscalerHandlerFunc + } + lockHorizontalPodAutoscalerControllerMockAddHandler.RLock() + calls = mock.calls.AddHandler + lockHorizontalPodAutoscalerControllerMockAddHandler.RUnlock() + return calls +} + +// Enqueue calls EnqueueFunc. +func (mock *HorizontalPodAutoscalerControllerMock) Enqueue(namespace string, name string) { + if mock.EnqueueFunc == nil { + panic("HorizontalPodAutoscalerControllerMock.EnqueueFunc: method is nil but HorizontalPodAutoscalerController.Enqueue was just called") + } + callInfo := struct { + Namespace string + Name string + }{ + Namespace: namespace, + Name: name, + } + lockHorizontalPodAutoscalerControllerMockEnqueue.Lock() + mock.calls.Enqueue = append(mock.calls.Enqueue, callInfo) + lockHorizontalPodAutoscalerControllerMockEnqueue.Unlock() + mock.EnqueueFunc(namespace, name) +} + +// EnqueueCalls gets all the calls that were made to Enqueue. +// Check the length with: +// len(mockedHorizontalPodAutoscalerController.EnqueueCalls()) +func (mock *HorizontalPodAutoscalerControllerMock) EnqueueCalls() []struct { + Namespace string + Name string +} { + var calls []struct { + Namespace string + Name string + } + lockHorizontalPodAutoscalerControllerMockEnqueue.RLock() + calls = mock.calls.Enqueue + lockHorizontalPodAutoscalerControllerMockEnqueue.RUnlock() + return calls +} + +// Generic calls GenericFunc. +func (mock *HorizontalPodAutoscalerControllerMock) Generic() controller.GenericController { + if mock.GenericFunc == nil { + panic("HorizontalPodAutoscalerControllerMock.GenericFunc: method is nil but HorizontalPodAutoscalerController.Generic was just called") + } + callInfo := struct { + }{} + lockHorizontalPodAutoscalerControllerMockGeneric.Lock() + mock.calls.Generic = append(mock.calls.Generic, callInfo) + lockHorizontalPodAutoscalerControllerMockGeneric.Unlock() + return mock.GenericFunc() +} + +// GenericCalls gets all the calls that were made to Generic. +// Check the length with: +// len(mockedHorizontalPodAutoscalerController.GenericCalls()) +func (mock *HorizontalPodAutoscalerControllerMock) GenericCalls() []struct { +} { + var calls []struct { + } + lockHorizontalPodAutoscalerControllerMockGeneric.RLock() + calls = mock.calls.Generic + lockHorizontalPodAutoscalerControllerMockGeneric.RUnlock() + return calls +} + +// Informer calls InformerFunc. +func (mock *HorizontalPodAutoscalerControllerMock) Informer() cache.SharedIndexInformer { + if mock.InformerFunc == nil { + panic("HorizontalPodAutoscalerControllerMock.InformerFunc: method is nil but HorizontalPodAutoscalerController.Informer was just called") + } + callInfo := struct { + }{} + lockHorizontalPodAutoscalerControllerMockInformer.Lock() + mock.calls.Informer = append(mock.calls.Informer, callInfo) + lockHorizontalPodAutoscalerControllerMockInformer.Unlock() + return mock.InformerFunc() +} + +// InformerCalls gets all the calls that were made to Informer. +// Check the length with: +// len(mockedHorizontalPodAutoscalerController.InformerCalls()) +func (mock *HorizontalPodAutoscalerControllerMock) InformerCalls() []struct { +} { + var calls []struct { + } + lockHorizontalPodAutoscalerControllerMockInformer.RLock() + calls = mock.calls.Informer + lockHorizontalPodAutoscalerControllerMockInformer.RUnlock() + return calls +} + +// Lister calls ListerFunc. +func (mock *HorizontalPodAutoscalerControllerMock) Lister() v2beta2a.HorizontalPodAutoscalerLister { + if mock.ListerFunc == nil { + panic("HorizontalPodAutoscalerControllerMock.ListerFunc: method is nil but HorizontalPodAutoscalerController.Lister was just called") + } + callInfo := struct { + }{} + lockHorizontalPodAutoscalerControllerMockLister.Lock() + mock.calls.Lister = append(mock.calls.Lister, callInfo) + lockHorizontalPodAutoscalerControllerMockLister.Unlock() + return mock.ListerFunc() +} + +// ListerCalls gets all the calls that were made to Lister. +// Check the length with: +// len(mockedHorizontalPodAutoscalerController.ListerCalls()) +func (mock *HorizontalPodAutoscalerControllerMock) ListerCalls() []struct { +} { + var calls []struct { + } + lockHorizontalPodAutoscalerControllerMockLister.RLock() + calls = mock.calls.Lister + lockHorizontalPodAutoscalerControllerMockLister.RUnlock() + return calls +} + +// Start calls StartFunc. +func (mock *HorizontalPodAutoscalerControllerMock) Start(ctx context.Context, threadiness int) error { + if mock.StartFunc == nil { + panic("HorizontalPodAutoscalerControllerMock.StartFunc: method is nil but HorizontalPodAutoscalerController.Start was just called") + } + callInfo := struct { + Ctx context.Context + Threadiness int + }{ + Ctx: ctx, + Threadiness: threadiness, + } + lockHorizontalPodAutoscalerControllerMockStart.Lock() + mock.calls.Start = append(mock.calls.Start, callInfo) + lockHorizontalPodAutoscalerControllerMockStart.Unlock() + return mock.StartFunc(ctx, threadiness) +} + +// StartCalls gets all the calls that were made to Start. +// Check the length with: +// len(mockedHorizontalPodAutoscalerController.StartCalls()) +func (mock *HorizontalPodAutoscalerControllerMock) StartCalls() []struct { + Ctx context.Context + Threadiness int +} { + var calls []struct { + Ctx context.Context + Threadiness int + } + lockHorizontalPodAutoscalerControllerMockStart.RLock() + calls = mock.calls.Start + lockHorizontalPodAutoscalerControllerMockStart.RUnlock() + return calls +} + +// Sync calls SyncFunc. +func (mock *HorizontalPodAutoscalerControllerMock) Sync(ctx context.Context) error { + if mock.SyncFunc == nil { + panic("HorizontalPodAutoscalerControllerMock.SyncFunc: method is nil but HorizontalPodAutoscalerController.Sync was just called") + } + callInfo := struct { + Ctx context.Context + }{ + Ctx: ctx, + } + lockHorizontalPodAutoscalerControllerMockSync.Lock() + mock.calls.Sync = append(mock.calls.Sync, callInfo) + lockHorizontalPodAutoscalerControllerMockSync.Unlock() + return mock.SyncFunc(ctx) +} + +// SyncCalls gets all the calls that were made to Sync. +// Check the length with: +// len(mockedHorizontalPodAutoscalerController.SyncCalls()) +func (mock *HorizontalPodAutoscalerControllerMock) SyncCalls() []struct { + Ctx context.Context +} { + var calls []struct { + Ctx context.Context + } + lockHorizontalPodAutoscalerControllerMockSync.RLock() + calls = mock.calls.Sync + lockHorizontalPodAutoscalerControllerMockSync.RUnlock() + return calls +} + +var ( + lockHorizontalPodAutoscalerInterfaceMockAddClusterScopedHandler sync.RWMutex + lockHorizontalPodAutoscalerInterfaceMockAddClusterScopedLifecycle sync.RWMutex + lockHorizontalPodAutoscalerInterfaceMockAddHandler sync.RWMutex + lockHorizontalPodAutoscalerInterfaceMockAddLifecycle sync.RWMutex + lockHorizontalPodAutoscalerInterfaceMockController sync.RWMutex + lockHorizontalPodAutoscalerInterfaceMockCreate sync.RWMutex + lockHorizontalPodAutoscalerInterfaceMockDelete sync.RWMutex + lockHorizontalPodAutoscalerInterfaceMockDeleteCollection sync.RWMutex + lockHorizontalPodAutoscalerInterfaceMockDeleteNamespaced sync.RWMutex + lockHorizontalPodAutoscalerInterfaceMockGet sync.RWMutex + lockHorizontalPodAutoscalerInterfaceMockGetNamespaced sync.RWMutex + lockHorizontalPodAutoscalerInterfaceMockList sync.RWMutex + lockHorizontalPodAutoscalerInterfaceMockObjectClient sync.RWMutex + lockHorizontalPodAutoscalerInterfaceMockUpdate sync.RWMutex + lockHorizontalPodAutoscalerInterfaceMockWatch sync.RWMutex +) + +// Ensure, that HorizontalPodAutoscalerInterfaceMock does implement HorizontalPodAutoscalerInterface. +// If this is not the case, regenerate this file with moq. +var _ v2beta2a.HorizontalPodAutoscalerInterface = &HorizontalPodAutoscalerInterfaceMock{} + +// HorizontalPodAutoscalerInterfaceMock is a mock implementation of HorizontalPodAutoscalerInterface. +// +// func TestSomethingThatUsesHorizontalPodAutoscalerInterface(t *testing.T) { +// +// // make and configure a mocked HorizontalPodAutoscalerInterface +// mockedHorizontalPodAutoscalerInterface := &HorizontalPodAutoscalerInterfaceMock{ +// AddClusterScopedHandlerFunc: func(ctx context.Context, name string, clusterName string, sync v2beta2a.HorizontalPodAutoscalerHandlerFunc) { +// panic("mock out the AddClusterScopedHandler method") +// }, +// AddClusterScopedLifecycleFunc: func(ctx context.Context, name string, clusterName string, lifecycle v2beta2a.HorizontalPodAutoscalerLifecycle) { +// panic("mock out the AddClusterScopedLifecycle method") +// }, +// AddHandlerFunc: func(ctx context.Context, name string, sync v2beta2a.HorizontalPodAutoscalerHandlerFunc) { +// panic("mock out the AddHandler method") +// }, +// AddLifecycleFunc: func(ctx context.Context, name string, lifecycle v2beta2a.HorizontalPodAutoscalerLifecycle) { +// panic("mock out the AddLifecycle method") +// }, +// ControllerFunc: func() v2beta2a.HorizontalPodAutoscalerController { +// panic("mock out the Controller method") +// }, +// CreateFunc: func(in1 *v2beta2.HorizontalPodAutoscaler) (*v2beta2.HorizontalPodAutoscaler, error) { +// panic("mock out the Create method") +// }, +// DeleteFunc: func(name string, options *v1.DeleteOptions) error { +// panic("mock out the Delete method") +// }, +// DeleteCollectionFunc: func(deleteOpts *v1.DeleteOptions, listOpts v1.ListOptions) error { +// panic("mock out the DeleteCollection method") +// }, +// DeleteNamespacedFunc: func(namespace string, name string, options *v1.DeleteOptions) error { +// panic("mock out the DeleteNamespaced method") +// }, +// GetFunc: func(name string, opts v1.GetOptions) (*v2beta2.HorizontalPodAutoscaler, error) { +// panic("mock out the Get method") +// }, +// GetNamespacedFunc: func(namespace string, name string, opts v1.GetOptions) (*v2beta2.HorizontalPodAutoscaler, error) { +// panic("mock out the GetNamespaced method") +// }, +// ListFunc: func(opts v1.ListOptions) (*v2beta2a.HorizontalPodAutoscalerList, error) { +// panic("mock out the List method") +// }, +// ObjectClientFunc: func() *objectclient.ObjectClient { +// panic("mock out the ObjectClient method") +// }, +// UpdateFunc: func(in1 *v2beta2.HorizontalPodAutoscaler) (*v2beta2.HorizontalPodAutoscaler, error) { +// panic("mock out the Update method") +// }, +// WatchFunc: func(opts v1.ListOptions) (watch.Interface, error) { +// panic("mock out the Watch method") +// }, +// } +// +// // use mockedHorizontalPodAutoscalerInterface in code that requires HorizontalPodAutoscalerInterface +// // and then make assertions. +// +// } +type HorizontalPodAutoscalerInterfaceMock struct { + // AddClusterScopedHandlerFunc mocks the AddClusterScopedHandler method. + AddClusterScopedHandlerFunc func(ctx context.Context, name string, clusterName string, sync v2beta2a.HorizontalPodAutoscalerHandlerFunc) + + // AddClusterScopedLifecycleFunc mocks the AddClusterScopedLifecycle method. + AddClusterScopedLifecycleFunc func(ctx context.Context, name string, clusterName string, lifecycle v2beta2a.HorizontalPodAutoscalerLifecycle) + + // AddHandlerFunc mocks the AddHandler method. + AddHandlerFunc func(ctx context.Context, name string, sync v2beta2a.HorizontalPodAutoscalerHandlerFunc) + + // AddLifecycleFunc mocks the AddLifecycle method. + AddLifecycleFunc func(ctx context.Context, name string, lifecycle v2beta2a.HorizontalPodAutoscalerLifecycle) + + // ControllerFunc mocks the Controller method. + ControllerFunc func() v2beta2a.HorizontalPodAutoscalerController + + // CreateFunc mocks the Create method. + CreateFunc func(in1 *v2beta2.HorizontalPodAutoscaler) (*v2beta2.HorizontalPodAutoscaler, error) + + // DeleteFunc mocks the Delete method. + DeleteFunc func(name string, options *v1.DeleteOptions) error + + // DeleteCollectionFunc mocks the DeleteCollection method. + DeleteCollectionFunc func(deleteOpts *v1.DeleteOptions, listOpts v1.ListOptions) error + + // DeleteNamespacedFunc mocks the DeleteNamespaced method. + DeleteNamespacedFunc func(namespace string, name string, options *v1.DeleteOptions) error + + // GetFunc mocks the Get method. + GetFunc func(name string, opts v1.GetOptions) (*v2beta2.HorizontalPodAutoscaler, error) + + // GetNamespacedFunc mocks the GetNamespaced method. + GetNamespacedFunc func(namespace string, name string, opts v1.GetOptions) (*v2beta2.HorizontalPodAutoscaler, error) + + // ListFunc mocks the List method. + ListFunc func(opts v1.ListOptions) (*v2beta2a.HorizontalPodAutoscalerList, error) + + // ObjectClientFunc mocks the ObjectClient method. + ObjectClientFunc func() *objectclient.ObjectClient + + // UpdateFunc mocks the Update method. + UpdateFunc func(in1 *v2beta2.HorizontalPodAutoscaler) (*v2beta2.HorizontalPodAutoscaler, error) + + // WatchFunc mocks the Watch method. + WatchFunc func(opts v1.ListOptions) (watch.Interface, error) + + // calls tracks calls to the methods. + calls struct { + // 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 v2beta2a.HorizontalPodAutoscalerHandlerFunc + } + // 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 v2beta2a.HorizontalPodAutoscalerLifecycle + } + // 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 v2beta2a.HorizontalPodAutoscalerHandlerFunc + } + // 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 v2beta2a.HorizontalPodAutoscalerLifecycle + } + // 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 *v2beta2.HorizontalPodAutoscaler + } + // Delete holds details about calls to the Delete method. + Delete []struct { + // Name is the name argument value. + Name string + // Options is the options argument value. + Options *v1.DeleteOptions + } + // DeleteCollection holds details about calls to the DeleteCollection method. + DeleteCollection []struct { + // DeleteOpts is the deleteOpts argument value. + DeleteOpts *v1.DeleteOptions + // ListOpts is the listOpts argument value. + ListOpts v1.ListOptions + } + // DeleteNamespaced holds details about calls to the DeleteNamespaced method. + DeleteNamespaced []struct { + // Namespace is the namespace argument value. + Namespace string + // Name is the name argument value. + Name string + // Options is the options argument value. + Options *v1.DeleteOptions + } + // Get holds details about calls to the Get method. + Get []struct { + // Name is the name argument value. + Name string + // Opts is the opts argument value. + Opts v1.GetOptions + } + // GetNamespaced holds details about calls to the GetNamespaced method. + GetNamespaced []struct { + // Namespace is the namespace argument value. + Namespace string + // Name is the name argument value. + Name string + // Opts is the opts argument value. + Opts v1.GetOptions + } + // List holds details about calls to the List method. + List []struct { + // Opts is the opts argument value. + Opts v1.ListOptions + } + // 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 *v2beta2.HorizontalPodAutoscaler + } + // Watch holds details about calls to the Watch method. + Watch []struct { + // Opts is the opts argument value. + Opts v1.ListOptions + } + } +} + +// AddClusterScopedHandler calls AddClusterScopedHandlerFunc. +func (mock *HorizontalPodAutoscalerInterfaceMock) AddClusterScopedHandler(ctx context.Context, name string, clusterName string, sync v2beta2a.HorizontalPodAutoscalerHandlerFunc) { + if mock.AddClusterScopedHandlerFunc == nil { + panic("HorizontalPodAutoscalerInterfaceMock.AddClusterScopedHandlerFunc: method is nil but HorizontalPodAutoscalerInterface.AddClusterScopedHandler was just called") + } + callInfo := struct { + Ctx context.Context + Name string + ClusterName string + Sync v2beta2a.HorizontalPodAutoscalerHandlerFunc + }{ + Ctx: ctx, + Name: name, + ClusterName: clusterName, + Sync: sync, + } + lockHorizontalPodAutoscalerInterfaceMockAddClusterScopedHandler.Lock() + mock.calls.AddClusterScopedHandler = append(mock.calls.AddClusterScopedHandler, callInfo) + lockHorizontalPodAutoscalerInterfaceMockAddClusterScopedHandler.Unlock() + mock.AddClusterScopedHandlerFunc(ctx, name, clusterName, sync) +} + +// AddClusterScopedHandlerCalls gets all the calls that were made to AddClusterScopedHandler. +// Check the length with: +// len(mockedHorizontalPodAutoscalerInterface.AddClusterScopedHandlerCalls()) +func (mock *HorizontalPodAutoscalerInterfaceMock) AddClusterScopedHandlerCalls() []struct { + Ctx context.Context + Name string + ClusterName string + Sync v2beta2a.HorizontalPodAutoscalerHandlerFunc +} { + var calls []struct { + Ctx context.Context + Name string + ClusterName string + Sync v2beta2a.HorizontalPodAutoscalerHandlerFunc + } + lockHorizontalPodAutoscalerInterfaceMockAddClusterScopedHandler.RLock() + calls = mock.calls.AddClusterScopedHandler + lockHorizontalPodAutoscalerInterfaceMockAddClusterScopedHandler.RUnlock() + return calls +} + +// AddClusterScopedLifecycle calls AddClusterScopedLifecycleFunc. +func (mock *HorizontalPodAutoscalerInterfaceMock) AddClusterScopedLifecycle(ctx context.Context, name string, clusterName string, lifecycle v2beta2a.HorizontalPodAutoscalerLifecycle) { + if mock.AddClusterScopedLifecycleFunc == nil { + panic("HorizontalPodAutoscalerInterfaceMock.AddClusterScopedLifecycleFunc: method is nil but HorizontalPodAutoscalerInterface.AddClusterScopedLifecycle was just called") + } + callInfo := struct { + Ctx context.Context + Name string + ClusterName string + Lifecycle v2beta2a.HorizontalPodAutoscalerLifecycle + }{ + Ctx: ctx, + Name: name, + ClusterName: clusterName, + Lifecycle: lifecycle, + } + lockHorizontalPodAutoscalerInterfaceMockAddClusterScopedLifecycle.Lock() + mock.calls.AddClusterScopedLifecycle = append(mock.calls.AddClusterScopedLifecycle, callInfo) + lockHorizontalPodAutoscalerInterfaceMockAddClusterScopedLifecycle.Unlock() + mock.AddClusterScopedLifecycleFunc(ctx, name, clusterName, lifecycle) +} + +// AddClusterScopedLifecycleCalls gets all the calls that were made to AddClusterScopedLifecycle. +// Check the length with: +// len(mockedHorizontalPodAutoscalerInterface.AddClusterScopedLifecycleCalls()) +func (mock *HorizontalPodAutoscalerInterfaceMock) AddClusterScopedLifecycleCalls() []struct { + Ctx context.Context + Name string + ClusterName string + Lifecycle v2beta2a.HorizontalPodAutoscalerLifecycle +} { + var calls []struct { + Ctx context.Context + Name string + ClusterName string + Lifecycle v2beta2a.HorizontalPodAutoscalerLifecycle + } + lockHorizontalPodAutoscalerInterfaceMockAddClusterScopedLifecycle.RLock() + calls = mock.calls.AddClusterScopedLifecycle + lockHorizontalPodAutoscalerInterfaceMockAddClusterScopedLifecycle.RUnlock() + return calls +} + +// AddHandler calls AddHandlerFunc. +func (mock *HorizontalPodAutoscalerInterfaceMock) AddHandler(ctx context.Context, name string, sync v2beta2a.HorizontalPodAutoscalerHandlerFunc) { + if mock.AddHandlerFunc == nil { + panic("HorizontalPodAutoscalerInterfaceMock.AddHandlerFunc: method is nil but HorizontalPodAutoscalerInterface.AddHandler was just called") + } + callInfo := struct { + Ctx context.Context + Name string + Sync v2beta2a.HorizontalPodAutoscalerHandlerFunc + }{ + Ctx: ctx, + Name: name, + Sync: sync, + } + lockHorizontalPodAutoscalerInterfaceMockAddHandler.Lock() + mock.calls.AddHandler = append(mock.calls.AddHandler, callInfo) + lockHorizontalPodAutoscalerInterfaceMockAddHandler.Unlock() + mock.AddHandlerFunc(ctx, name, sync) +} + +// AddHandlerCalls gets all the calls that were made to AddHandler. +// Check the length with: +// len(mockedHorizontalPodAutoscalerInterface.AddHandlerCalls()) +func (mock *HorizontalPodAutoscalerInterfaceMock) AddHandlerCalls() []struct { + Ctx context.Context + Name string + Sync v2beta2a.HorizontalPodAutoscalerHandlerFunc +} { + var calls []struct { + Ctx context.Context + Name string + Sync v2beta2a.HorizontalPodAutoscalerHandlerFunc + } + lockHorizontalPodAutoscalerInterfaceMockAddHandler.RLock() + calls = mock.calls.AddHandler + lockHorizontalPodAutoscalerInterfaceMockAddHandler.RUnlock() + return calls +} + +// AddLifecycle calls AddLifecycleFunc. +func (mock *HorizontalPodAutoscalerInterfaceMock) AddLifecycle(ctx context.Context, name string, lifecycle v2beta2a.HorizontalPodAutoscalerLifecycle) { + if mock.AddLifecycleFunc == nil { + panic("HorizontalPodAutoscalerInterfaceMock.AddLifecycleFunc: method is nil but HorizontalPodAutoscalerInterface.AddLifecycle was just called") + } + callInfo := struct { + Ctx context.Context + Name string + Lifecycle v2beta2a.HorizontalPodAutoscalerLifecycle + }{ + Ctx: ctx, + Name: name, + Lifecycle: lifecycle, + } + lockHorizontalPodAutoscalerInterfaceMockAddLifecycle.Lock() + mock.calls.AddLifecycle = append(mock.calls.AddLifecycle, callInfo) + lockHorizontalPodAutoscalerInterfaceMockAddLifecycle.Unlock() + mock.AddLifecycleFunc(ctx, name, lifecycle) +} + +// AddLifecycleCalls gets all the calls that were made to AddLifecycle. +// Check the length with: +// len(mockedHorizontalPodAutoscalerInterface.AddLifecycleCalls()) +func (mock *HorizontalPodAutoscalerInterfaceMock) AddLifecycleCalls() []struct { + Ctx context.Context + Name string + Lifecycle v2beta2a.HorizontalPodAutoscalerLifecycle +} { + var calls []struct { + Ctx context.Context + Name string + Lifecycle v2beta2a.HorizontalPodAutoscalerLifecycle + } + lockHorizontalPodAutoscalerInterfaceMockAddLifecycle.RLock() + calls = mock.calls.AddLifecycle + lockHorizontalPodAutoscalerInterfaceMockAddLifecycle.RUnlock() + return calls +} + +// Controller calls ControllerFunc. +func (mock *HorizontalPodAutoscalerInterfaceMock) Controller() v2beta2a.HorizontalPodAutoscalerController { + if mock.ControllerFunc == nil { + panic("HorizontalPodAutoscalerInterfaceMock.ControllerFunc: method is nil but HorizontalPodAutoscalerInterface.Controller was just called") + } + callInfo := struct { + }{} + lockHorizontalPodAutoscalerInterfaceMockController.Lock() + mock.calls.Controller = append(mock.calls.Controller, callInfo) + lockHorizontalPodAutoscalerInterfaceMockController.Unlock() + return mock.ControllerFunc() +} + +// ControllerCalls gets all the calls that were made to Controller. +// Check the length with: +// len(mockedHorizontalPodAutoscalerInterface.ControllerCalls()) +func (mock *HorizontalPodAutoscalerInterfaceMock) ControllerCalls() []struct { +} { + var calls []struct { + } + lockHorizontalPodAutoscalerInterfaceMockController.RLock() + calls = mock.calls.Controller + lockHorizontalPodAutoscalerInterfaceMockController.RUnlock() + return calls +} + +// Create calls CreateFunc. +func (mock *HorizontalPodAutoscalerInterfaceMock) Create(in1 *v2beta2.HorizontalPodAutoscaler) (*v2beta2.HorizontalPodAutoscaler, error) { + if mock.CreateFunc == nil { + panic("HorizontalPodAutoscalerInterfaceMock.CreateFunc: method is nil but HorizontalPodAutoscalerInterface.Create was just called") + } + callInfo := struct { + In1 *v2beta2.HorizontalPodAutoscaler + }{ + In1: in1, + } + lockHorizontalPodAutoscalerInterfaceMockCreate.Lock() + mock.calls.Create = append(mock.calls.Create, callInfo) + lockHorizontalPodAutoscalerInterfaceMockCreate.Unlock() + return mock.CreateFunc(in1) +} + +// CreateCalls gets all the calls that were made to Create. +// Check the length with: +// len(mockedHorizontalPodAutoscalerInterface.CreateCalls()) +func (mock *HorizontalPodAutoscalerInterfaceMock) CreateCalls() []struct { + In1 *v2beta2.HorizontalPodAutoscaler +} { + var calls []struct { + In1 *v2beta2.HorizontalPodAutoscaler + } + lockHorizontalPodAutoscalerInterfaceMockCreate.RLock() + calls = mock.calls.Create + lockHorizontalPodAutoscalerInterfaceMockCreate.RUnlock() + return calls +} + +// Delete calls DeleteFunc. +func (mock *HorizontalPodAutoscalerInterfaceMock) Delete(name string, options *v1.DeleteOptions) error { + if mock.DeleteFunc == nil { + panic("HorizontalPodAutoscalerInterfaceMock.DeleteFunc: method is nil but HorizontalPodAutoscalerInterface.Delete was just called") + } + callInfo := struct { + Name string + Options *v1.DeleteOptions + }{ + Name: name, + Options: options, + } + lockHorizontalPodAutoscalerInterfaceMockDelete.Lock() + mock.calls.Delete = append(mock.calls.Delete, callInfo) + lockHorizontalPodAutoscalerInterfaceMockDelete.Unlock() + return mock.DeleteFunc(name, options) +} + +// DeleteCalls gets all the calls that were made to Delete. +// Check the length with: +// len(mockedHorizontalPodAutoscalerInterface.DeleteCalls()) +func (mock *HorizontalPodAutoscalerInterfaceMock) DeleteCalls() []struct { + Name string + Options *v1.DeleteOptions +} { + var calls []struct { + Name string + Options *v1.DeleteOptions + } + lockHorizontalPodAutoscalerInterfaceMockDelete.RLock() + calls = mock.calls.Delete + lockHorizontalPodAutoscalerInterfaceMockDelete.RUnlock() + return calls +} + +// DeleteCollection calls DeleteCollectionFunc. +func (mock *HorizontalPodAutoscalerInterfaceMock) DeleteCollection(deleteOpts *v1.DeleteOptions, listOpts v1.ListOptions) error { + if mock.DeleteCollectionFunc == nil { + panic("HorizontalPodAutoscalerInterfaceMock.DeleteCollectionFunc: method is nil but HorizontalPodAutoscalerInterface.DeleteCollection was just called") + } + callInfo := struct { + DeleteOpts *v1.DeleteOptions + ListOpts v1.ListOptions + }{ + DeleteOpts: deleteOpts, + ListOpts: listOpts, + } + lockHorizontalPodAutoscalerInterfaceMockDeleteCollection.Lock() + mock.calls.DeleteCollection = append(mock.calls.DeleteCollection, callInfo) + lockHorizontalPodAutoscalerInterfaceMockDeleteCollection.Unlock() + return mock.DeleteCollectionFunc(deleteOpts, listOpts) +} + +// DeleteCollectionCalls gets all the calls that were made to DeleteCollection. +// Check the length with: +// len(mockedHorizontalPodAutoscalerInterface.DeleteCollectionCalls()) +func (mock *HorizontalPodAutoscalerInterfaceMock) DeleteCollectionCalls() []struct { + DeleteOpts *v1.DeleteOptions + ListOpts v1.ListOptions +} { + var calls []struct { + DeleteOpts *v1.DeleteOptions + ListOpts v1.ListOptions + } + lockHorizontalPodAutoscalerInterfaceMockDeleteCollection.RLock() + calls = mock.calls.DeleteCollection + lockHorizontalPodAutoscalerInterfaceMockDeleteCollection.RUnlock() + return calls +} + +// DeleteNamespaced calls DeleteNamespacedFunc. +func (mock *HorizontalPodAutoscalerInterfaceMock) DeleteNamespaced(namespace string, name string, options *v1.DeleteOptions) error { + if mock.DeleteNamespacedFunc == nil { + panic("HorizontalPodAutoscalerInterfaceMock.DeleteNamespacedFunc: method is nil but HorizontalPodAutoscalerInterface.DeleteNamespaced was just called") + } + callInfo := struct { + Namespace string + Name string + Options *v1.DeleteOptions + }{ + Namespace: namespace, + Name: name, + Options: options, + } + lockHorizontalPodAutoscalerInterfaceMockDeleteNamespaced.Lock() + mock.calls.DeleteNamespaced = append(mock.calls.DeleteNamespaced, callInfo) + lockHorizontalPodAutoscalerInterfaceMockDeleteNamespaced.Unlock() + return mock.DeleteNamespacedFunc(namespace, name, options) +} + +// DeleteNamespacedCalls gets all the calls that were made to DeleteNamespaced. +// Check the length with: +// len(mockedHorizontalPodAutoscalerInterface.DeleteNamespacedCalls()) +func (mock *HorizontalPodAutoscalerInterfaceMock) DeleteNamespacedCalls() []struct { + Namespace string + Name string + Options *v1.DeleteOptions +} { + var calls []struct { + Namespace string + Name string + Options *v1.DeleteOptions + } + lockHorizontalPodAutoscalerInterfaceMockDeleteNamespaced.RLock() + calls = mock.calls.DeleteNamespaced + lockHorizontalPodAutoscalerInterfaceMockDeleteNamespaced.RUnlock() + return calls +} + +// Get calls GetFunc. +func (mock *HorizontalPodAutoscalerInterfaceMock) Get(name string, opts v1.GetOptions) (*v2beta2.HorizontalPodAutoscaler, error) { + if mock.GetFunc == nil { + panic("HorizontalPodAutoscalerInterfaceMock.GetFunc: method is nil but HorizontalPodAutoscalerInterface.Get was just called") + } + callInfo := struct { + Name string + Opts v1.GetOptions + }{ + Name: name, + Opts: opts, + } + lockHorizontalPodAutoscalerInterfaceMockGet.Lock() + mock.calls.Get = append(mock.calls.Get, callInfo) + lockHorizontalPodAutoscalerInterfaceMockGet.Unlock() + return mock.GetFunc(name, opts) +} + +// GetCalls gets all the calls that were made to Get. +// Check the length with: +// len(mockedHorizontalPodAutoscalerInterface.GetCalls()) +func (mock *HorizontalPodAutoscalerInterfaceMock) GetCalls() []struct { + Name string + Opts v1.GetOptions +} { + var calls []struct { + Name string + Opts v1.GetOptions + } + lockHorizontalPodAutoscalerInterfaceMockGet.RLock() + calls = mock.calls.Get + lockHorizontalPodAutoscalerInterfaceMockGet.RUnlock() + return calls +} + +// GetNamespaced calls GetNamespacedFunc. +func (mock *HorizontalPodAutoscalerInterfaceMock) GetNamespaced(namespace string, name string, opts v1.GetOptions) (*v2beta2.HorizontalPodAutoscaler, error) { + if mock.GetNamespacedFunc == nil { + panic("HorizontalPodAutoscalerInterfaceMock.GetNamespacedFunc: method is nil but HorizontalPodAutoscalerInterface.GetNamespaced was just called") + } + callInfo := struct { + Namespace string + Name string + Opts v1.GetOptions + }{ + Namespace: namespace, + Name: name, + Opts: opts, + } + lockHorizontalPodAutoscalerInterfaceMockGetNamespaced.Lock() + mock.calls.GetNamespaced = append(mock.calls.GetNamespaced, callInfo) + lockHorizontalPodAutoscalerInterfaceMockGetNamespaced.Unlock() + return mock.GetNamespacedFunc(namespace, name, opts) +} + +// GetNamespacedCalls gets all the calls that were made to GetNamespaced. +// Check the length with: +// len(mockedHorizontalPodAutoscalerInterface.GetNamespacedCalls()) +func (mock *HorizontalPodAutoscalerInterfaceMock) GetNamespacedCalls() []struct { + Namespace string + Name string + Opts v1.GetOptions +} { + var calls []struct { + Namespace string + Name string + Opts v1.GetOptions + } + lockHorizontalPodAutoscalerInterfaceMockGetNamespaced.RLock() + calls = mock.calls.GetNamespaced + lockHorizontalPodAutoscalerInterfaceMockGetNamespaced.RUnlock() + return calls +} + +// List calls ListFunc. +func (mock *HorizontalPodAutoscalerInterfaceMock) List(opts v1.ListOptions) (*v2beta2a.HorizontalPodAutoscalerList, error) { + if mock.ListFunc == nil { + panic("HorizontalPodAutoscalerInterfaceMock.ListFunc: method is nil but HorizontalPodAutoscalerInterface.List was just called") + } + callInfo := struct { + Opts v1.ListOptions + }{ + Opts: opts, + } + lockHorizontalPodAutoscalerInterfaceMockList.Lock() + mock.calls.List = append(mock.calls.List, callInfo) + lockHorizontalPodAutoscalerInterfaceMockList.Unlock() + return mock.ListFunc(opts) +} + +// ListCalls gets all the calls that were made to List. +// Check the length with: +// len(mockedHorizontalPodAutoscalerInterface.ListCalls()) +func (mock *HorizontalPodAutoscalerInterfaceMock) ListCalls() []struct { + Opts v1.ListOptions +} { + var calls []struct { + Opts v1.ListOptions + } + lockHorizontalPodAutoscalerInterfaceMockList.RLock() + calls = mock.calls.List + lockHorizontalPodAutoscalerInterfaceMockList.RUnlock() + return calls +} + +// ObjectClient calls ObjectClientFunc. +func (mock *HorizontalPodAutoscalerInterfaceMock) ObjectClient() *objectclient.ObjectClient { + if mock.ObjectClientFunc == nil { + panic("HorizontalPodAutoscalerInterfaceMock.ObjectClientFunc: method is nil but HorizontalPodAutoscalerInterface.ObjectClient was just called") + } + callInfo := struct { + }{} + lockHorizontalPodAutoscalerInterfaceMockObjectClient.Lock() + mock.calls.ObjectClient = append(mock.calls.ObjectClient, callInfo) + lockHorizontalPodAutoscalerInterfaceMockObjectClient.Unlock() + return mock.ObjectClientFunc() +} + +// ObjectClientCalls gets all the calls that were made to ObjectClient. +// Check the length with: +// len(mockedHorizontalPodAutoscalerInterface.ObjectClientCalls()) +func (mock *HorizontalPodAutoscalerInterfaceMock) ObjectClientCalls() []struct { +} { + var calls []struct { + } + lockHorizontalPodAutoscalerInterfaceMockObjectClient.RLock() + calls = mock.calls.ObjectClient + lockHorizontalPodAutoscalerInterfaceMockObjectClient.RUnlock() + return calls +} + +// Update calls UpdateFunc. +func (mock *HorizontalPodAutoscalerInterfaceMock) Update(in1 *v2beta2.HorizontalPodAutoscaler) (*v2beta2.HorizontalPodAutoscaler, error) { + if mock.UpdateFunc == nil { + panic("HorizontalPodAutoscalerInterfaceMock.UpdateFunc: method is nil but HorizontalPodAutoscalerInterface.Update was just called") + } + callInfo := struct { + In1 *v2beta2.HorizontalPodAutoscaler + }{ + In1: in1, + } + lockHorizontalPodAutoscalerInterfaceMockUpdate.Lock() + mock.calls.Update = append(mock.calls.Update, callInfo) + lockHorizontalPodAutoscalerInterfaceMockUpdate.Unlock() + return mock.UpdateFunc(in1) +} + +// UpdateCalls gets all the calls that were made to Update. +// Check the length with: +// len(mockedHorizontalPodAutoscalerInterface.UpdateCalls()) +func (mock *HorizontalPodAutoscalerInterfaceMock) UpdateCalls() []struct { + In1 *v2beta2.HorizontalPodAutoscaler +} { + var calls []struct { + In1 *v2beta2.HorizontalPodAutoscaler + } + lockHorizontalPodAutoscalerInterfaceMockUpdate.RLock() + calls = mock.calls.Update + lockHorizontalPodAutoscalerInterfaceMockUpdate.RUnlock() + return calls +} + +// Watch calls WatchFunc. +func (mock *HorizontalPodAutoscalerInterfaceMock) Watch(opts v1.ListOptions) (watch.Interface, error) { + if mock.WatchFunc == nil { + panic("HorizontalPodAutoscalerInterfaceMock.WatchFunc: method is nil but HorizontalPodAutoscalerInterface.Watch was just called") + } + callInfo := struct { + Opts v1.ListOptions + }{ + Opts: opts, + } + lockHorizontalPodAutoscalerInterfaceMockWatch.Lock() + mock.calls.Watch = append(mock.calls.Watch, callInfo) + lockHorizontalPodAutoscalerInterfaceMockWatch.Unlock() + return mock.WatchFunc(opts) +} + +// WatchCalls gets all the calls that were made to Watch. +// Check the length with: +// len(mockedHorizontalPodAutoscalerInterface.WatchCalls()) +func (mock *HorizontalPodAutoscalerInterfaceMock) WatchCalls() []struct { + Opts v1.ListOptions +} { + var calls []struct { + Opts v1.ListOptions + } + lockHorizontalPodAutoscalerInterfaceMockWatch.RLock() + calls = mock.calls.Watch + lockHorizontalPodAutoscalerInterfaceMockWatch.RUnlock() + return calls +} + +var ( + lockHorizontalPodAutoscalersGetterMockHorizontalPodAutoscalers sync.RWMutex +) + +// Ensure, that HorizontalPodAutoscalersGetterMock does implement HorizontalPodAutoscalersGetter. +// If this is not the case, regenerate this file with moq. +var _ v2beta2a.HorizontalPodAutoscalersGetter = &HorizontalPodAutoscalersGetterMock{} + +// HorizontalPodAutoscalersGetterMock is a mock implementation of HorizontalPodAutoscalersGetter. +// +// func TestSomethingThatUsesHorizontalPodAutoscalersGetter(t *testing.T) { +// +// // make and configure a mocked HorizontalPodAutoscalersGetter +// mockedHorizontalPodAutoscalersGetter := &HorizontalPodAutoscalersGetterMock{ +// HorizontalPodAutoscalersFunc: func(namespace string) v2beta2a.HorizontalPodAutoscalerInterface { +// panic("mock out the HorizontalPodAutoscalers method") +// }, +// } +// +// // use mockedHorizontalPodAutoscalersGetter in code that requires HorizontalPodAutoscalersGetter +// // and then make assertions. +// +// } +type HorizontalPodAutoscalersGetterMock struct { + // HorizontalPodAutoscalersFunc mocks the HorizontalPodAutoscalers method. + HorizontalPodAutoscalersFunc func(namespace string) v2beta2a.HorizontalPodAutoscalerInterface + + // calls tracks calls to the methods. + calls struct { + // HorizontalPodAutoscalers holds details about calls to the HorizontalPodAutoscalers method. + HorizontalPodAutoscalers []struct { + // Namespace is the namespace argument value. + Namespace string + } + } +} + +// HorizontalPodAutoscalers calls HorizontalPodAutoscalersFunc. +func (mock *HorizontalPodAutoscalersGetterMock) HorizontalPodAutoscalers(namespace string) v2beta2a.HorizontalPodAutoscalerInterface { + if mock.HorizontalPodAutoscalersFunc == nil { + panic("HorizontalPodAutoscalersGetterMock.HorizontalPodAutoscalersFunc: method is nil but HorizontalPodAutoscalersGetter.HorizontalPodAutoscalers was just called") + } + callInfo := struct { + Namespace string + }{ + Namespace: namespace, + } + lockHorizontalPodAutoscalersGetterMockHorizontalPodAutoscalers.Lock() + mock.calls.HorizontalPodAutoscalers = append(mock.calls.HorizontalPodAutoscalers, callInfo) + lockHorizontalPodAutoscalersGetterMockHorizontalPodAutoscalers.Unlock() + return mock.HorizontalPodAutoscalersFunc(namespace) +} + +// HorizontalPodAutoscalersCalls gets all the calls that were made to HorizontalPodAutoscalers. +// Check the length with: +// len(mockedHorizontalPodAutoscalersGetter.HorizontalPodAutoscalersCalls()) +func (mock *HorizontalPodAutoscalersGetterMock) HorizontalPodAutoscalersCalls() []struct { + Namespace string +} { + var calls []struct { + Namespace string + } + lockHorizontalPodAutoscalersGetterMockHorizontalPodAutoscalers.RLock() + calls = mock.calls.HorizontalPodAutoscalers + lockHorizontalPodAutoscalersGetterMockHorizontalPodAutoscalers.RUnlock() + return calls +} diff --git a/apis/autoscaling/v2beta2/zz_generated_deepcopy.go b/apis/autoscaling/v2beta2/zz_generated_deepcopy.go new file mode 100644 index 00000000..4f157ac6 --- /dev/null +++ b/apis/autoscaling/v2beta2/zz_generated_deepcopy.go @@ -0,0 +1,39 @@ +package v2beta2 + +import ( + autoscalingv2beta2 "k8s.io/api/autoscaling/v2beta2" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HorizontalPodAutoscalerList) DeepCopyInto(out *HorizontalPodAutoscalerList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]autoscalingv2beta2.HorizontalPodAutoscaler, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HorizontalPodAutoscalerList. +func (in *HorizontalPodAutoscalerList) DeepCopy() *HorizontalPodAutoscalerList { + if in == nil { + return nil + } + out := new(HorizontalPodAutoscalerList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *HorizontalPodAutoscalerList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} diff --git a/apis/autoscaling/v2beta2/zz_generated_horizontal_pod_autoscaler_controller.go b/apis/autoscaling/v2beta2/zz_generated_horizontal_pod_autoscaler_controller.go new file mode 100644 index 00000000..c987b410 --- /dev/null +++ b/apis/autoscaling/v2beta2/zz_generated_horizontal_pod_autoscaler_controller.go @@ -0,0 +1,453 @@ +package v2beta2 + +import ( + "context" + + "github.com/rancher/norman/controller" + "github.com/rancher/norman/objectclient" + "github.com/rancher/norman/resource" + "k8s.io/api/autoscaling/v2beta2" + "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/tools/cache" +) + +var ( + HorizontalPodAutoscalerGroupVersionKind = schema.GroupVersionKind{ + Version: Version, + Group: GroupName, + Kind: "HorizontalPodAutoscaler", + } + HorizontalPodAutoscalerResource = metav1.APIResource{ + Name: "horizontalpodautoscalers", + SingularName: "horizontalpodautoscaler", + Namespaced: true, + + Kind: HorizontalPodAutoscalerGroupVersionKind.Kind, + } + + HorizontalPodAutoscalerGroupVersionResource = schema.GroupVersionResource{ + Group: GroupName, + Version: Version, + Resource: "horizontalpodautoscalers", + } +) + +func init() { + resource.Put(HorizontalPodAutoscalerGroupVersionResource) +} + +func NewHorizontalPodAutoscaler(namespace, name string, obj v2beta2.HorizontalPodAutoscaler) *v2beta2.HorizontalPodAutoscaler { + obj.APIVersion, obj.Kind = HorizontalPodAutoscalerGroupVersionKind.ToAPIVersionAndKind() + obj.Name = name + obj.Namespace = namespace + return &obj +} + +type HorizontalPodAutoscalerList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []v2beta2.HorizontalPodAutoscaler `json:"items"` +} + +type HorizontalPodAutoscalerHandlerFunc func(key string, obj *v2beta2.HorizontalPodAutoscaler) (runtime.Object, error) + +type HorizontalPodAutoscalerChangeHandlerFunc func(obj *v2beta2.HorizontalPodAutoscaler) (runtime.Object, error) + +type HorizontalPodAutoscalerLister interface { + List(namespace string, selector labels.Selector) (ret []*v2beta2.HorizontalPodAutoscaler, err error) + Get(namespace, name string) (*v2beta2.HorizontalPodAutoscaler, error) +} + +type HorizontalPodAutoscalerController interface { + Generic() controller.GenericController + Informer() cache.SharedIndexInformer + Lister() HorizontalPodAutoscalerLister + AddHandler(ctx context.Context, name string, handler HorizontalPodAutoscalerHandlerFunc) + AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler HorizontalPodAutoscalerHandlerFunc) + Enqueue(namespace, name string) + Sync(ctx context.Context) error + Start(ctx context.Context, threadiness int) error +} + +type HorizontalPodAutoscalerInterface interface { + ObjectClient() *objectclient.ObjectClient + Create(*v2beta2.HorizontalPodAutoscaler) (*v2beta2.HorizontalPodAutoscaler, error) + GetNamespaced(namespace, name string, opts metav1.GetOptions) (*v2beta2.HorizontalPodAutoscaler, error) + Get(name string, opts metav1.GetOptions) (*v2beta2.HorizontalPodAutoscaler, error) + Update(*v2beta2.HorizontalPodAutoscaler) (*v2beta2.HorizontalPodAutoscaler, error) + Delete(name string, options *metav1.DeleteOptions) error + DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error + List(opts metav1.ListOptions) (*HorizontalPodAutoscalerList, error) + Watch(opts metav1.ListOptions) (watch.Interface, error) + DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Controller() HorizontalPodAutoscalerController + AddHandler(ctx context.Context, name string, sync HorizontalPodAutoscalerHandlerFunc) + AddLifecycle(ctx context.Context, name string, lifecycle HorizontalPodAutoscalerLifecycle) + AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync HorizontalPodAutoscalerHandlerFunc) + AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle HorizontalPodAutoscalerLifecycle) +} + +type horizontalPodAutoscalerLister struct { + controller *horizontalPodAutoscalerController +} + +func (l *horizontalPodAutoscalerLister) List(namespace string, selector labels.Selector) (ret []*v2beta2.HorizontalPodAutoscaler, err error) { + err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { + ret = append(ret, obj.(*v2beta2.HorizontalPodAutoscaler)) + }) + return +} + +func (l *horizontalPodAutoscalerLister) Get(namespace, name string) (*v2beta2.HorizontalPodAutoscaler, 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: HorizontalPodAutoscalerGroupVersionKind.Group, + Resource: "horizontalPodAutoscaler", + }, key) + } + return obj.(*v2beta2.HorizontalPodAutoscaler), nil +} + +type horizontalPodAutoscalerController struct { + controller.GenericController +} + +func (c *horizontalPodAutoscalerController) Generic() controller.GenericController { + return c.GenericController +} + +func (c *horizontalPodAutoscalerController) Lister() HorizontalPodAutoscalerLister { + return &horizontalPodAutoscalerLister{ + controller: c, + } +} + +func (c *horizontalPodAutoscalerController) AddHandler(ctx context.Context, name string, handler HorizontalPodAutoscalerHandlerFunc) { + c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { + if obj == nil { + return handler(key, nil) + } else if v, ok := obj.(*v2beta2.HorizontalPodAutoscaler); ok { + return handler(key, v) + } else { + return nil, nil + } + }) +} + +func (c *horizontalPodAutoscalerController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler HorizontalPodAutoscalerHandlerFunc) { + resource.PutClusterScoped(HorizontalPodAutoscalerGroupVersionResource) + c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { + if obj == nil { + return handler(key, nil) + } else if v, ok := obj.(*v2beta2.HorizontalPodAutoscaler); ok && controller.ObjectInCluster(cluster, obj) { + return handler(key, v) + } else { + return nil, nil + } + }) +} + +type horizontalPodAutoscalerFactory struct { +} + +func (c horizontalPodAutoscalerFactory) Object() runtime.Object { + return &v2beta2.HorizontalPodAutoscaler{} +} + +func (c horizontalPodAutoscalerFactory) List() runtime.Object { + return &HorizontalPodAutoscalerList{} +} + +func (s *horizontalPodAutoscalerClient) Controller() HorizontalPodAutoscalerController { + s.client.Lock() + defer s.client.Unlock() + + c, ok := s.client.horizontalPodAutoscalerControllers[s.ns] + if ok { + return c + } + + genericController := controller.NewGenericController(HorizontalPodAutoscalerGroupVersionKind.Kind+"Controller", + s.objectClient) + + c = &horizontalPodAutoscalerController{ + GenericController: genericController, + } + + s.client.horizontalPodAutoscalerControllers[s.ns] = c + s.client.starters = append(s.client.starters, c) + + return c +} + +type horizontalPodAutoscalerClient struct { + client *Client + ns string + objectClient *objectclient.ObjectClient + controller HorizontalPodAutoscalerController +} + +func (s *horizontalPodAutoscalerClient) ObjectClient() *objectclient.ObjectClient { + return s.objectClient +} + +func (s *horizontalPodAutoscalerClient) Create(o *v2beta2.HorizontalPodAutoscaler) (*v2beta2.HorizontalPodAutoscaler, error) { + obj, err := s.objectClient.Create(o) + return obj.(*v2beta2.HorizontalPodAutoscaler), err +} + +func (s *horizontalPodAutoscalerClient) Get(name string, opts metav1.GetOptions) (*v2beta2.HorizontalPodAutoscaler, error) { + obj, err := s.objectClient.Get(name, opts) + return obj.(*v2beta2.HorizontalPodAutoscaler), err +} + +func (s *horizontalPodAutoscalerClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*v2beta2.HorizontalPodAutoscaler, error) { + obj, err := s.objectClient.GetNamespaced(namespace, name, opts) + return obj.(*v2beta2.HorizontalPodAutoscaler), err +} + +func (s *horizontalPodAutoscalerClient) Update(o *v2beta2.HorizontalPodAutoscaler) (*v2beta2.HorizontalPodAutoscaler, error) { + obj, err := s.objectClient.Update(o.Name, o) + return obj.(*v2beta2.HorizontalPodAutoscaler), err +} + +func (s *horizontalPodAutoscalerClient) Delete(name string, options *metav1.DeleteOptions) error { + return s.objectClient.Delete(name, options) +} + +func (s *horizontalPodAutoscalerClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { + return s.objectClient.DeleteNamespaced(namespace, name, options) +} + +func (s *horizontalPodAutoscalerClient) List(opts metav1.ListOptions) (*HorizontalPodAutoscalerList, error) { + obj, err := s.objectClient.List(opts) + return obj.(*HorizontalPodAutoscalerList), err +} + +func (s *horizontalPodAutoscalerClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { + return s.objectClient.Watch(opts) +} + +// Patch applies the patch and returns the patched deployment. +func (s *horizontalPodAutoscalerClient) Patch(o *v2beta2.HorizontalPodAutoscaler, patchType types.PatchType, data []byte, subresources ...string) (*v2beta2.HorizontalPodAutoscaler, error) { + obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) + return obj.(*v2beta2.HorizontalPodAutoscaler), err +} + +func (s *horizontalPodAutoscalerClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return s.objectClient.DeleteCollection(deleteOpts, listOpts) +} + +func (s *horizontalPodAutoscalerClient) AddHandler(ctx context.Context, name string, sync HorizontalPodAutoscalerHandlerFunc) { + s.Controller().AddHandler(ctx, name, sync) +} + +func (s *horizontalPodAutoscalerClient) AddLifecycle(ctx context.Context, name string, lifecycle HorizontalPodAutoscalerLifecycle) { + sync := NewHorizontalPodAutoscalerLifecycleAdapter(name, false, s, lifecycle) + s.Controller().AddHandler(ctx, name, sync) +} + +func (s *horizontalPodAutoscalerClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync HorizontalPodAutoscalerHandlerFunc) { + s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) +} + +func (s *horizontalPodAutoscalerClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle HorizontalPodAutoscalerLifecycle) { + sync := NewHorizontalPodAutoscalerLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) + s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) +} + +type HorizontalPodAutoscalerIndexer func(obj *v2beta2.HorizontalPodAutoscaler) ([]string, error) + +type HorizontalPodAutoscalerClientCache interface { + Get(namespace, name string) (*v2beta2.HorizontalPodAutoscaler, error) + List(namespace string, selector labels.Selector) ([]*v2beta2.HorizontalPodAutoscaler, error) + + Index(name string, indexer HorizontalPodAutoscalerIndexer) + GetIndexed(name, key string) ([]*v2beta2.HorizontalPodAutoscaler, error) +} + +type HorizontalPodAutoscalerClient interface { + Create(*v2beta2.HorizontalPodAutoscaler) (*v2beta2.HorizontalPodAutoscaler, error) + Get(namespace, name string, opts metav1.GetOptions) (*v2beta2.HorizontalPodAutoscaler, error) + Update(*v2beta2.HorizontalPodAutoscaler) (*v2beta2.HorizontalPodAutoscaler, error) + Delete(namespace, name string, options *metav1.DeleteOptions) error + List(namespace string, opts metav1.ListOptions) (*HorizontalPodAutoscalerList, error) + Watch(opts metav1.ListOptions) (watch.Interface, error) + + Cache() HorizontalPodAutoscalerClientCache + + OnCreate(ctx context.Context, name string, sync HorizontalPodAutoscalerChangeHandlerFunc) + OnChange(ctx context.Context, name string, sync HorizontalPodAutoscalerChangeHandlerFunc) + OnRemove(ctx context.Context, name string, sync HorizontalPodAutoscalerChangeHandlerFunc) + Enqueue(namespace, name string) + + Generic() controller.GenericController + ObjectClient() *objectclient.ObjectClient + Interface() HorizontalPodAutoscalerInterface +} + +type horizontalPodAutoscalerClientCache struct { + client *horizontalPodAutoscalerClient2 +} + +type horizontalPodAutoscalerClient2 struct { + iface HorizontalPodAutoscalerInterface + controller HorizontalPodAutoscalerController +} + +func (n *horizontalPodAutoscalerClient2) Interface() HorizontalPodAutoscalerInterface { + return n.iface +} + +func (n *horizontalPodAutoscalerClient2) Generic() controller.GenericController { + return n.iface.Controller().Generic() +} + +func (n *horizontalPodAutoscalerClient2) ObjectClient() *objectclient.ObjectClient { + return n.Interface().ObjectClient() +} + +func (n *horizontalPodAutoscalerClient2) Enqueue(namespace, name string) { + n.iface.Controller().Enqueue(namespace, name) +} + +func (n *horizontalPodAutoscalerClient2) Create(obj *v2beta2.HorizontalPodAutoscaler) (*v2beta2.HorizontalPodAutoscaler, error) { + return n.iface.Create(obj) +} + +func (n *horizontalPodAutoscalerClient2) Get(namespace, name string, opts metav1.GetOptions) (*v2beta2.HorizontalPodAutoscaler, error) { + return n.iface.GetNamespaced(namespace, name, opts) +} + +func (n *horizontalPodAutoscalerClient2) Update(obj *v2beta2.HorizontalPodAutoscaler) (*v2beta2.HorizontalPodAutoscaler, error) { + return n.iface.Update(obj) +} + +func (n *horizontalPodAutoscalerClient2) Delete(namespace, name string, options *metav1.DeleteOptions) error { + return n.iface.DeleteNamespaced(namespace, name, options) +} + +func (n *horizontalPodAutoscalerClient2) List(namespace string, opts metav1.ListOptions) (*HorizontalPodAutoscalerList, error) { + return n.iface.List(opts) +} + +func (n *horizontalPodAutoscalerClient2) Watch(opts metav1.ListOptions) (watch.Interface, error) { + return n.iface.Watch(opts) +} + +func (n *horizontalPodAutoscalerClientCache) Get(namespace, name string) (*v2beta2.HorizontalPodAutoscaler, error) { + return n.client.controller.Lister().Get(namespace, name) +} + +func (n *horizontalPodAutoscalerClientCache) List(namespace string, selector labels.Selector) ([]*v2beta2.HorizontalPodAutoscaler, error) { + return n.client.controller.Lister().List(namespace, selector) +} + +func (n *horizontalPodAutoscalerClient2) Cache() HorizontalPodAutoscalerClientCache { + n.loadController() + return &horizontalPodAutoscalerClientCache{ + client: n, + } +} + +func (n *horizontalPodAutoscalerClient2) OnCreate(ctx context.Context, name string, sync HorizontalPodAutoscalerChangeHandlerFunc) { + n.loadController() + n.iface.AddLifecycle(ctx, name+"-create", &horizontalPodAutoscalerLifecycleDelegate{create: sync}) +} + +func (n *horizontalPodAutoscalerClient2) OnChange(ctx context.Context, name string, sync HorizontalPodAutoscalerChangeHandlerFunc) { + n.loadController() + n.iface.AddLifecycle(ctx, name+"-change", &horizontalPodAutoscalerLifecycleDelegate{update: sync}) +} + +func (n *horizontalPodAutoscalerClient2) OnRemove(ctx context.Context, name string, sync HorizontalPodAutoscalerChangeHandlerFunc) { + n.loadController() + n.iface.AddLifecycle(ctx, name, &horizontalPodAutoscalerLifecycleDelegate{remove: sync}) +} + +func (n *horizontalPodAutoscalerClientCache) Index(name string, indexer HorizontalPodAutoscalerIndexer) { + err := n.client.controller.Informer().GetIndexer().AddIndexers(map[string]cache.IndexFunc{ + name: func(obj interface{}) ([]string, error) { + if v, ok := obj.(*v2beta2.HorizontalPodAutoscaler); ok { + return indexer(v) + } + return nil, nil + }, + }) + + if err != nil { + panic(err) + } +} + +func (n *horizontalPodAutoscalerClientCache) GetIndexed(name, key string) ([]*v2beta2.HorizontalPodAutoscaler, error) { + var result []*v2beta2.HorizontalPodAutoscaler + objs, err := n.client.controller.Informer().GetIndexer().ByIndex(name, key) + if err != nil { + return nil, err + } + for _, obj := range objs { + if v, ok := obj.(*v2beta2.HorizontalPodAutoscaler); ok { + result = append(result, v) + } + } + + return result, nil +} + +func (n *horizontalPodAutoscalerClient2) loadController() { + if n.controller == nil { + n.controller = n.iface.Controller() + } +} + +type horizontalPodAutoscalerLifecycleDelegate struct { + create HorizontalPodAutoscalerChangeHandlerFunc + update HorizontalPodAutoscalerChangeHandlerFunc + remove HorizontalPodAutoscalerChangeHandlerFunc +} + +func (n *horizontalPodAutoscalerLifecycleDelegate) HasCreate() bool { + return n.create != nil +} + +func (n *horizontalPodAutoscalerLifecycleDelegate) Create(obj *v2beta2.HorizontalPodAutoscaler) (runtime.Object, error) { + if n.create == nil { + return obj, nil + } + return n.create(obj) +} + +func (n *horizontalPodAutoscalerLifecycleDelegate) HasFinalize() bool { + return n.remove != nil +} + +func (n *horizontalPodAutoscalerLifecycleDelegate) Remove(obj *v2beta2.HorizontalPodAutoscaler) (runtime.Object, error) { + if n.remove == nil { + return obj, nil + } + return n.remove(obj) +} + +func (n *horizontalPodAutoscalerLifecycleDelegate) Updated(obj *v2beta2.HorizontalPodAutoscaler) (runtime.Object, error) { + if n.update == nil { + return obj, nil + } + return n.update(obj) +} diff --git a/apis/autoscaling/v2beta2/zz_generated_horizontal_pod_autoscaler_lifecycle_adapter.go b/apis/autoscaling/v2beta2/zz_generated_horizontal_pod_autoscaler_lifecycle_adapter.go new file mode 100644 index 00000000..f0ef840f --- /dev/null +++ b/apis/autoscaling/v2beta2/zz_generated_horizontal_pod_autoscaler_lifecycle_adapter.go @@ -0,0 +1,63 @@ +package v2beta2 + +import ( + "github.com/rancher/norman/lifecycle" + "k8s.io/api/autoscaling/v2beta2" + "k8s.io/apimachinery/pkg/runtime" +) + +type HorizontalPodAutoscalerLifecycle interface { + Create(obj *v2beta2.HorizontalPodAutoscaler) (runtime.Object, error) + Remove(obj *v2beta2.HorizontalPodAutoscaler) (runtime.Object, error) + Updated(obj *v2beta2.HorizontalPodAutoscaler) (runtime.Object, error) +} + +type horizontalPodAutoscalerLifecycleAdapter struct { + lifecycle HorizontalPodAutoscalerLifecycle +} + +func (w *horizontalPodAutoscalerLifecycleAdapter) HasCreate() bool { + o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) + return !ok || o.HasCreate() +} + +func (w *horizontalPodAutoscalerLifecycleAdapter) HasFinalize() bool { + o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) + return !ok || o.HasFinalize() +} + +func (w *horizontalPodAutoscalerLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { + o, err := w.lifecycle.Create(obj.(*v2beta2.HorizontalPodAutoscaler)) + if o == nil { + return nil, err + } + return o, err +} + +func (w *horizontalPodAutoscalerLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { + o, err := w.lifecycle.Remove(obj.(*v2beta2.HorizontalPodAutoscaler)) + if o == nil { + return nil, err + } + return o, err +} + +func (w *horizontalPodAutoscalerLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { + o, err := w.lifecycle.Updated(obj.(*v2beta2.HorizontalPodAutoscaler)) + if o == nil { + return nil, err + } + return o, err +} + +func NewHorizontalPodAutoscalerLifecycleAdapter(name string, clusterScoped bool, client HorizontalPodAutoscalerInterface, l HorizontalPodAutoscalerLifecycle) HorizontalPodAutoscalerHandlerFunc { + adapter := &horizontalPodAutoscalerLifecycleAdapter{lifecycle: l} + syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) + return func(key string, obj *v2beta2.HorizontalPodAutoscaler) (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/autoscaling/v2beta2/zz_generated_k8s_client.go b/apis/autoscaling/v2beta2/zz_generated_k8s_client.go new file mode 100644 index 00000000..4c77f943 --- /dev/null +++ b/apis/autoscaling/v2beta2/zz_generated_k8s_client.go @@ -0,0 +1,119 @@ +package v2beta2 + +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 + + HorizontalPodAutoscalersGetter +} + +type Clients struct { + Interface Interface + + HorizontalPodAutoscaler HorizontalPodAutoscalerClient +} + +type Client struct { + sync.Mutex + restClient rest.Interface + starters []controller.Starter + + horizontalPodAutoscalerControllers map[string]HorizontalPodAutoscalerController +} + +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, + + HorizontalPodAutoscaler: &horizontalPodAutoscalerClient2{ + iface: iface.HorizontalPodAutoscalers(""), + }, + } +} + +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, + + horizontalPodAutoscalerControllers: map[string]HorizontalPodAutoscalerController{}, + }, 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 HorizontalPodAutoscalersGetter interface { + HorizontalPodAutoscalers(namespace string) HorizontalPodAutoscalerInterface +} + +func (c *Client) HorizontalPodAutoscalers(namespace string) HorizontalPodAutoscalerInterface { + objectClient := objectclient.NewObjectClient(namespace, c.restClient, &HorizontalPodAutoscalerResource, HorizontalPodAutoscalerGroupVersionKind, horizontalPodAutoscalerFactory{}) + return &horizontalPodAutoscalerClient{ + ns: namespace, + client: c, + objectClient: objectClient, + } +} diff --git a/apis/autoscaling/v2beta2/zz_generated_scheme.go b/apis/autoscaling/v2beta2/zz_generated_scheme.go new file mode 100644 index 00000000..d716e23e --- /dev/null +++ b/apis/autoscaling/v2beta2/zz_generated_scheme.go @@ -0,0 +1,41 @@ +package v2beta2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +const ( + GroupName = "autoscaling" + Version = "v2beta2" +) + +// 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, + + &HorizontalPodAutoscalerList{}, + ) + metav1.AddToGroupVersion(scheme, SchemeGroupVersion) + return nil +} diff --git a/client/project/v3/zz_generated_client.go b/client/project/v3/zz_generated_client.go index b58a2000..0fbd8fd0 100644 --- a/client/project/v3/zz_generated_client.go +++ b/client/project/v3/zz_generated_client.go @@ -46,6 +46,7 @@ type Client struct { ServiceMonitor ServiceMonitorOperations PrometheusRule PrometheusRuleOperations Alertmanager AlertmanagerOperations + HorizontalPodAutoscaler HorizontalPodAutoscalerOperations } func NewClient(opts *clientbase.ClientOpts) (*Client, error) { @@ -97,6 +98,7 @@ func NewClient(opts *clientbase.ClientOpts) (*Client, error) { client.ServiceMonitor = newServiceMonitorClient(client) client.PrometheusRule = newPrometheusRuleClient(client) client.Alertmanager = newAlertmanagerClient(client) + client.HorizontalPodAutoscaler = newHorizontalPodAutoscalerClient(client) return client, nil } diff --git a/client/project/v3/zz_generated_cross_version_object_reference.go b/client/project/v3/zz_generated_cross_version_object_reference.go new file mode 100644 index 00000000..9e9699e7 --- /dev/null +++ b/client/project/v3/zz_generated_cross_version_object_reference.go @@ -0,0 +1,14 @@ +package client + +const ( + CrossVersionObjectReferenceType = "crossVersionObjectReference" + CrossVersionObjectReferenceFieldAPIVersion = "apiVersion" + CrossVersionObjectReferenceFieldKind = "kind" + CrossVersionObjectReferenceFieldName = "name" +) + +type CrossVersionObjectReference struct { + APIVersion string `json:"apiVersion,omitempty" yaml:"apiVersion,omitempty"` + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + Name string `json:"name,omitempty" yaml:"name,omitempty"` +} diff --git a/client/project/v3/zz_generated_external_metric_source.go b/client/project/v3/zz_generated_external_metric_source.go new file mode 100644 index 00000000..fd086d9a --- /dev/null +++ b/client/project/v3/zz_generated_external_metric_source.go @@ -0,0 +1,12 @@ +package client + +const ( + ExternalMetricSourceType = "externalMetricSource" + ExternalMetricSourceFieldMetric = "metric" + ExternalMetricSourceFieldTarget = "target" +) + +type ExternalMetricSource struct { + Metric *MetricIdentifier `json:"metric,omitempty" yaml:"metric,omitempty"` + Target *MetricTarget `json:"target,omitempty" yaml:"target,omitempty"` +} diff --git a/client/project/v3/zz_generated_external_metric_status.go b/client/project/v3/zz_generated_external_metric_status.go new file mode 100644 index 00000000..b8b411f6 --- /dev/null +++ b/client/project/v3/zz_generated_external_metric_status.go @@ -0,0 +1,12 @@ +package client + +const ( + ExternalMetricStatusType = "externalMetricStatus" + ExternalMetricStatusFieldCurrent = "current" + ExternalMetricStatusFieldMetric = "metric" +) + +type ExternalMetricStatus struct { + Current *MetricValueStatus `json:"current,omitempty" yaml:"current,omitempty"` + Metric *MetricIdentifier `json:"metric,omitempty" yaml:"metric,omitempty"` +} diff --git a/client/project/v3/zz_generated_horizontal_pod_autoscaler.go b/client/project/v3/zz_generated_horizontal_pod_autoscaler.go new file mode 100644 index 00000000..2e7a0f6e --- /dev/null +++ b/client/project/v3/zz_generated_horizontal_pod_autoscaler.go @@ -0,0 +1,129 @@ +package client + +import ( + "github.com/rancher/norman/types" +) + +const ( + HorizontalPodAutoscalerType = "horizontalPodAutoscaler" + HorizontalPodAutoscalerFieldAnnotations = "annotations" + HorizontalPodAutoscalerFieldConditions = "conditions" + HorizontalPodAutoscalerFieldCreated = "created" + HorizontalPodAutoscalerFieldCreatorID = "creatorId" + HorizontalPodAutoscalerFieldCurrentReplicas = "currentReplicas" + HorizontalPodAutoscalerFieldDescription = "description" + HorizontalPodAutoscalerFieldDesiredReplicas = "desiredReplicas" + HorizontalPodAutoscalerFieldLabels = "labels" + HorizontalPodAutoscalerFieldLastScaleTime = "lastScaleTime" + HorizontalPodAutoscalerFieldMaxReplicas = "maxReplicas" + HorizontalPodAutoscalerFieldMetrics = "metrics" + HorizontalPodAutoscalerFieldMinReplicas = "minReplicas" + HorizontalPodAutoscalerFieldName = "name" + HorizontalPodAutoscalerFieldNamespaceId = "namespaceId" + HorizontalPodAutoscalerFieldObservedGeneration = "observedGeneration" + HorizontalPodAutoscalerFieldOwnerReferences = "ownerReferences" + HorizontalPodAutoscalerFieldProjectID = "projectId" + HorizontalPodAutoscalerFieldRemoved = "removed" + HorizontalPodAutoscalerFieldState = "state" + HorizontalPodAutoscalerFieldTransitioning = "transitioning" + HorizontalPodAutoscalerFieldTransitioningMessage = "transitioningMessage" + HorizontalPodAutoscalerFieldUUID = "uuid" + HorizontalPodAutoscalerFieldWorkloadId = "workloadId" +) + +type HorizontalPodAutoscaler struct { + types.Resource + Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` + Conditions []HorizontalPodAutoscalerCondition `json:"conditions,omitempty" yaml:"conditions,omitempty"` + Created string `json:"created,omitempty" yaml:"created,omitempty"` + CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` + CurrentReplicas int64 `json:"currentReplicas,omitempty" yaml:"currentReplicas,omitempty"` + Description string `json:"description,omitempty" yaml:"description,omitempty"` + DesiredReplicas int64 `json:"desiredReplicas,omitempty" yaml:"desiredReplicas,omitempty"` + Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` + LastScaleTime string `json:"lastScaleTime,omitempty" yaml:"lastScaleTime,omitempty"` + MaxReplicas int64 `json:"maxReplicas,omitempty" yaml:"maxReplicas,omitempty"` + Metrics []Metric `json:"metrics,omitempty" yaml:"metrics,omitempty"` + MinReplicas *int64 `json:"minReplicas,omitempty" yaml:"minReplicas,omitempty"` + Name string `json:"name,omitempty" yaml:"name,omitempty"` + NamespaceId string `json:"namespaceId,omitempty" yaml:"namespaceId,omitempty"` + ObservedGeneration *int64 `json:"observedGeneration,omitempty" yaml:"observedGeneration,omitempty"` + OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` + ProjectID string `json:"projectId,omitempty" yaml:"projectId,omitempty"` + Removed string `json:"removed,omitempty" yaml:"removed,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"` + WorkloadId string `json:"workloadId,omitempty" yaml:"workloadId,omitempty"` +} + +type HorizontalPodAutoscalerCollection struct { + types.Collection + Data []HorizontalPodAutoscaler `json:"data,omitempty"` + client *HorizontalPodAutoscalerClient +} + +type HorizontalPodAutoscalerClient struct { + apiClient *Client +} + +type HorizontalPodAutoscalerOperations interface { + List(opts *types.ListOpts) (*HorizontalPodAutoscalerCollection, error) + Create(opts *HorizontalPodAutoscaler) (*HorizontalPodAutoscaler, error) + Update(existing *HorizontalPodAutoscaler, updates interface{}) (*HorizontalPodAutoscaler, error) + Replace(existing *HorizontalPodAutoscaler) (*HorizontalPodAutoscaler, error) + ByID(id string) (*HorizontalPodAutoscaler, error) + Delete(container *HorizontalPodAutoscaler) error +} + +func newHorizontalPodAutoscalerClient(apiClient *Client) *HorizontalPodAutoscalerClient { + return &HorizontalPodAutoscalerClient{ + apiClient: apiClient, + } +} + +func (c *HorizontalPodAutoscalerClient) Create(container *HorizontalPodAutoscaler) (*HorizontalPodAutoscaler, error) { + resp := &HorizontalPodAutoscaler{} + err := c.apiClient.Ops.DoCreate(HorizontalPodAutoscalerType, container, resp) + return resp, err +} + +func (c *HorizontalPodAutoscalerClient) Update(existing *HorizontalPodAutoscaler, updates interface{}) (*HorizontalPodAutoscaler, error) { + resp := &HorizontalPodAutoscaler{} + err := c.apiClient.Ops.DoUpdate(HorizontalPodAutoscalerType, &existing.Resource, updates, resp) + return resp, err +} + +func (c *HorizontalPodAutoscalerClient) Replace(obj *HorizontalPodAutoscaler) (*HorizontalPodAutoscaler, error) { + resp := &HorizontalPodAutoscaler{} + err := c.apiClient.Ops.DoReplace(HorizontalPodAutoscalerType, &obj.Resource, obj, resp) + return resp, err +} + +func (c *HorizontalPodAutoscalerClient) List(opts *types.ListOpts) (*HorizontalPodAutoscalerCollection, error) { + resp := &HorizontalPodAutoscalerCollection{} + err := c.apiClient.Ops.DoList(HorizontalPodAutoscalerType, opts, resp) + resp.client = c + return resp, err +} + +func (cc *HorizontalPodAutoscalerCollection) Next() (*HorizontalPodAutoscalerCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &HorizontalPodAutoscalerCollection{} + err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *HorizontalPodAutoscalerClient) ByID(id string) (*HorizontalPodAutoscaler, error) { + resp := &HorizontalPodAutoscaler{} + err := c.apiClient.Ops.DoByID(HorizontalPodAutoscalerType, id, resp) + return resp, err +} + +func (c *HorizontalPodAutoscalerClient) Delete(container *HorizontalPodAutoscaler) error { + return c.apiClient.Ops.DoResourceDelete(HorizontalPodAutoscalerType, &container.Resource) +} diff --git a/client/project/v3/zz_generated_horizontal_pod_autoscaler_condition.go b/client/project/v3/zz_generated_horizontal_pod_autoscaler_condition.go new file mode 100644 index 00000000..15fdfc4d --- /dev/null +++ b/client/project/v3/zz_generated_horizontal_pod_autoscaler_condition.go @@ -0,0 +1,18 @@ +package client + +const ( + HorizontalPodAutoscalerConditionType = "horizontalPodAutoscalerCondition" + HorizontalPodAutoscalerConditionFieldLastTransitionTime = "lastTransitionTime" + HorizontalPodAutoscalerConditionFieldMessage = "message" + HorizontalPodAutoscalerConditionFieldReason = "reason" + HorizontalPodAutoscalerConditionFieldStatus = "status" + HorizontalPodAutoscalerConditionFieldType = "type" +) + +type HorizontalPodAutoscalerCondition 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/project/v3/zz_generated_horizontal_pod_autoscaler_spec.go b/client/project/v3/zz_generated_horizontal_pod_autoscaler_spec.go new file mode 100644 index 00000000..55859bc7 --- /dev/null +++ b/client/project/v3/zz_generated_horizontal_pod_autoscaler_spec.go @@ -0,0 +1,16 @@ +package client + +const ( + HorizontalPodAutoscalerSpecType = "horizontalPodAutoscalerSpec" + HorizontalPodAutoscalerSpecFieldMaxReplicas = "maxReplicas" + HorizontalPodAutoscalerSpecFieldMetrics = "metrics" + HorizontalPodAutoscalerSpecFieldMinReplicas = "minReplicas" + HorizontalPodAutoscalerSpecFieldScaleTargetRef = "scaleTargetRef" +) + +type HorizontalPodAutoscalerSpec struct { + MaxReplicas int64 `json:"maxReplicas,omitempty" yaml:"maxReplicas,omitempty"` + Metrics []Metric `json:"metrics,omitempty" yaml:"metrics,omitempty"` + MinReplicas *int64 `json:"minReplicas,omitempty" yaml:"minReplicas,omitempty"` + ScaleTargetRef *CrossVersionObjectReference `json:"scaleTargetRef,omitempty" yaml:"scaleTargetRef,omitempty"` +} diff --git a/client/project/v3/zz_generated_horizontal_pod_autoscaler_status.go b/client/project/v3/zz_generated_horizontal_pod_autoscaler_status.go new file mode 100644 index 00000000..216f6889 --- /dev/null +++ b/client/project/v3/zz_generated_horizontal_pod_autoscaler_status.go @@ -0,0 +1,20 @@ +package client + +const ( + HorizontalPodAutoscalerStatusType = "horizontalPodAutoscalerStatus" + HorizontalPodAutoscalerStatusFieldConditions = "conditions" + HorizontalPodAutoscalerStatusFieldCurrentMetrics = "currentMetrics" + HorizontalPodAutoscalerStatusFieldCurrentReplicas = "currentReplicas" + HorizontalPodAutoscalerStatusFieldDesiredReplicas = "desiredReplicas" + HorizontalPodAutoscalerStatusFieldLastScaleTime = "lastScaleTime" + HorizontalPodAutoscalerStatusFieldObservedGeneration = "observedGeneration" +) + +type HorizontalPodAutoscalerStatus struct { + Conditions []HorizontalPodAutoscalerCondition `json:"conditions,omitempty" yaml:"conditions,omitempty"` + CurrentMetrics []MetricStatus `json:"currentMetrics,omitempty" yaml:"currentMetrics,omitempty"` + CurrentReplicas int64 `json:"currentReplicas,omitempty" yaml:"currentReplicas,omitempty"` + DesiredReplicas int64 `json:"desiredReplicas,omitempty" yaml:"desiredReplicas,omitempty"` + LastScaleTime string `json:"lastScaleTime,omitempty" yaml:"lastScaleTime,omitempty"` + ObservedGeneration *int64 `json:"observedGeneration,omitempty" yaml:"observedGeneration,omitempty"` +} diff --git a/client/project/v3/zz_generated_metric.go b/client/project/v3/zz_generated_metric.go new file mode 100644 index 00000000..7ba7c956 --- /dev/null +++ b/client/project/v3/zz_generated_metric.go @@ -0,0 +1,20 @@ +package client + +const ( + MetricType = "metric" + MetricFieldCurrent = "current" + MetricFieldDescribedObject = "describedObject" + MetricFieldName = "name" + MetricFieldSelector = "selector" + MetricFieldTarget = "target" + MetricFieldType = "type" +) + +type Metric struct { + Current *MetricValueStatus `json:"current,omitempty" yaml:"current,omitempty"` + DescribedObject *CrossVersionObjectReference `json:"describedObject,omitempty" yaml:"describedObject,omitempty"` + Name string `json:"name,omitempty" yaml:"name,omitempty"` + Selector *LabelSelector `json:"selector,omitempty" yaml:"selector,omitempty"` + Target *MetricTarget `json:"target,omitempty" yaml:"target,omitempty"` + Type string `json:"type,omitempty" yaml:"type,omitempty"` +} diff --git a/client/project/v3/zz_generated_metric_identifier.go b/client/project/v3/zz_generated_metric_identifier.go new file mode 100644 index 00000000..0d86b90a --- /dev/null +++ b/client/project/v3/zz_generated_metric_identifier.go @@ -0,0 +1,12 @@ +package client + +const ( + MetricIdentifierType = "metricIdentifier" + MetricIdentifierFieldName = "name" + MetricIdentifierFieldSelector = "selector" +) + +type MetricIdentifier struct { + Name string `json:"name,omitempty" yaml:"name,omitempty"` + Selector *LabelSelector `json:"selector,omitempty" yaml:"selector,omitempty"` +} diff --git a/client/project/v3/zz_generated_metric_status.go b/client/project/v3/zz_generated_metric_status.go new file mode 100644 index 00000000..320d5908 --- /dev/null +++ b/client/project/v3/zz_generated_metric_status.go @@ -0,0 +1,20 @@ +package client + +const ( + MetricStatusType = "metricStatus" + MetricStatusFieldCurrent = "current" + MetricStatusFieldExternal = "external" + MetricStatusFieldObject = "object" + MetricStatusFieldPods = "pods" + MetricStatusFieldResource = "resource" + MetricStatusFieldType = "type" +) + +type MetricStatus struct { + Current *MetricValueStatus `json:"current,omitempty" yaml:"current,omitempty"` + External *ExternalMetricStatus `json:"external,omitempty" yaml:"external,omitempty"` + Object *ObjectMetricStatus `json:"object,omitempty" yaml:"object,omitempty"` + Pods *PodsMetricStatus `json:"pods,omitempty" yaml:"pods,omitempty"` + Resource *ResourceMetricStatus `json:"resource,omitempty" yaml:"resource,omitempty"` + Type string `json:"type,omitempty" yaml:"type,omitempty"` +} diff --git a/client/project/v3/zz_generated_metric_target.go b/client/project/v3/zz_generated_metric_target.go new file mode 100644 index 00000000..ca3b7f43 --- /dev/null +++ b/client/project/v3/zz_generated_metric_target.go @@ -0,0 +1,16 @@ +package client + +const ( + MetricTargetType = "metricTarget" + MetricTargetFieldAverageValue = "averageValue" + MetricTargetFieldType = "type" + MetricTargetFieldUtilization = "utilization" + MetricTargetFieldValue = "value" +) + +type MetricTarget struct { + AverageValue string `json:"averageValue,omitempty" yaml:"averageValue,omitempty"` + Type string `json:"type,omitempty" yaml:"type,omitempty"` + Utilization *int64 `json:"utilization,omitempty" yaml:"utilization,omitempty"` + Value string `json:"value,omitempty" yaml:"value,omitempty"` +} diff --git a/client/project/v3/zz_generated_metric_value_status.go b/client/project/v3/zz_generated_metric_value_status.go new file mode 100644 index 00000000..1dd70897 --- /dev/null +++ b/client/project/v3/zz_generated_metric_value_status.go @@ -0,0 +1,14 @@ +package client + +const ( + MetricValueStatusType = "metricValueStatus" + MetricValueStatusFieldAverageValue = "averageValue" + MetricValueStatusFieldUtilization = "utilization" + MetricValueStatusFieldValue = "value" +) + +type MetricValueStatus struct { + AverageValue string `json:"averageValue,omitempty" yaml:"averageValue,omitempty"` + Utilization *int64 `json:"utilization,omitempty" yaml:"utilization,omitempty"` + Value string `json:"value,omitempty" yaml:"value,omitempty"` +} diff --git a/client/project/v3/zz_generated_object_metric_source.go b/client/project/v3/zz_generated_object_metric_source.go new file mode 100644 index 00000000..58bb11d7 --- /dev/null +++ b/client/project/v3/zz_generated_object_metric_source.go @@ -0,0 +1,14 @@ +package client + +const ( + ObjectMetricSourceType = "objectMetricSource" + ObjectMetricSourceFieldDescribedObject = "describedObject" + ObjectMetricSourceFieldMetric = "metric" + ObjectMetricSourceFieldTarget = "target" +) + +type ObjectMetricSource struct { + DescribedObject *CrossVersionObjectReference `json:"describedObject,omitempty" yaml:"describedObject,omitempty"` + Metric *MetricIdentifier `json:"metric,omitempty" yaml:"metric,omitempty"` + Target *MetricTarget `json:"target,omitempty" yaml:"target,omitempty"` +} diff --git a/client/project/v3/zz_generated_object_metric_status.go b/client/project/v3/zz_generated_object_metric_status.go new file mode 100644 index 00000000..5734405d --- /dev/null +++ b/client/project/v3/zz_generated_object_metric_status.go @@ -0,0 +1,14 @@ +package client + +const ( + ObjectMetricStatusType = "objectMetricStatus" + ObjectMetricStatusFieldCurrent = "current" + ObjectMetricStatusFieldDescribedObject = "describedObject" + ObjectMetricStatusFieldMetric = "metric" +) + +type ObjectMetricStatus struct { + Current *MetricValueStatus `json:"current,omitempty" yaml:"current,omitempty"` + DescribedObject *CrossVersionObjectReference `json:"describedObject,omitempty" yaml:"describedObject,omitempty"` + Metric *MetricIdentifier `json:"metric,omitempty" yaml:"metric,omitempty"` +} diff --git a/client/project/v3/zz_generated_pods_metric_source.go b/client/project/v3/zz_generated_pods_metric_source.go new file mode 100644 index 00000000..d6ff2664 --- /dev/null +++ b/client/project/v3/zz_generated_pods_metric_source.go @@ -0,0 +1,12 @@ +package client + +const ( + PodsMetricSourceType = "podsMetricSource" + PodsMetricSourceFieldMetric = "metric" + PodsMetricSourceFieldTarget = "target" +) + +type PodsMetricSource struct { + Metric *MetricIdentifier `json:"metric,omitempty" yaml:"metric,omitempty"` + Target *MetricTarget `json:"target,omitempty" yaml:"target,omitempty"` +} diff --git a/client/project/v3/zz_generated_pods_metric_status.go b/client/project/v3/zz_generated_pods_metric_status.go new file mode 100644 index 00000000..307375c2 --- /dev/null +++ b/client/project/v3/zz_generated_pods_metric_status.go @@ -0,0 +1,12 @@ +package client + +const ( + PodsMetricStatusType = "podsMetricStatus" + PodsMetricStatusFieldCurrent = "current" + PodsMetricStatusFieldMetric = "metric" +) + +type PodsMetricStatus struct { + Current *MetricValueStatus `json:"current,omitempty" yaml:"current,omitempty"` + Metric *MetricIdentifier `json:"metric,omitempty" yaml:"metric,omitempty"` +} diff --git a/client/project/v3/zz_generated_resource_metric_source.go b/client/project/v3/zz_generated_resource_metric_source.go new file mode 100644 index 00000000..4b1683b6 --- /dev/null +++ b/client/project/v3/zz_generated_resource_metric_source.go @@ -0,0 +1,12 @@ +package client + +const ( + ResourceMetricSourceType = "resourceMetricSource" + ResourceMetricSourceFieldName = "name" + ResourceMetricSourceFieldTarget = "target" +) + +type ResourceMetricSource struct { + Name string `json:"name,omitempty" yaml:"name,omitempty"` + Target *MetricTarget `json:"target,omitempty" yaml:"target,omitempty"` +} diff --git a/client/project/v3/zz_generated_resource_metric_status.go b/client/project/v3/zz_generated_resource_metric_status.go new file mode 100644 index 00000000..24168cae --- /dev/null +++ b/client/project/v3/zz_generated_resource_metric_status.go @@ -0,0 +1,12 @@ +package client + +const ( + ResourceMetricStatusType = "resourceMetricStatus" + ResourceMetricStatusFieldCurrent = "current" + ResourceMetricStatusFieldName = "name" +) + +type ResourceMetricStatus struct { + Current *MetricValueStatus `json:"current,omitempty" yaml:"current,omitempty"` + Name string `json:"name,omitempty" yaml:"name,omitempty"` +} diff --git a/compose/zz_generated_compose.go b/compose/zz_generated_compose.go index 895aa3dd..d9591bc9 100644 --- a/compose/zz_generated_compose.go +++ b/compose/zz_generated_compose.go @@ -107,4 +107,5 @@ type Config struct { ServiceMonitors map[string]projectClient.ServiceMonitor `json:"serviceMonitors,omitempty" yaml:"serviceMonitors,omitempty"` PrometheusRules map[string]projectClient.PrometheusRule `json:"prometheusRules,omitempty" yaml:"prometheusRules,omitempty"` Alertmanagers map[string]projectClient.Alertmanager `json:"alertmanagers,omitempty" yaml:"alertmanagers,omitempty"` + HorizontalPodAutoscalers map[string]projectClient.HorizontalPodAutoscaler `json:"horizontalPodAutoscalers,omitempty" yaml:"horizontalPodAutoscalers,omitempty"` }