1
0
mirror of https://github.com/rancher/types.git synced 2025-08-31 12:48:45 +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 (
lockDaemonSetControllerMockGeneric sync.RWMutex
lockDaemonSetControllerMockInformer sync.RWMutex
lockDaemonSetControllerMockLister sync.RWMutex
lockDaemonSetControllerMockStart sync.RWMutex
lockDaemonSetControllerMockSync sync.RWMutex
)
// Ensure, that DaemonSetControllerMock does implement DaemonSetController.
@@ -192,12 +190,6 @@ var _ v1a.DaemonSetController = &DaemonSetControllerMock{}
// ListerFunc: func() v1a.DaemonSetLister {
// 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 mockedDaemonSetController in code that requires DaemonSetController
@@ -232,12 +224,6 @@ type DaemonSetControllerMock struct {
// ListerFunc mocks the Lister method.
ListerFunc func() v1a.DaemonSetLister
// 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 DaemonSetControllerMock 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 *DaemonSetControllerMock) ListerCalls() []struct {
return calls
}
// Start calls StartFunc.
func (mock *DaemonSetControllerMock) Start(ctx context.Context, threadiness int) error {
if mock.StartFunc == nil {
panic("DaemonSetControllerMock.StartFunc: method is nil but DaemonSetController.Start was just called")
}
callInfo := struct {
Ctx context.Context
Threadiness int
}{
Ctx: ctx,
Threadiness: threadiness,
}
lockDaemonSetControllerMockStart.Lock()
mock.calls.Start = append(mock.calls.Start, callInfo)
lockDaemonSetControllerMockStart.Unlock()
return mock.StartFunc(ctx, threadiness)
}
// StartCalls gets all the calls that were made to Start.
// Check the length with:
// len(mockedDaemonSetController.StartCalls())
func (mock *DaemonSetControllerMock) StartCalls() []struct {
Ctx context.Context
Threadiness int
} {
var calls []struct {
Ctx context.Context
Threadiness int
}
lockDaemonSetControllerMockStart.RLock()
calls = mock.calls.Start
lockDaemonSetControllerMockStart.RUnlock()
return calls
}
// Sync calls SyncFunc.
func (mock *DaemonSetControllerMock) Sync(ctx context.Context) error {
if mock.SyncFunc == nil {
panic("DaemonSetControllerMock.SyncFunc: method is nil but DaemonSetController.Sync was just called")
}
callInfo := struct {
Ctx context.Context
}{
Ctx: ctx,
}
lockDaemonSetControllerMockSync.Lock()
mock.calls.Sync = append(mock.calls.Sync, callInfo)
lockDaemonSetControllerMockSync.Unlock()
return mock.SyncFunc(ctx)
}
// SyncCalls gets all the calls that were made to Sync.
// Check the length with:
// len(mockedDaemonSetController.SyncCalls())
func (mock *DaemonSetControllerMock) SyncCalls() []struct {
Ctx context.Context
} {
var calls []struct {
Ctx context.Context
}
lockDaemonSetControllerMockSync.RLock()
calls = mock.calls.Sync
lockDaemonSetControllerMockSync.RUnlock()
return calls
}
var (
lockDaemonSetInterfaceMockAddClusterScopedFeatureHandler sync.RWMutex
lockDaemonSetInterfaceMockAddClusterScopedFeatureLifecycle sync.RWMutex
@@ -792,10 +700,10 @@ var _ v1a.DaemonSetInterface = &DaemonSetInterfaceMock{}
// GetNamespacedFunc: func(namespace string, name string, opts v1b.GetOptions) (*v1.DaemonSet, error) {
// panic("mock out the GetNamespaced method")
// },
// ListFunc: func(opts v1b.ListOptions) (*v1a.DaemonSetList, error) {
// ListFunc: func(opts v1b.ListOptions) (*v1.DaemonSetList, error) {
// panic("mock out the List method")
// },
// ListNamespacedFunc: func(namespace string, opts v1b.ListOptions) (*v1a.DaemonSetList, error) {
// ListNamespacedFunc: func(namespace string, opts v1b.ListOptions) (*v1.DaemonSetList, error) {
// panic("mock out the ListNamespaced method")
// },
// ObjectClientFunc: func() *objectclient.ObjectClient {
@@ -860,10 +768,10 @@ type DaemonSetInterfaceMock struct {
GetNamespacedFunc func(namespace string, name string, opts v1b.GetOptions) (*v1.DaemonSet, error)
// ListFunc mocks the List method.
ListFunc func(opts v1b.ListOptions) (*v1a.DaemonSetList, error)
ListFunc func(opts v1b.ListOptions) (*v1.DaemonSetList, error)
// ListNamespacedFunc mocks the ListNamespaced method.
ListNamespacedFunc func(namespace string, opts v1b.ListOptions) (*v1a.DaemonSetList, error)
ListNamespacedFunc func(namespace string, opts v1b.ListOptions) (*v1.DaemonSetList, error)
// ObjectClientFunc mocks the ObjectClient method.
ObjectClientFunc func() *objectclient.ObjectClient
@@ -1624,7 +1532,7 @@ func (mock *DaemonSetInterfaceMock) GetNamespacedCalls() []struct {
}
// List calls ListFunc.
func (mock *DaemonSetInterfaceMock) List(opts v1b.ListOptions) (*v1a.DaemonSetList, error) {
func (mock *DaemonSetInterfaceMock) List(opts v1b.ListOptions) (*v1.DaemonSetList, error) {
if mock.ListFunc == nil {
panic("DaemonSetInterfaceMock.ListFunc: method is nil but DaemonSetInterface.List was just called")
}
@@ -1655,7 +1563,7 @@ func (mock *DaemonSetInterfaceMock) ListCalls() []struct {
}
// ListNamespaced calls ListNamespacedFunc.
func (mock *DaemonSetInterfaceMock) ListNamespaced(namespace string, opts v1b.ListOptions) (*v1a.DaemonSetList, error) {
func (mock *DaemonSetInterfaceMock) ListNamespaced(namespace string, opts v1b.ListOptions) (*v1.DaemonSetList, error) {
if mock.ListNamespacedFunc == nil {
panic("DaemonSetInterfaceMock.ListNamespacedFunc: method is nil but DaemonSetInterface.ListNamespaced was just called")
}

View File

@@ -151,8 +151,6 @@ var (
lockDeploymentControllerMockGeneric sync.RWMutex
lockDeploymentControllerMockInformer sync.RWMutex
lockDeploymentControllerMockLister sync.RWMutex
lockDeploymentControllerMockStart sync.RWMutex
lockDeploymentControllerMockSync sync.RWMutex
)
// Ensure, that DeploymentControllerMock does implement DeploymentController.
@@ -192,12 +190,6 @@ var _ v1a.DeploymentController = &DeploymentControllerMock{}
// ListerFunc: func() v1a.DeploymentLister {
// 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 mockedDeploymentController in code that requires DeploymentController
@@ -232,12 +224,6 @@ type DeploymentControllerMock struct {
// ListerFunc mocks the Lister method.
ListerFunc func() v1a.DeploymentLister
// 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 DeploymentControllerMock 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 *DeploymentControllerMock) ListerCalls() []struct {
return calls
}
// Start calls StartFunc.
func (mock *DeploymentControllerMock) Start(ctx context.Context, threadiness int) error {
if mock.StartFunc == nil {
panic("DeploymentControllerMock.StartFunc: method is nil but DeploymentController.Start was just called")
}
callInfo := struct {
Ctx context.Context
Threadiness int
}{
Ctx: ctx,
Threadiness: threadiness,
}
lockDeploymentControllerMockStart.Lock()
mock.calls.Start = append(mock.calls.Start, callInfo)
lockDeploymentControllerMockStart.Unlock()
return mock.StartFunc(ctx, threadiness)
}
// StartCalls gets all the calls that were made to Start.
// Check the length with:
// len(mockedDeploymentController.StartCalls())
func (mock *DeploymentControllerMock) StartCalls() []struct {
Ctx context.Context
Threadiness int
} {
var calls []struct {
Ctx context.Context
Threadiness int
}
lockDeploymentControllerMockStart.RLock()
calls = mock.calls.Start
lockDeploymentControllerMockStart.RUnlock()
return calls
}
// Sync calls SyncFunc.
func (mock *DeploymentControllerMock) Sync(ctx context.Context) error {
if mock.SyncFunc == nil {
panic("DeploymentControllerMock.SyncFunc: method is nil but DeploymentController.Sync was just called")
}
callInfo := struct {
Ctx context.Context
}{
Ctx: ctx,
}
lockDeploymentControllerMockSync.Lock()
mock.calls.Sync = append(mock.calls.Sync, callInfo)
lockDeploymentControllerMockSync.Unlock()
return mock.SyncFunc(ctx)
}
// SyncCalls gets all the calls that were made to Sync.
// Check the length with:
// len(mockedDeploymentController.SyncCalls())
func (mock *DeploymentControllerMock) SyncCalls() []struct {
Ctx context.Context
} {
var calls []struct {
Ctx context.Context
}
lockDeploymentControllerMockSync.RLock()
calls = mock.calls.Sync
lockDeploymentControllerMockSync.RUnlock()
return calls
}
var (
lockDeploymentInterfaceMockAddClusterScopedFeatureHandler sync.RWMutex
lockDeploymentInterfaceMockAddClusterScopedFeatureLifecycle sync.RWMutex
@@ -792,10 +700,10 @@ var _ v1a.DeploymentInterface = &DeploymentInterfaceMock{}
// GetNamespacedFunc: func(namespace string, name string, opts v1b.GetOptions) (*v1.Deployment, error) {
// panic("mock out the GetNamespaced method")
// },
// ListFunc: func(opts v1b.ListOptions) (*v1a.DeploymentList, error) {
// ListFunc: func(opts v1b.ListOptions) (*v1.DeploymentList, error) {
// panic("mock out the List method")
// },
// ListNamespacedFunc: func(namespace string, opts v1b.ListOptions) (*v1a.DeploymentList, error) {
// ListNamespacedFunc: func(namespace string, opts v1b.ListOptions) (*v1.DeploymentList, error) {
// panic("mock out the ListNamespaced method")
// },
// ObjectClientFunc: func() *objectclient.ObjectClient {
@@ -860,10 +768,10 @@ type DeploymentInterfaceMock struct {
GetNamespacedFunc func(namespace string, name string, opts v1b.GetOptions) (*v1.Deployment, error)
// ListFunc mocks the List method.
ListFunc func(opts v1b.ListOptions) (*v1a.DeploymentList, error)
ListFunc func(opts v1b.ListOptions) (*v1.DeploymentList, error)
// ListNamespacedFunc mocks the ListNamespaced method.
ListNamespacedFunc func(namespace string, opts v1b.ListOptions) (*v1a.DeploymentList, error)
ListNamespacedFunc func(namespace string, opts v1b.ListOptions) (*v1.DeploymentList, error)
// ObjectClientFunc mocks the ObjectClient method.
ObjectClientFunc func() *objectclient.ObjectClient
@@ -1624,7 +1532,7 @@ func (mock *DeploymentInterfaceMock) GetNamespacedCalls() []struct {
}
// List calls ListFunc.
func (mock *DeploymentInterfaceMock) List(opts v1b.ListOptions) (*v1a.DeploymentList, error) {
func (mock *DeploymentInterfaceMock) List(opts v1b.ListOptions) (*v1.DeploymentList, error) {
if mock.ListFunc == nil {
panic("DeploymentInterfaceMock.ListFunc: method is nil but DeploymentInterface.List was just called")
}
@@ -1655,7 +1563,7 @@ func (mock *DeploymentInterfaceMock) ListCalls() []struct {
}
// ListNamespaced calls ListNamespacedFunc.
func (mock *DeploymentInterfaceMock) ListNamespaced(namespace string, opts v1b.ListOptions) (*v1a.DeploymentList, error) {
func (mock *DeploymentInterfaceMock) ListNamespaced(namespace string, opts v1b.ListOptions) (*v1.DeploymentList, error) {
if mock.ListNamespacedFunc == nil {
panic("DeploymentInterfaceMock.ListNamespacedFunc: method is nil but DeploymentInterface.ListNamespaced was just called")
}

View File

@@ -151,8 +151,6 @@ var (
lockReplicaSetControllerMockGeneric sync.RWMutex
lockReplicaSetControllerMockInformer sync.RWMutex
lockReplicaSetControllerMockLister sync.RWMutex
lockReplicaSetControllerMockStart sync.RWMutex
lockReplicaSetControllerMockSync sync.RWMutex
)
// Ensure, that ReplicaSetControllerMock does implement ReplicaSetController.
@@ -192,12 +190,6 @@ var _ v1a.ReplicaSetController = &ReplicaSetControllerMock{}
// ListerFunc: func() v1a.ReplicaSetLister {
// 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 mockedReplicaSetController in code that requires ReplicaSetController
@@ -232,12 +224,6 @@ type ReplicaSetControllerMock struct {
// ListerFunc mocks the Lister method.
ListerFunc func() v1a.ReplicaSetLister
// 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 ReplicaSetControllerMock 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 *ReplicaSetControllerMock) ListerCalls() []struct {
return calls
}
// Start calls StartFunc.
func (mock *ReplicaSetControllerMock) Start(ctx context.Context, threadiness int) error {
if mock.StartFunc == nil {
panic("ReplicaSetControllerMock.StartFunc: method is nil but ReplicaSetController.Start was just called")
}
callInfo := struct {
Ctx context.Context
Threadiness int
}{
Ctx: ctx,
Threadiness: threadiness,
}
lockReplicaSetControllerMockStart.Lock()
mock.calls.Start = append(mock.calls.Start, callInfo)
lockReplicaSetControllerMockStart.Unlock()
return mock.StartFunc(ctx, threadiness)
}
// StartCalls gets all the calls that were made to Start.
// Check the length with:
// len(mockedReplicaSetController.StartCalls())
func (mock *ReplicaSetControllerMock) StartCalls() []struct {
Ctx context.Context
Threadiness int
} {
var calls []struct {
Ctx context.Context
Threadiness int
}
lockReplicaSetControllerMockStart.RLock()
calls = mock.calls.Start
lockReplicaSetControllerMockStart.RUnlock()
return calls
}
// Sync calls SyncFunc.
func (mock *ReplicaSetControllerMock) Sync(ctx context.Context) error {
if mock.SyncFunc == nil {
panic("ReplicaSetControllerMock.SyncFunc: method is nil but ReplicaSetController.Sync was just called")
}
callInfo := struct {
Ctx context.Context
}{
Ctx: ctx,
}
lockReplicaSetControllerMockSync.Lock()
mock.calls.Sync = append(mock.calls.Sync, callInfo)
lockReplicaSetControllerMockSync.Unlock()
return mock.SyncFunc(ctx)
}
// SyncCalls gets all the calls that were made to Sync.
// Check the length with:
// len(mockedReplicaSetController.SyncCalls())
func (mock *ReplicaSetControllerMock) SyncCalls() []struct {
Ctx context.Context
} {
var calls []struct {
Ctx context.Context
}
lockReplicaSetControllerMockSync.RLock()
calls = mock.calls.Sync
lockReplicaSetControllerMockSync.RUnlock()
return calls
}
var (
lockReplicaSetInterfaceMockAddClusterScopedFeatureHandler sync.RWMutex
lockReplicaSetInterfaceMockAddClusterScopedFeatureLifecycle sync.RWMutex
@@ -792,10 +700,10 @@ var _ v1a.ReplicaSetInterface = &ReplicaSetInterfaceMock{}
// GetNamespacedFunc: func(namespace string, name string, opts v1b.GetOptions) (*v1.ReplicaSet, error) {
// panic("mock out the GetNamespaced method")
// },
// ListFunc: func(opts v1b.ListOptions) (*v1a.ReplicaSetList, error) {
// ListFunc: func(opts v1b.ListOptions) (*v1.ReplicaSetList, error) {
// panic("mock out the List method")
// },
// ListNamespacedFunc: func(namespace string, opts v1b.ListOptions) (*v1a.ReplicaSetList, error) {
// ListNamespacedFunc: func(namespace string, opts v1b.ListOptions) (*v1.ReplicaSetList, error) {
// panic("mock out the ListNamespaced method")
// },
// ObjectClientFunc: func() *objectclient.ObjectClient {
@@ -860,10 +768,10 @@ type ReplicaSetInterfaceMock struct {
GetNamespacedFunc func(namespace string, name string, opts v1b.GetOptions) (*v1.ReplicaSet, error)
// ListFunc mocks the List method.
ListFunc func(opts v1b.ListOptions) (*v1a.ReplicaSetList, error)
ListFunc func(opts v1b.ListOptions) (*v1.ReplicaSetList, error)
// ListNamespacedFunc mocks the ListNamespaced method.
ListNamespacedFunc func(namespace string, opts v1b.ListOptions) (*v1a.ReplicaSetList, error)
ListNamespacedFunc func(namespace string, opts v1b.ListOptions) (*v1.ReplicaSetList, error)
// ObjectClientFunc mocks the ObjectClient method.
ObjectClientFunc func() *objectclient.ObjectClient
@@ -1624,7 +1532,7 @@ func (mock *ReplicaSetInterfaceMock) GetNamespacedCalls() []struct {
}
// List calls ListFunc.
func (mock *ReplicaSetInterfaceMock) List(opts v1b.ListOptions) (*v1a.ReplicaSetList, error) {
func (mock *ReplicaSetInterfaceMock) List(opts v1b.ListOptions) (*v1.ReplicaSetList, error) {
if mock.ListFunc == nil {
panic("ReplicaSetInterfaceMock.ListFunc: method is nil but ReplicaSetInterface.List was just called")
}
@@ -1655,7 +1563,7 @@ func (mock *ReplicaSetInterfaceMock) ListCalls() []struct {
}
// ListNamespaced calls ListNamespacedFunc.
func (mock *ReplicaSetInterfaceMock) ListNamespaced(namespace string, opts v1b.ListOptions) (*v1a.ReplicaSetList, error) {
func (mock *ReplicaSetInterfaceMock) ListNamespaced(namespace string, opts v1b.ListOptions) (*v1.ReplicaSetList, error) {
if mock.ListNamespacedFunc == nil {
panic("ReplicaSetInterfaceMock.ListNamespacedFunc: method is nil but ReplicaSetInterface.ListNamespaced was just called")
}

View File

@@ -151,8 +151,6 @@ var (
lockStatefulSetControllerMockGeneric sync.RWMutex
lockStatefulSetControllerMockInformer sync.RWMutex
lockStatefulSetControllerMockLister sync.RWMutex
lockStatefulSetControllerMockStart sync.RWMutex
lockStatefulSetControllerMockSync sync.RWMutex
)
// Ensure, that StatefulSetControllerMock does implement StatefulSetController.
@@ -192,12 +190,6 @@ var _ v1a.StatefulSetController = &StatefulSetControllerMock{}
// ListerFunc: func() v1a.StatefulSetLister {
// 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 mockedStatefulSetController in code that requires StatefulSetController
@@ -232,12 +224,6 @@ type StatefulSetControllerMock struct {
// ListerFunc mocks the Lister method.
ListerFunc func() v1a.StatefulSetLister
// 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 StatefulSetControllerMock 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 *StatefulSetControllerMock) ListerCalls() []struct {
return calls
}
// Start calls StartFunc.
func (mock *StatefulSetControllerMock) Start(ctx context.Context, threadiness int) error {
if mock.StartFunc == nil {
panic("StatefulSetControllerMock.StartFunc: method is nil but StatefulSetController.Start was just called")
}
callInfo := struct {
Ctx context.Context
Threadiness int
}{
Ctx: ctx,
Threadiness: threadiness,
}
lockStatefulSetControllerMockStart.Lock()
mock.calls.Start = append(mock.calls.Start, callInfo)
lockStatefulSetControllerMockStart.Unlock()
return mock.StartFunc(ctx, threadiness)
}
// StartCalls gets all the calls that were made to Start.
// Check the length with:
// len(mockedStatefulSetController.StartCalls())
func (mock *StatefulSetControllerMock) StartCalls() []struct {
Ctx context.Context
Threadiness int
} {
var calls []struct {
Ctx context.Context
Threadiness int
}
lockStatefulSetControllerMockStart.RLock()
calls = mock.calls.Start
lockStatefulSetControllerMockStart.RUnlock()
return calls
}
// Sync calls SyncFunc.
func (mock *StatefulSetControllerMock) Sync(ctx context.Context) error {
if mock.SyncFunc == nil {
panic("StatefulSetControllerMock.SyncFunc: method is nil but StatefulSetController.Sync was just called")
}
callInfo := struct {
Ctx context.Context
}{
Ctx: ctx,
}
lockStatefulSetControllerMockSync.Lock()
mock.calls.Sync = append(mock.calls.Sync, callInfo)
lockStatefulSetControllerMockSync.Unlock()
return mock.SyncFunc(ctx)
}
// SyncCalls gets all the calls that were made to Sync.
// Check the length with:
// len(mockedStatefulSetController.SyncCalls())
func (mock *StatefulSetControllerMock) SyncCalls() []struct {
Ctx context.Context
} {
var calls []struct {
Ctx context.Context
}
lockStatefulSetControllerMockSync.RLock()
calls = mock.calls.Sync
lockStatefulSetControllerMockSync.RUnlock()
return calls
}
var (
lockStatefulSetInterfaceMockAddClusterScopedFeatureHandler sync.RWMutex
lockStatefulSetInterfaceMockAddClusterScopedFeatureLifecycle sync.RWMutex
@@ -792,10 +700,10 @@ var _ v1a.StatefulSetInterface = &StatefulSetInterfaceMock{}
// GetNamespacedFunc: func(namespace string, name string, opts v1b.GetOptions) (*v1.StatefulSet, error) {
// panic("mock out the GetNamespaced method")
// },
// ListFunc: func(opts v1b.ListOptions) (*v1a.StatefulSetList, error) {
// ListFunc: func(opts v1b.ListOptions) (*v1.StatefulSetList, error) {
// panic("mock out the List method")
// },
// ListNamespacedFunc: func(namespace string, opts v1b.ListOptions) (*v1a.StatefulSetList, error) {
// ListNamespacedFunc: func(namespace string, opts v1b.ListOptions) (*v1.StatefulSetList, error) {
// panic("mock out the ListNamespaced method")
// },
// ObjectClientFunc: func() *objectclient.ObjectClient {
@@ -860,10 +768,10 @@ type StatefulSetInterfaceMock struct {
GetNamespacedFunc func(namespace string, name string, opts v1b.GetOptions) (*v1.StatefulSet, error)
// ListFunc mocks the List method.
ListFunc func(opts v1b.ListOptions) (*v1a.StatefulSetList, error)
ListFunc func(opts v1b.ListOptions) (*v1.StatefulSetList, error)
// ListNamespacedFunc mocks the ListNamespaced method.
ListNamespacedFunc func(namespace string, opts v1b.ListOptions) (*v1a.StatefulSetList, error)
ListNamespacedFunc func(namespace string, opts v1b.ListOptions) (*v1.StatefulSetList, error)
// ObjectClientFunc mocks the ObjectClient method.
ObjectClientFunc func() *objectclient.ObjectClient
@@ -1624,7 +1532,7 @@ func (mock *StatefulSetInterfaceMock) GetNamespacedCalls() []struct {
}
// List calls ListFunc.
func (mock *StatefulSetInterfaceMock) List(opts v1b.ListOptions) (*v1a.StatefulSetList, error) {
func (mock *StatefulSetInterfaceMock) List(opts v1b.ListOptions) (*v1.StatefulSetList, error) {
if mock.ListFunc == nil {
panic("StatefulSetInterfaceMock.ListFunc: method is nil but StatefulSetInterface.List was just called")
}
@@ -1655,7 +1563,7 @@ func (mock *StatefulSetInterfaceMock) ListCalls() []struct {
}
// ListNamespaced calls ListNamespacedFunc.
func (mock *StatefulSetInterfaceMock) ListNamespaced(namespace string, opts v1b.ListOptions) (*v1a.StatefulSetList, error) {
func (mock *StatefulSetInterfaceMock) ListNamespaced(namespace string, opts v1b.ListOptions) (*v1.StatefulSetList, error) {
if mock.ListNamespacedFunc == nil {
panic("StatefulSetInterfaceMock.ListNamespacedFunc: method is nil but StatefulSetInterface.ListNamespaced was just called")
}

View File

@@ -50,12 +50,6 @@ func NewDaemonSet(namespace, name string, obj v1.DaemonSet) *v1.DaemonSet {
return &obj
}
type DaemonSetList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []v1.DaemonSet `json:"items"`
}
type DaemonSetHandlerFunc func(key string, obj *v1.DaemonSet) (runtime.Object, error)
type DaemonSetChangeHandlerFunc func(obj *v1.DaemonSet) (runtime.Object, error)
@@ -75,8 +69,6 @@ type DaemonSetController interface {
AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler DaemonSetHandlerFunc)
Enqueue(namespace, name string)
EnqueueAfter(namespace, name string, after time.Duration)
Sync(ctx context.Context) error
Start(ctx context.Context, threadiness int) error
}
type DaemonSetInterface interface {
@@ -87,8 +79,8 @@ type DaemonSetInterface interface {
Update(*v1.DaemonSet) (*v1.DaemonSet, error)
Delete(name string, options *metav1.DeleteOptions) error
DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error
List(opts metav1.ListOptions) (*DaemonSetList, error)
ListNamespaced(namespace string, opts metav1.ListOptions) (*DaemonSetList, error)
List(opts metav1.ListOptions) (*v1.DaemonSetList, error)
ListNamespaced(namespace string, opts metav1.ListOptions) (*v1.DaemonSetList, error)
Watch(opts metav1.ListOptions) (watch.Interface, error)
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
Controller() DaemonSetController
@@ -127,7 +119,7 @@ func (l *daemonSetLister) Get(namespace, name string) (*v1.DaemonSet, error) {
if !exists {
return nil, errors.NewNotFound(schema.GroupResource{
Group: DaemonSetGroupVersionKind.Group,
Resource: "daemonSet",
Resource: DaemonSetGroupVersionResource.Resource,
}, key)
}
return obj.(*v1.DaemonSet), nil
@@ -207,29 +199,16 @@ func (c daemonSetFactory) Object() runtime.Object {
}
func (c daemonSetFactory) List() runtime.Object {
return &DaemonSetList{}
return &v1.DaemonSetList{}
}
func (s *daemonSetClient) Controller() DaemonSetController {
s.client.Lock()
defer s.client.Unlock()
c, ok := s.client.daemonSetControllers[s.ns]
if ok {
return c
}
genericController := controller.NewGenericController(DaemonSetGroupVersionKind.Kind+"Controller",
s.objectClient)
s.client.controllerFactory.ForResourceKind(DaemonSetGroupVersionResource, DaemonSetGroupVersionKind.Kind, true))
c = &daemonSetController{
return &daemonSetController{
GenericController: genericController,
}
s.client.daemonSetControllers[s.ns] = c
s.client.starters = append(s.client.starters, c)
return c
}
type daemonSetClient struct {
@@ -263,6 +242,11 @@ func (s *daemonSetClient) Update(o *v1.DaemonSet) (*v1.DaemonSet, error) {
return obj.(*v1.DaemonSet), err
}
func (s *daemonSetClient) UpdateStatus(o *v1.DaemonSet) (*v1.DaemonSet, error) {
obj, err := s.objectClient.UpdateStatus(o.Name, o)
return obj.(*v1.DaemonSet), err
}
func (s *daemonSetClient) Delete(name string, options *metav1.DeleteOptions) error {
return s.objectClient.Delete(name, options)
}
@@ -271,14 +255,14 @@ func (s *daemonSetClient) DeleteNamespaced(namespace, name string, options *meta
return s.objectClient.DeleteNamespaced(namespace, name, options)
}
func (s *daemonSetClient) List(opts metav1.ListOptions) (*DaemonSetList, error) {
func (s *daemonSetClient) List(opts metav1.ListOptions) (*v1.DaemonSetList, error) {
obj, err := s.objectClient.List(opts)
return obj.(*DaemonSetList), err
return obj.(*v1.DaemonSetList), err
}
func (s *daemonSetClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*DaemonSetList, error) {
func (s *daemonSetClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*v1.DaemonSetList, error) {
obj, err := s.objectClient.ListNamespaced(namespace, opts)
return obj.(*DaemonSetList), err
return obj.(*v1.DaemonSetList), err
}
func (s *daemonSetClient) Watch(opts metav1.ListOptions) (watch.Interface, error) {

View File

@@ -1,138 +0,0 @@
package v1
import (
appsv1 "k8s.io/api/apps/v1"
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 *DaemonSetList) DeepCopyInto(out *DaemonSetList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]appsv1.DaemonSet, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DaemonSetList.
func (in *DaemonSetList) DeepCopy() *DaemonSetList {
if in == nil {
return nil
}
out := new(DaemonSetList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *DaemonSetList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *DeploymentList) DeepCopyInto(out *DeploymentList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]appsv1.Deployment, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeploymentList.
func (in *DeploymentList) DeepCopy() *DeploymentList {
if in == nil {
return nil
}
out := new(DeploymentList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *DeploymentList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ReplicaSetList) DeepCopyInto(out *ReplicaSetList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]appsv1.ReplicaSet, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReplicaSetList.
func (in *ReplicaSetList) DeepCopy() *ReplicaSetList {
if in == nil {
return nil
}
out := new(ReplicaSetList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ReplicaSetList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *StatefulSetList) DeepCopyInto(out *StatefulSetList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]appsv1.StatefulSet, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StatefulSetList.
func (in *StatefulSetList) DeepCopy() *StatefulSetList {
if in == nil {
return nil
}
out := new(StatefulSetList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *StatefulSetList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}

View File

@@ -50,12 +50,6 @@ func NewDeployment(namespace, name string, obj v1.Deployment) *v1.Deployment {
return &obj
}
type DeploymentList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []v1.Deployment `json:"items"`
}
type DeploymentHandlerFunc func(key string, obj *v1.Deployment) (runtime.Object, error)
type DeploymentChangeHandlerFunc func(obj *v1.Deployment) (runtime.Object, error)
@@ -75,8 +69,6 @@ type DeploymentController interface {
AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler DeploymentHandlerFunc)
Enqueue(namespace, name string)
EnqueueAfter(namespace, name string, after time.Duration)
Sync(ctx context.Context) error
Start(ctx context.Context, threadiness int) error
}
type DeploymentInterface interface {
@@ -87,8 +79,8 @@ type DeploymentInterface interface {
Update(*v1.Deployment) (*v1.Deployment, error)
Delete(name string, options *metav1.DeleteOptions) error
DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error
List(opts metav1.ListOptions) (*DeploymentList, error)
ListNamespaced(namespace string, opts metav1.ListOptions) (*DeploymentList, error)
List(opts metav1.ListOptions) (*v1.DeploymentList, error)
ListNamespaced(namespace string, opts metav1.ListOptions) (*v1.DeploymentList, error)
Watch(opts metav1.ListOptions) (watch.Interface, error)
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
Controller() DeploymentController
@@ -127,7 +119,7 @@ func (l *deploymentLister) Get(namespace, name string) (*v1.Deployment, error) {
if !exists {
return nil, errors.NewNotFound(schema.GroupResource{
Group: DeploymentGroupVersionKind.Group,
Resource: "deployment",
Resource: DeploymentGroupVersionResource.Resource,
}, key)
}
return obj.(*v1.Deployment), nil
@@ -207,29 +199,16 @@ func (c deploymentFactory) Object() runtime.Object {
}
func (c deploymentFactory) List() runtime.Object {
return &DeploymentList{}
return &v1.DeploymentList{}
}
func (s *deploymentClient) Controller() DeploymentController {
s.client.Lock()
defer s.client.Unlock()
c, ok := s.client.deploymentControllers[s.ns]
if ok {
return c
}
genericController := controller.NewGenericController(DeploymentGroupVersionKind.Kind+"Controller",
s.objectClient)
s.client.controllerFactory.ForResourceKind(DeploymentGroupVersionResource, DeploymentGroupVersionKind.Kind, true))
c = &deploymentController{
return &deploymentController{
GenericController: genericController,
}
s.client.deploymentControllers[s.ns] = c
s.client.starters = append(s.client.starters, c)
return c
}
type deploymentClient struct {
@@ -263,6 +242,11 @@ func (s *deploymentClient) Update(o *v1.Deployment) (*v1.Deployment, error) {
return obj.(*v1.Deployment), err
}
func (s *deploymentClient) UpdateStatus(o *v1.Deployment) (*v1.Deployment, error) {
obj, err := s.objectClient.UpdateStatus(o.Name, o)
return obj.(*v1.Deployment), err
}
func (s *deploymentClient) Delete(name string, options *metav1.DeleteOptions) error {
return s.objectClient.Delete(name, options)
}
@@ -271,14 +255,14 @@ func (s *deploymentClient) DeleteNamespaced(namespace, name string, options *met
return s.objectClient.DeleteNamespaced(namespace, name, options)
}
func (s *deploymentClient) List(opts metav1.ListOptions) (*DeploymentList, error) {
func (s *deploymentClient) List(opts metav1.ListOptions) (*v1.DeploymentList, error) {
obj, err := s.objectClient.List(opts)
return obj.(*DeploymentList), err
return obj.(*v1.DeploymentList), err
}
func (s *deploymentClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*DeploymentList, error) {
func (s *deploymentClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*v1.DeploymentList, error) {
obj, err := s.objectClient.ListNamespaced(namespace, opts)
return obj.(*DeploymentList), err
return obj.(*v1.DeploymentList), err
}
func (s *deploymentClient) Watch(opts metav1.ListOptions) (watch.Interface, error) {

View File

@@ -1,25 +1,12 @@
package v1
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
DeploymentsGetter
DaemonSetsGetter
StatefulSetsGetter
@@ -27,54 +14,24 @@ type Interface interface {
}
type Client struct {
sync.Mutex
restClient rest.Interface
starters []controller.Starter
deploymentControllers map[string]DeploymentController
daemonSetControllers map[string]DaemonSetController
statefulSetControllers map[string]StatefulSetController
replicaSetControllers map[string]ReplicaSetController
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,
deploymentControllers: map[string]DeploymentController{},
daemonSetControllers: map[string]DaemonSetController{},
statefulSetControllers: map[string]StatefulSetController{},
replicaSetControllers: map[string]ReplicaSetController{},
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 DeploymentsGetter interface {
Deployments(namespace string) DeploymentInterface
}
func (c *Client) Deployments(namespace string) DeploymentInterface {
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &DeploymentResource, DeploymentGroupVersionKind, deploymentFactory{})
sharedClient := c.clientFactory.ForResourceKind(DeploymentGroupVersionResource, DeploymentGroupVersionKind.Kind, true)
objectClient := objectclient.NewObjectClient(namespace, sharedClient, &DeploymentResource, DeploymentGroupVersionKind, deploymentFactory{})
return &deploymentClient{
ns: namespace,
client: c,
@@ -87,7 +44,8 @@ type DaemonSetsGetter interface {
}
func (c *Client) DaemonSets(namespace string) DaemonSetInterface {
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &DaemonSetResource, DaemonSetGroupVersionKind, daemonSetFactory{})
sharedClient := c.clientFactory.ForResourceKind(DaemonSetGroupVersionResource, DaemonSetGroupVersionKind.Kind, true)
objectClient := objectclient.NewObjectClient(namespace, sharedClient, &DaemonSetResource, DaemonSetGroupVersionKind, daemonSetFactory{})
return &daemonSetClient{
ns: namespace,
client: c,
@@ -100,7 +58,8 @@ type StatefulSetsGetter interface {
}
func (c *Client) StatefulSets(namespace string) StatefulSetInterface {
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &StatefulSetResource, StatefulSetGroupVersionKind, statefulSetFactory{})
sharedClient := c.clientFactory.ForResourceKind(StatefulSetGroupVersionResource, StatefulSetGroupVersionKind.Kind, true)
objectClient := objectclient.NewObjectClient(namespace, sharedClient, &StatefulSetResource, StatefulSetGroupVersionKind, statefulSetFactory{})
return &statefulSetClient{
ns: namespace,
client: c,
@@ -113,7 +72,8 @@ type ReplicaSetsGetter interface {
}
func (c *Client) ReplicaSets(namespace string) ReplicaSetInterface {
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &ReplicaSetResource, ReplicaSetGroupVersionKind, replicaSetFactory{})
sharedClient := c.clientFactory.ForResourceKind(ReplicaSetGroupVersionResource, ReplicaSetGroupVersionKind.Kind, true)
objectClient := objectclient.NewObjectClient(namespace, sharedClient, &ReplicaSetResource, ReplicaSetGroupVersionKind, replicaSetFactory{})
return &replicaSetClient{
ns: namespace,
client: c,

View File

@@ -50,12 +50,6 @@ func NewReplicaSet(namespace, name string, obj v1.ReplicaSet) *v1.ReplicaSet {
return &obj
}
type ReplicaSetList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []v1.ReplicaSet `json:"items"`
}
type ReplicaSetHandlerFunc func(key string, obj *v1.ReplicaSet) (runtime.Object, error)
type ReplicaSetChangeHandlerFunc func(obj *v1.ReplicaSet) (runtime.Object, error)
@@ -75,8 +69,6 @@ type ReplicaSetController interface {
AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler ReplicaSetHandlerFunc)
Enqueue(namespace, name string)
EnqueueAfter(namespace, name string, after time.Duration)
Sync(ctx context.Context) error
Start(ctx context.Context, threadiness int) error
}
type ReplicaSetInterface interface {
@@ -87,8 +79,8 @@ type ReplicaSetInterface interface {
Update(*v1.ReplicaSet) (*v1.ReplicaSet, error)
Delete(name string, options *metav1.DeleteOptions) error
DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error
List(opts metav1.ListOptions) (*ReplicaSetList, error)
ListNamespaced(namespace string, opts metav1.ListOptions) (*ReplicaSetList, error)
List(opts metav1.ListOptions) (*v1.ReplicaSetList, error)
ListNamespaced(namespace string, opts metav1.ListOptions) (*v1.ReplicaSetList, error)
Watch(opts metav1.ListOptions) (watch.Interface, error)
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
Controller() ReplicaSetController
@@ -127,7 +119,7 @@ func (l *replicaSetLister) Get(namespace, name string) (*v1.ReplicaSet, error) {
if !exists {
return nil, errors.NewNotFound(schema.GroupResource{
Group: ReplicaSetGroupVersionKind.Group,
Resource: "replicaSet",
Resource: ReplicaSetGroupVersionResource.Resource,
}, key)
}
return obj.(*v1.ReplicaSet), nil
@@ -207,29 +199,16 @@ func (c replicaSetFactory) Object() runtime.Object {
}
func (c replicaSetFactory) List() runtime.Object {
return &ReplicaSetList{}
return &v1.ReplicaSetList{}
}
func (s *replicaSetClient) Controller() ReplicaSetController {
s.client.Lock()
defer s.client.Unlock()
c, ok := s.client.replicaSetControllers[s.ns]
if ok {
return c
}
genericController := controller.NewGenericController(ReplicaSetGroupVersionKind.Kind+"Controller",
s.objectClient)
s.client.controllerFactory.ForResourceKind(ReplicaSetGroupVersionResource, ReplicaSetGroupVersionKind.Kind, true))
c = &replicaSetController{
return &replicaSetController{
GenericController: genericController,
}
s.client.replicaSetControllers[s.ns] = c
s.client.starters = append(s.client.starters, c)
return c
}
type replicaSetClient struct {
@@ -263,6 +242,11 @@ func (s *replicaSetClient) Update(o *v1.ReplicaSet) (*v1.ReplicaSet, error) {
return obj.(*v1.ReplicaSet), err
}
func (s *replicaSetClient) UpdateStatus(o *v1.ReplicaSet) (*v1.ReplicaSet, error) {
obj, err := s.objectClient.UpdateStatus(o.Name, o)
return obj.(*v1.ReplicaSet), err
}
func (s *replicaSetClient) Delete(name string, options *metav1.DeleteOptions) error {
return s.objectClient.Delete(name, options)
}
@@ -271,14 +255,14 @@ func (s *replicaSetClient) DeleteNamespaced(namespace, name string, options *met
return s.objectClient.DeleteNamespaced(namespace, name, options)
}
func (s *replicaSetClient) List(opts metav1.ListOptions) (*ReplicaSetList, error) {
func (s *replicaSetClient) List(opts metav1.ListOptions) (*v1.ReplicaSetList, error) {
obj, err := s.objectClient.List(opts)
return obj.(*ReplicaSetList), err
return obj.(*v1.ReplicaSetList), err
}
func (s *replicaSetClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*ReplicaSetList, error) {
func (s *replicaSetClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*v1.ReplicaSetList, error) {
obj, err := s.objectClient.ListNamespaced(namespace, opts)
return obj.(*ReplicaSetList), err
return obj.(*v1.ReplicaSetList), err
}
func (s *replicaSetClient) Watch(opts metav1.ListOptions) (watch.Interface, error) {

View File

@@ -1,8 +1,6 @@
package v1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
)
@@ -23,22 +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,
&DeploymentList{},
&DaemonSetList{},
&StatefulSetList{},
&ReplicaSetList{},
)
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
return nil
}

View File

@@ -50,12 +50,6 @@ func NewStatefulSet(namespace, name string, obj v1.StatefulSet) *v1.StatefulSet
return &obj
}
type StatefulSetList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []v1.StatefulSet `json:"items"`
}
type StatefulSetHandlerFunc func(key string, obj *v1.StatefulSet) (runtime.Object, error)
type StatefulSetChangeHandlerFunc func(obj *v1.StatefulSet) (runtime.Object, error)
@@ -75,8 +69,6 @@ type StatefulSetController interface {
AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler StatefulSetHandlerFunc)
Enqueue(namespace, name string)
EnqueueAfter(namespace, name string, after time.Duration)
Sync(ctx context.Context) error
Start(ctx context.Context, threadiness int) error
}
type StatefulSetInterface interface {
@@ -87,8 +79,8 @@ type StatefulSetInterface interface {
Update(*v1.StatefulSet) (*v1.StatefulSet, error)
Delete(name string, options *metav1.DeleteOptions) error
DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error
List(opts metav1.ListOptions) (*StatefulSetList, error)
ListNamespaced(namespace string, opts metav1.ListOptions) (*StatefulSetList, error)
List(opts metav1.ListOptions) (*v1.StatefulSetList, error)
ListNamespaced(namespace string, opts metav1.ListOptions) (*v1.StatefulSetList, error)
Watch(opts metav1.ListOptions) (watch.Interface, error)
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
Controller() StatefulSetController
@@ -127,7 +119,7 @@ func (l *statefulSetLister) Get(namespace, name string) (*v1.StatefulSet, error)
if !exists {
return nil, errors.NewNotFound(schema.GroupResource{
Group: StatefulSetGroupVersionKind.Group,
Resource: "statefulSet",
Resource: StatefulSetGroupVersionResource.Resource,
}, key)
}
return obj.(*v1.StatefulSet), nil
@@ -207,29 +199,16 @@ func (c statefulSetFactory) Object() runtime.Object {
}
func (c statefulSetFactory) List() runtime.Object {
return &StatefulSetList{}
return &v1.StatefulSetList{}
}
func (s *statefulSetClient) Controller() StatefulSetController {
s.client.Lock()
defer s.client.Unlock()
c, ok := s.client.statefulSetControllers[s.ns]
if ok {
return c
}
genericController := controller.NewGenericController(StatefulSetGroupVersionKind.Kind+"Controller",
s.objectClient)
s.client.controllerFactory.ForResourceKind(StatefulSetGroupVersionResource, StatefulSetGroupVersionKind.Kind, true))
c = &statefulSetController{
return &statefulSetController{
GenericController: genericController,
}
s.client.statefulSetControllers[s.ns] = c
s.client.starters = append(s.client.starters, c)
return c
}
type statefulSetClient struct {
@@ -263,6 +242,11 @@ func (s *statefulSetClient) Update(o *v1.StatefulSet) (*v1.StatefulSet, error) {
return obj.(*v1.StatefulSet), err
}
func (s *statefulSetClient) UpdateStatus(o *v1.StatefulSet) (*v1.StatefulSet, error) {
obj, err := s.objectClient.UpdateStatus(o.Name, o)
return obj.(*v1.StatefulSet), err
}
func (s *statefulSetClient) Delete(name string, options *metav1.DeleteOptions) error {
return s.objectClient.Delete(name, options)
}
@@ -271,14 +255,14 @@ func (s *statefulSetClient) DeleteNamespaced(namespace, name string, options *me
return s.objectClient.DeleteNamespaced(namespace, name, options)
}
func (s *statefulSetClient) List(opts metav1.ListOptions) (*StatefulSetList, error) {
func (s *statefulSetClient) List(opts metav1.ListOptions) (*v1.StatefulSetList, error) {
obj, err := s.objectClient.List(opts)
return obj.(*StatefulSetList), err
return obj.(*v1.StatefulSetList), err
}
func (s *statefulSetClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*StatefulSetList, error) {
func (s *statefulSetClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*v1.StatefulSetList, error) {
obj, err := s.objectClient.ListNamespaced(namespace, opts)
return obj.(*StatefulSetList), err
return obj.(*v1.StatefulSetList), err
}
func (s *statefulSetClient) Watch(opts metav1.ListOptions) (watch.Interface, error) {