1
0
mirror of https://github.com/rancher/types.git synced 2025-09-01 13:18:20 +00:00

Update generated code

This commit is contained in:
Darren Shepherd
2020-05-16 22:09:08 -07:00
parent 8d8abc899c
commit f477d5d0b2
300 changed files with 4421 additions and 19279 deletions

View File

@@ -151,8 +151,6 @@ var (
lockHorizontalPodAutoscalerControllerMockGeneric sync.RWMutex
lockHorizontalPodAutoscalerControllerMockInformer sync.RWMutex
lockHorizontalPodAutoscalerControllerMockLister sync.RWMutex
lockHorizontalPodAutoscalerControllerMockStart sync.RWMutex
lockHorizontalPodAutoscalerControllerMockSync sync.RWMutex
)
// Ensure, that HorizontalPodAutoscalerControllerMock does implement HorizontalPodAutoscalerController.
@@ -192,12 +190,6 @@ var _ v2beta2a.HorizontalPodAutoscalerController = &HorizontalPodAutoscalerContr
// 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
@@ -232,12 +224,6 @@ type HorizontalPodAutoscalerControllerMock struct {
// 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 {
// AddClusterScopedFeatureHandler holds details about calls to the AddClusterScopedFeatureHandler method.
@@ -309,18 +295,6 @@ type HorizontalPodAutoscalerControllerMock 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
}
}
}
@@ -648,72 +622,6 @@ func (mock *HorizontalPodAutoscalerControllerMock) ListerCalls() []struct {
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 (
lockHorizontalPodAutoscalerInterfaceMockAddClusterScopedFeatureHandler sync.RWMutex
lockHorizontalPodAutoscalerInterfaceMockAddClusterScopedFeatureLifecycle sync.RWMutex
@@ -792,10 +700,10 @@ var _ v2beta2a.HorizontalPodAutoscalerInterface = &HorizontalPodAutoscalerInterf
// 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) {
// ListFunc: func(opts v1.ListOptions) (*v2beta2.HorizontalPodAutoscalerList, error) {
// panic("mock out the List method")
// },
// ListNamespacedFunc: func(namespace string, opts v1.ListOptions) (*v2beta2a.HorizontalPodAutoscalerList, error) {
// ListNamespacedFunc: func(namespace string, opts v1.ListOptions) (*v2beta2.HorizontalPodAutoscalerList, error) {
// panic("mock out the ListNamespaced method")
// },
// ObjectClientFunc: func() *objectclient.ObjectClient {
@@ -860,10 +768,10 @@ type HorizontalPodAutoscalerInterfaceMock struct {
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)
ListFunc func(opts v1.ListOptions) (*v2beta2.HorizontalPodAutoscalerList, error)
// ListNamespacedFunc mocks the ListNamespaced method.
ListNamespacedFunc func(namespace string, opts v1.ListOptions) (*v2beta2a.HorizontalPodAutoscalerList, error)
ListNamespacedFunc func(namespace string, opts v1.ListOptions) (*v2beta2.HorizontalPodAutoscalerList, error)
// ObjectClientFunc mocks the ObjectClient method.
ObjectClientFunc func() *objectclient.ObjectClient
@@ -1624,7 +1532,7 @@ func (mock *HorizontalPodAutoscalerInterfaceMock) GetNamespacedCalls() []struct
}
// List calls ListFunc.
func (mock *HorizontalPodAutoscalerInterfaceMock) List(opts v1.ListOptions) (*v2beta2a.HorizontalPodAutoscalerList, error) {
func (mock *HorizontalPodAutoscalerInterfaceMock) List(opts v1.ListOptions) (*v2beta2.HorizontalPodAutoscalerList, error) {
if mock.ListFunc == nil {
panic("HorizontalPodAutoscalerInterfaceMock.ListFunc: method is nil but HorizontalPodAutoscalerInterface.List was just called")
}
@@ -1655,7 +1563,7 @@ func (mock *HorizontalPodAutoscalerInterfaceMock) ListCalls() []struct {
}
// ListNamespaced calls ListNamespacedFunc.
func (mock *HorizontalPodAutoscalerInterfaceMock) ListNamespaced(namespace string, opts v1.ListOptions) (*v2beta2a.HorizontalPodAutoscalerList, error) {
func (mock *HorizontalPodAutoscalerInterfaceMock) ListNamespaced(namespace string, opts v1.ListOptions) (*v2beta2.HorizontalPodAutoscalerList, error) {
if mock.ListNamespacedFunc == nil {
panic("HorizontalPodAutoscalerInterfaceMock.ListNamespacedFunc: method is nil but HorizontalPodAutoscalerInterface.ListNamespaced was just called")
}

View File

@@ -1,39 +0,0 @@
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
in.ListMeta.DeepCopyInto(&out.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
}

View File

@@ -50,12 +50,6 @@ func NewHorizontalPodAutoscaler(namespace, name string, obj v2beta2.HorizontalPo
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)
@@ -75,8 +69,6 @@ type HorizontalPodAutoscalerController interface {
AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler HorizontalPodAutoscalerHandlerFunc)
Enqueue(namespace, name string)
EnqueueAfter(namespace, name string, after time.Duration)
Sync(ctx context.Context) error
Start(ctx context.Context, threadiness int) error
}
type HorizontalPodAutoscalerInterface interface {
@@ -87,8 +79,8 @@ type HorizontalPodAutoscalerInterface interface {
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)
ListNamespaced(namespace string, opts metav1.ListOptions) (*HorizontalPodAutoscalerList, error)
List(opts metav1.ListOptions) (*v2beta2.HorizontalPodAutoscalerList, error)
ListNamespaced(namespace string, opts metav1.ListOptions) (*v2beta2.HorizontalPodAutoscalerList, error)
Watch(opts metav1.ListOptions) (watch.Interface, error)
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
Controller() HorizontalPodAutoscalerController
@@ -127,7 +119,7 @@ func (l *horizontalPodAutoscalerLister) Get(namespace, name string) (*v2beta2.Ho
if !exists {
return nil, errors.NewNotFound(schema.GroupResource{
Group: HorizontalPodAutoscalerGroupVersionKind.Group,
Resource: "horizontalPodAutoscaler",
Resource: HorizontalPodAutoscalerGroupVersionResource.Resource,
}, key)
}
return obj.(*v2beta2.HorizontalPodAutoscaler), nil
@@ -207,29 +199,16 @@ func (c horizontalPodAutoscalerFactory) Object() runtime.Object {
}
func (c horizontalPodAutoscalerFactory) List() runtime.Object {
return &HorizontalPodAutoscalerList{}
return &v2beta2.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)
s.client.controllerFactory.ForResourceKind(HorizontalPodAutoscalerGroupVersionResource, HorizontalPodAutoscalerGroupVersionKind.Kind, true))
c = &horizontalPodAutoscalerController{
return &horizontalPodAutoscalerController{
GenericController: genericController,
}
s.client.horizontalPodAutoscalerControllers[s.ns] = c
s.client.starters = append(s.client.starters, c)
return c
}
type horizontalPodAutoscalerClient struct {
@@ -263,6 +242,11 @@ func (s *horizontalPodAutoscalerClient) Update(o *v2beta2.HorizontalPodAutoscale
return obj.(*v2beta2.HorizontalPodAutoscaler), err
}
func (s *horizontalPodAutoscalerClient) UpdateStatus(o *v2beta2.HorizontalPodAutoscaler) (*v2beta2.HorizontalPodAutoscaler, error) {
obj, err := s.objectClient.UpdateStatus(o.Name, o)
return obj.(*v2beta2.HorizontalPodAutoscaler), err
}
func (s *horizontalPodAutoscalerClient) Delete(name string, options *metav1.DeleteOptions) error {
return s.objectClient.Delete(name, options)
}
@@ -271,14 +255,14 @@ func (s *horizontalPodAutoscalerClient) DeleteNamespaced(namespace, name string,
return s.objectClient.DeleteNamespaced(namespace, name, options)
}
func (s *horizontalPodAutoscalerClient) List(opts metav1.ListOptions) (*HorizontalPodAutoscalerList, error) {
func (s *horizontalPodAutoscalerClient) List(opts metav1.ListOptions) (*v2beta2.HorizontalPodAutoscalerList, error) {
obj, err := s.objectClient.List(opts)
return obj.(*HorizontalPodAutoscalerList), err
return obj.(*v2beta2.HorizontalPodAutoscalerList), err
}
func (s *horizontalPodAutoscalerClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*HorizontalPodAutoscalerList, error) {
func (s *horizontalPodAutoscalerClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*v2beta2.HorizontalPodAutoscalerList, error) {
obj, err := s.objectClient.ListNamespaced(namespace, opts)
return obj.(*HorizontalPodAutoscalerList), err
return obj.(*v2beta2.HorizontalPodAutoscalerList), err
}
func (s *horizontalPodAutoscalerClient) Watch(opts metav1.ListOptions) (watch.Interface, error) {

View File

@@ -1,71 +1,34 @@
package v2beta2
import (
"context"
"sync"
"github.com/rancher/norman/controller"
"github.com/rancher/lasso/pkg/client"
"github.com/rancher/lasso/pkg/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 Client struct {
sync.Mutex
restClient rest.Interface
starters []controller.Starter
horizontalPodAutoscalerControllers map[string]HorizontalPodAutoscalerController
controllerFactory controller.SharedControllerFactory
clientFactory client.SharedClientFactory
}
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
}
func NewFromControllerFactory(factory controller.SharedControllerFactory) (Interface, error) {
return &Client{
restClient: restClient,
horizontalPodAutoscalerControllers: map[string]HorizontalPodAutoscalerController{},
controllerFactory: factory,
clientFactory: factory.SharedCacheFactory().SharedClientFactory(),
}, 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{})
sharedClient := c.clientFactory.ForResourceKind(HorizontalPodAutoscalerGroupVersionResource, HorizontalPodAutoscalerGroupVersionKind.Kind, true)
objectClient := objectclient.NewObjectClient(namespace, sharedClient, &HorizontalPodAutoscalerResource, HorizontalPodAutoscalerGroupVersionKind, horizontalPodAutoscalerFactory{})
return &horizontalPodAutoscalerClient{
ns: namespace,
client: c,

View File

@@ -1,8 +1,6 @@
package v2beta2
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
)
@@ -23,19 +21,3 @@ func Kind(kind string) schema.GroupKind {
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
}