diff --git a/apiserver/authwrapper/authorizer.go b/apiserver/authwrapper/authorizer.go index 2055f2b4..16f0a85a 100644 --- a/apiserver/authwrapper/authorizer.go +++ b/apiserver/authwrapper/authorizer.go @@ -12,7 +12,7 @@ import ( "k8s.io/apiserver/pkg/endpoints/filters" ) -//go:generate go run github.com/golang/mock/mockgen -destination=./mock/$GOFILE -package mock k8s.io/apiserver/pkg/authorization/authorizer Authorizer +//go:generate go run go.uber.org/mock/mockgen -destination=./mock/$GOFILE -package mock k8s.io/apiserver/pkg/authorization/authorizer Authorizer // Authorizer processes authorization requests for `{rbacID.Resource}` and checks them based on rbac rules for `{rbacID}` type Authorizer struct { diff --git a/apiserver/authwrapper/mock/authorizer.go b/apiserver/authwrapper/mock/authorizer.go index 96ebfbb0..926e39b5 100644 --- a/apiserver/authwrapper/mock/authorizer.go +++ b/apiserver/authwrapper/mock/authorizer.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: k8s.io/apiserver/pkg/authorization/authorizer (interfaces: Authorizer) - +// +// Generated by this command: +// +// mockgen -destination=./mock/authorizer.go -package mock k8s.io/apiserver/pkg/authorization/authorizer Authorizer +// // Package mock is a generated GoMock package. package mock @@ -8,7 +12,7 @@ import ( context "context" reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" authorizer "k8s.io/apiserver/pkg/authorization/authorizer" ) @@ -46,7 +50,7 @@ func (m *MockAuthorizer) Authorize(arg0 context.Context, arg1 authorizer.Attribu } // Authorize indicates an expected call of Authorize. -func (mr *MockAuthorizerMockRecorder) Authorize(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockAuthorizerMockRecorder) Authorize(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Authorize", reflect.TypeOf((*MockAuthorizer)(nil).Authorize), arg0, arg1) } diff --git a/apiserver/authwrapper/mock/storage.go b/apiserver/authwrapper/mock/storage.go index da1ebcaf..fe474acb 100644 --- a/apiserver/authwrapper/mock/storage.go +++ b/apiserver/authwrapper/mock/storage.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: k8s.io/apiserver/pkg/registry/rest (interfaces: StandardStorage,Storage,Responder) - +// +// Generated by this command: +// +// mockgen -destination=./mock/storage.go -package mock k8s.io/apiserver/pkg/registry/rest StandardStorage,Storage,Responder +// // Package mock is a generated GoMock package. package mock @@ -8,7 +12,7 @@ import ( context "context" reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" internalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -49,7 +53,7 @@ func (m *MockStandardStorage) ConvertToTable(arg0 context.Context, arg1, arg2 ru } // ConvertToTable indicates an expected call of ConvertToTable. -func (mr *MockStandardStorageMockRecorder) ConvertToTable(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockStandardStorageMockRecorder) ConvertToTable(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ConvertToTable", reflect.TypeOf((*MockStandardStorage)(nil).ConvertToTable), arg0, arg1, arg2) } @@ -64,7 +68,7 @@ func (m *MockStandardStorage) Create(arg0 context.Context, arg1 runtime.Object, } // Create indicates an expected call of Create. -func (mr *MockStandardStorageMockRecorder) Create(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockStandardStorageMockRecorder) Create(arg0, arg1, arg2, arg3 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockStandardStorage)(nil).Create), arg0, arg1, arg2, arg3) } @@ -80,7 +84,7 @@ func (m *MockStandardStorage) Delete(arg0 context.Context, arg1 string, arg2 res } // Delete indicates an expected call of Delete. -func (mr *MockStandardStorageMockRecorder) Delete(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockStandardStorageMockRecorder) Delete(arg0, arg1, arg2, arg3 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockStandardStorage)(nil).Delete), arg0, arg1, arg2, arg3) } @@ -95,7 +99,7 @@ func (m *MockStandardStorage) DeleteCollection(arg0 context.Context, arg1 rest.V } // DeleteCollection indicates an expected call of DeleteCollection. -func (mr *MockStandardStorageMockRecorder) DeleteCollection(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockStandardStorageMockRecorder) DeleteCollection(arg0, arg1, arg2, arg3 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteCollection", reflect.TypeOf((*MockStandardStorage)(nil).DeleteCollection), arg0, arg1, arg2, arg3) } @@ -122,7 +126,7 @@ func (m *MockStandardStorage) Get(arg0 context.Context, arg1 string, arg2 *v1.Ge } // Get indicates an expected call of Get. -func (mr *MockStandardStorageMockRecorder) Get(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockStandardStorageMockRecorder) Get(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockStandardStorage)(nil).Get), arg0, arg1, arg2) } @@ -137,7 +141,7 @@ func (m *MockStandardStorage) List(arg0 context.Context, arg1 *internalversion.L } // List indicates an expected call of List. -func (mr *MockStandardStorageMockRecorder) List(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockStandardStorageMockRecorder) List(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockStandardStorage)(nil).List), arg0, arg1) } @@ -181,7 +185,7 @@ func (m *MockStandardStorage) Update(arg0 context.Context, arg1 string, arg2 res } // Update indicates an expected call of Update. -func (mr *MockStandardStorageMockRecorder) Update(arg0, arg1, arg2, arg3, arg4, arg5, arg6 interface{}) *gomock.Call { +func (mr *MockStandardStorageMockRecorder) Update(arg0, arg1, arg2, arg3, arg4, arg5, arg6 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Update", reflect.TypeOf((*MockStandardStorage)(nil).Update), arg0, arg1, arg2, arg3, arg4, arg5, arg6) } @@ -196,7 +200,7 @@ func (m *MockStandardStorage) Watch(arg0 context.Context, arg1 *internalversion. } // Watch indicates an expected call of Watch. -func (mr *MockStandardStorageMockRecorder) Watch(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockStandardStorageMockRecorder) Watch(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Watch", reflect.TypeOf((*MockStandardStorage)(nil).Watch), arg0, arg1) } @@ -280,7 +284,7 @@ func (m *MockResponder) Error(arg0 error) { } // Error indicates an expected call of Error. -func (mr *MockResponderMockRecorder) Error(arg0 interface{}) *gomock.Call { +func (mr *MockResponderMockRecorder) Error(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Error", reflect.TypeOf((*MockResponder)(nil).Error), arg0) } @@ -292,7 +296,7 @@ func (m *MockResponder) Object(arg0 int, arg1 runtime.Object) { } // Object indicates an expected call of Object. -func (mr *MockResponderMockRecorder) Object(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockResponderMockRecorder) Object(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Object", reflect.TypeOf((*MockResponder)(nil).Object), arg0, arg1) } diff --git a/apiserver/authwrapper/storage.go b/apiserver/authwrapper/storage.go index d32ce132..86da756f 100644 --- a/apiserver/authwrapper/storage.go +++ b/apiserver/authwrapper/storage.go @@ -17,7 +17,7 @@ import ( "k8s.io/apiserver/pkg/registry/rest" ) -//go:generate go run github.com/golang/mock/mockgen -destination=./mock/$GOFILE -package mock k8s.io/apiserver/pkg/registry/rest StandardStorage,Storage,Responder +//go:generate go run go.uber.org/mock/mockgen -destination=./mock/$GOFILE -package mock k8s.io/apiserver/pkg/registry/rest StandardStorage,Storage,Responder var _ StandardStorage = &authorizedStorageWithLister{} diff --git a/apiserver/authwrapper/storage_test.go b/apiserver/authwrapper/storage_test.go index bb47687c..a707e31e 100644 --- a/apiserver/authwrapper/storage_test.go +++ b/apiserver/authwrapper/storage_test.go @@ -9,9 +9,9 @@ import ( "strings" "testing" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/watch" diff --git a/apiserver/billing/odoostorage/odoo/odoo8/client/clientmock/session.go b/apiserver/billing/odoostorage/odoo/odoo8/client/clientmock/session.go index 1fec335b..8ce7bce3 100644 --- a/apiserver/billing/odoostorage/odoo/odoo8/client/clientmock/session.go +++ b/apiserver/billing/odoostorage/odoo/odoo8/client/clientmock/session.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/appuio/control-api/apiserver/billing/odoostorage/odoo/odoo8/client (interfaces: QueryExecutor) - +// +// Generated by this command: +// +// mockgen -destination=./clientmock/session.go -package clientmock . QueryExecutor +// // Package clientmock is a generated GoMock package. package clientmock @@ -9,7 +13,7 @@ import ( reflect "reflect" client "github.com/appuio/control-api/apiserver/billing/odoostorage/odoo/odoo8/client" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockQueryExecutor is a mock of QueryExecutor interface. @@ -36,7 +40,7 @@ func (m *MockQueryExecutor) EXPECT() *MockQueryExecutorMockRecorder { } // CreateGenericModel mocks base method. -func (m *MockQueryExecutor) CreateGenericModel(arg0 context.Context, arg1 string, arg2 interface{}) (int, error) { +func (m *MockQueryExecutor) CreateGenericModel(arg0 context.Context, arg1 string, arg2 any) (int, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "CreateGenericModel", arg0, arg1, arg2) ret0, _ := ret[0].(int) @@ -45,7 +49,7 @@ func (m *MockQueryExecutor) CreateGenericModel(arg0 context.Context, arg1 string } // CreateGenericModel indicates an expected call of CreateGenericModel. -func (mr *MockQueryExecutorMockRecorder) CreateGenericModel(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockQueryExecutorMockRecorder) CreateGenericModel(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateGenericModel", reflect.TypeOf((*MockQueryExecutor)(nil).CreateGenericModel), arg0, arg1, arg2) } @@ -59,13 +63,13 @@ func (m *MockQueryExecutor) DeleteGenericModel(arg0 context.Context, arg1 string } // DeleteGenericModel indicates an expected call of DeleteGenericModel. -func (mr *MockQueryExecutorMockRecorder) DeleteGenericModel(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockQueryExecutorMockRecorder) DeleteGenericModel(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteGenericModel", reflect.TypeOf((*MockQueryExecutor)(nil).DeleteGenericModel), arg0, arg1, arg2) } // ExecuteQuery mocks base method. -func (m *MockQueryExecutor) ExecuteQuery(arg0 context.Context, arg1 string, arg2, arg3 interface{}) error { +func (m *MockQueryExecutor) ExecuteQuery(arg0 context.Context, arg1 string, arg2, arg3 any) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ExecuteQuery", arg0, arg1, arg2, arg3) ret0, _ := ret[0].(error) @@ -73,13 +77,13 @@ func (m *MockQueryExecutor) ExecuteQuery(arg0 context.Context, arg1 string, arg2 } // ExecuteQuery indicates an expected call of ExecuteQuery. -func (mr *MockQueryExecutorMockRecorder) ExecuteQuery(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockQueryExecutorMockRecorder) ExecuteQuery(arg0, arg1, arg2, arg3 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExecuteQuery", reflect.TypeOf((*MockQueryExecutor)(nil).ExecuteQuery), arg0, arg1, arg2, arg3) } // SearchGenericModel mocks base method. -func (m *MockQueryExecutor) SearchGenericModel(arg0 context.Context, arg1 client.SearchReadModel, arg2 interface{}) error { +func (m *MockQueryExecutor) SearchGenericModel(arg0 context.Context, arg1 client.SearchReadModel, arg2 any) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "SearchGenericModel", arg0, arg1, arg2) ret0, _ := ret[0].(error) @@ -87,13 +91,13 @@ func (m *MockQueryExecutor) SearchGenericModel(arg0 context.Context, arg1 client } // SearchGenericModel indicates an expected call of SearchGenericModel. -func (mr *MockQueryExecutorMockRecorder) SearchGenericModel(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockQueryExecutorMockRecorder) SearchGenericModel(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SearchGenericModel", reflect.TypeOf((*MockQueryExecutor)(nil).SearchGenericModel), arg0, arg1, arg2) } // UpdateGenericModel mocks base method. -func (m *MockQueryExecutor) UpdateGenericModel(arg0 context.Context, arg1 string, arg2 []int, arg3 interface{}) error { +func (m *MockQueryExecutor) UpdateGenericModel(arg0 context.Context, arg1 string, arg2 []int, arg3 any) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "UpdateGenericModel", arg0, arg1, arg2, arg3) ret0, _ := ret[0].(error) @@ -101,7 +105,7 @@ func (m *MockQueryExecutor) UpdateGenericModel(arg0 context.Context, arg1 string } // UpdateGenericModel indicates an expected call of UpdateGenericModel. -func (mr *MockQueryExecutorMockRecorder) UpdateGenericModel(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockQueryExecutorMockRecorder) UpdateGenericModel(arg0, arg1, arg2, arg3 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateGenericModel", reflect.TypeOf((*MockQueryExecutor)(nil).UpdateGenericModel), arg0, arg1, arg2, arg3) } diff --git a/apiserver/billing/odoostorage/odoo/odoo8/client/session.go b/apiserver/billing/odoostorage/odoo/odoo8/client/session.go index 3bfef7ad..362048c7 100644 --- a/apiserver/billing/odoostorage/odoo/odoo8/client/session.go +++ b/apiserver/billing/odoostorage/odoo/odoo8/client/session.go @@ -13,7 +13,7 @@ var ( ErrInvalidCredentials = errors.New("invalid credentials") ) -//go:generate go run github.com/golang/mock/mockgen -destination=./clientmock/$GOFILE -package clientmock . QueryExecutor +//go:generate go run go.uber.org/mock/mockgen -destination=./clientmock/$GOFILE -package clientmock . QueryExecutor // QueryExecutor runs queries against Odoo API. type QueryExecutor interface { diff --git a/apiserver/billing/odoostorage/odoo/odoo8/odoo8_test.go b/apiserver/billing/odoostorage/odoo/odoo8/odoo8_test.go index 92e41f10..63bbe48a 100644 --- a/apiserver/billing/odoostorage/odoo/odoo8/odoo8_test.go +++ b/apiserver/billing/odoostorage/odoo/odoo8/odoo8_test.go @@ -5,9 +5,9 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" billingv1 "github.com/appuio/control-api/apis/billing/v1" diff --git a/apiserver/billing/rbac_test.go b/apiserver/billing/rbac_test.go index 378d055e..96398189 100644 --- a/apiserver/billing/rbac_test.go +++ b/apiserver/billing/rbac_test.go @@ -4,9 +4,9 @@ import ( "context" "testing" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" rbacv1 "k8s.io/api/rbac/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/apiserver/organization/create_test.go b/apiserver/organization/create_test.go index b6a90af7..c5d489cf 100644 --- a/apiserver/organization/create_test.go +++ b/apiserver/organization/create_test.go @@ -6,9 +6,9 @@ import ( "fmt" "testing" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" orgv1 "github.com/appuio/control-api/apis/organization/v1" controlv1 "github.com/appuio/control-api/apis/v1" diff --git a/apiserver/organization/delete_test.go b/apiserver/organization/delete_test.go index 60a8eb52..d08c9b85 100644 --- a/apiserver/organization/delete_test.go +++ b/apiserver/organization/delete_test.go @@ -5,9 +5,9 @@ import ( "errors" "testing" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" orgv1 "github.com/appuio/control-api/apis/organization/v1" diff --git a/apiserver/organization/get_test.go b/apiserver/organization/get_test.go index 7843e19c..79edae08 100644 --- a/apiserver/organization/get_test.go +++ b/apiserver/organization/get_test.go @@ -4,9 +4,9 @@ import ( "errors" "testing" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" orgv1 "github.com/appuio/control-api/apis/organization/v1" diff --git a/apiserver/organization/list_test.go b/apiserver/organization/list_test.go index 7eb96c83..77d1dacf 100644 --- a/apiserver/organization/list_test.go +++ b/apiserver/organization/list_test.go @@ -4,9 +4,9 @@ import ( "errors" "testing" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" orgv1 "github.com/appuio/control-api/apis/organization/v1" diff --git a/apiserver/organization/members.go b/apiserver/organization/members.go index 588e4733..7330de7c 100644 --- a/apiserver/organization/members.go +++ b/apiserver/organization/members.go @@ -11,7 +11,7 @@ import ( // memberProvider is an abstraction for interacting with the OrganizationMembers Object // -//go:generate go run github.com/golang/mock/mockgen -source=$GOFILE -destination=./mock/$GOFILE +//go:generate go run go.uber.org/mock/mockgen -source=$GOFILE -destination=./mock/$GOFILE type memberProvider interface { CreateMembers(ctx context.Context, members *controlv1.OrganizationMembers) error } diff --git a/apiserver/organization/mock/members.go b/apiserver/organization/mock/members.go index aac276c7..ad5e639e 100644 --- a/apiserver/organization/mock/members.go +++ b/apiserver/organization/mock/members.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: members.go - +// +// Generated by this command: +// +// mockgen -source=members.go -destination=./mock/members.go +// // Package mock_organization is a generated GoMock package. package mock_organization @@ -9,7 +13,7 @@ import ( reflect "reflect" v1 "github.com/appuio/control-api/apis/v1" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockmemberProvider is a mock of memberProvider interface. @@ -44,7 +48,7 @@ func (m *MockmemberProvider) CreateMembers(ctx context.Context, members *v1.Orga } // CreateMembers indicates an expected call of CreateMembers. -func (mr *MockmemberProviderMockRecorder) CreateMembers(ctx, members interface{}) *gomock.Call { +func (mr *MockmemberProviderMockRecorder) CreateMembers(ctx, members any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateMembers", reflect.TypeOf((*MockmemberProvider)(nil).CreateMembers), ctx, members) } diff --git a/apiserver/organization/mock/namespace.go b/apiserver/organization/mock/namespace.go index 9e14c9da..3f3b1358 100644 --- a/apiserver/organization/mock/namespace.go +++ b/apiserver/organization/mock/namespace.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: namespace.go - +// +// Generated by this command: +// +// mockgen -source=namespace.go -destination=./mock/namespace.go +// // Package mock_organization is a generated GoMock package. package mock_organization @@ -8,7 +12,7 @@ import ( context "context" reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" v1 "k8s.io/api/core/v1" internalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion" v10 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -48,7 +52,7 @@ func (m *MocknamespaceProvider) CreateNamespace(ctx context.Context, ns *v1.Name } // CreateNamespace indicates an expected call of CreateNamespace. -func (mr *MocknamespaceProviderMockRecorder) CreateNamespace(ctx, ns, options interface{}) *gomock.Call { +func (mr *MocknamespaceProviderMockRecorder) CreateNamespace(ctx, ns, options any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateNamespace", reflect.TypeOf((*MocknamespaceProvider)(nil).CreateNamespace), ctx, ns, options) } @@ -63,7 +67,7 @@ func (m *MocknamespaceProvider) DeleteNamespace(ctx context.Context, name string } // DeleteNamespace indicates an expected call of DeleteNamespace. -func (mr *MocknamespaceProviderMockRecorder) DeleteNamespace(ctx, name, options interface{}) *gomock.Call { +func (mr *MocknamespaceProviderMockRecorder) DeleteNamespace(ctx, name, options any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteNamespace", reflect.TypeOf((*MocknamespaceProvider)(nil).DeleteNamespace), ctx, name, options) } @@ -78,7 +82,7 @@ func (m *MocknamespaceProvider) GetNamespace(ctx context.Context, name string, o } // GetNamespace indicates an expected call of GetNamespace. -func (mr *MocknamespaceProviderMockRecorder) GetNamespace(ctx, name, options interface{}) *gomock.Call { +func (mr *MocknamespaceProviderMockRecorder) GetNamespace(ctx, name, options any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetNamespace", reflect.TypeOf((*MocknamespaceProvider)(nil).GetNamespace), ctx, name, options) } @@ -93,7 +97,7 @@ func (m *MocknamespaceProvider) ListNamespaces(ctx context.Context, options *int } // ListNamespaces indicates an expected call of ListNamespaces. -func (mr *MocknamespaceProviderMockRecorder) ListNamespaces(ctx, options interface{}) *gomock.Call { +func (mr *MocknamespaceProviderMockRecorder) ListNamespaces(ctx, options any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListNamespaces", reflect.TypeOf((*MocknamespaceProvider)(nil).ListNamespaces), ctx, options) } @@ -107,7 +111,7 @@ func (m *MocknamespaceProvider) UpdateNamespace(ctx context.Context, ns *v1.Name } // UpdateNamespace indicates an expected call of UpdateNamespace. -func (mr *MocknamespaceProviderMockRecorder) UpdateNamespace(ctx, ns, options interface{}) *gomock.Call { +func (mr *MocknamespaceProviderMockRecorder) UpdateNamespace(ctx, ns, options any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateNamespace", reflect.TypeOf((*MocknamespaceProvider)(nil).UpdateNamespace), ctx, ns, options) } @@ -122,7 +126,7 @@ func (m *MocknamespaceProvider) WatchNamespaces(ctx context.Context, options *in } // WatchNamespaces indicates an expected call of WatchNamespaces. -func (mr *MocknamespaceProviderMockRecorder) WatchNamespaces(ctx, options interface{}) *gomock.Call { +func (mr *MocknamespaceProviderMockRecorder) WatchNamespaces(ctx, options any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WatchNamespaces", reflect.TypeOf((*MocknamespaceProvider)(nil).WatchNamespaces), ctx, options) } diff --git a/apiserver/organization/mock/rolebindings.go b/apiserver/organization/mock/rolebindings.go index bef4eb54..472efef8 100644 --- a/apiserver/organization/mock/rolebindings.go +++ b/apiserver/organization/mock/rolebindings.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: rolebindings.go - +// +// Generated by this command: +// +// mockgen -source=rolebindings.go -destination=./mock/rolebindings.go +// // Package mock_organization is a generated GoMock package. package mock_organization @@ -8,7 +12,7 @@ import ( context "context" reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockroleBindingCreator is a mock of roleBindingCreator interface. @@ -43,7 +47,7 @@ func (m *MockroleBindingCreator) CreateRoleBindings(ctx context.Context, namespa } // CreateRoleBindings indicates an expected call of CreateRoleBindings. -func (mr *MockroleBindingCreatorMockRecorder) CreateRoleBindings(ctx, namespace, username interface{}) *gomock.Call { +func (mr *MockroleBindingCreatorMockRecorder) CreateRoleBindings(ctx, namespace, username any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateRoleBindings", reflect.TypeOf((*MockroleBindingCreator)(nil).CreateRoleBindings), ctx, namespace, username) } diff --git a/apiserver/organization/namespace.go b/apiserver/organization/namespace.go index 3aa3b82c..8713caaa 100644 --- a/apiserver/organization/namespace.go +++ b/apiserver/organization/namespace.go @@ -13,7 +13,7 @@ import ( // namespaceProvider is an abstraction for interacting with the Kubernetes API // -//go:generate go run github.com/golang/mock/mockgen -source=$GOFILE -destination=./mock/$GOFILE +//go:generate go run go.uber.org/mock/mockgen -source=$GOFILE -destination=./mock/$GOFILE type namespaceProvider interface { GetNamespace(ctx context.Context, name string, options *metav1.GetOptions) (*corev1.Namespace, error) DeleteNamespace(ctx context.Context, name string, options *metav1.DeleteOptions) (*corev1.Namespace, error) diff --git a/apiserver/organization/organization_test.go b/apiserver/organization/organization_test.go index 977acb75..c8d4ab3e 100644 --- a/apiserver/organization/organization_test.go +++ b/apiserver/organization/organization_test.go @@ -7,8 +7,8 @@ import ( "github.com/appuio/control-api/apiserver/authwrapper" authmock "github.com/appuio/control-api/apiserver/authwrapper/mock" mock "github.com/appuio/control-api/apiserver/organization/mock" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" diff --git a/apiserver/organization/rolebindings.go b/apiserver/organization/rolebindings.go index 2871ce24..edb37ca4 100644 --- a/apiserver/organization/rolebindings.go +++ b/apiserver/organization/rolebindings.go @@ -16,7 +16,7 @@ import ( // +kubebuilder:rbac:groups="organization.appuio.io",resources=organizations,verbs=get;list;watch;create;delete;patch;update;edit // +kubebuilder:rbac:groups="appuio.io",resources=teams,verbs=get;list;watch;create;delete;patch;update -//go:generate go run github.com/golang/mock/mockgen -source=$GOFILE -destination=./mock/$GOFILE +//go:generate go run go.uber.org/mock/mockgen -source=$GOFILE -destination=./mock/$GOFILE type roleBindingCreator interface { CreateRoleBindings(ctx context.Context, namespace, username string) error } diff --git a/apiserver/organization/update_test.go b/apiserver/organization/update_test.go index cf92de5e..3f7fa5a2 100644 --- a/apiserver/organization/update_test.go +++ b/apiserver/organization/update_test.go @@ -5,9 +5,9 @@ import ( "errors" "testing" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" orgv1 "github.com/appuio/control-api/apis/organization/v1" diff --git a/apiserver/user/rbac_test.go b/apiserver/user/rbac_test.go index 062170d2..e45db5d0 100644 --- a/apiserver/user/rbac_test.go +++ b/apiserver/user/rbac_test.go @@ -5,9 +5,9 @@ import ( "strings" "testing" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" rbacv1 "k8s.io/api/rbac/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/go.mod b/go.mod index da26ea7c..76855c46 100644 --- a/go.mod +++ b/go.mod @@ -5,12 +5,12 @@ go 1.20 require ( github.com/Masterminds/sprig/v3 v3.2.3 github.com/go-logr/zapr v1.2.3 - github.com/golang/mock v1.6.0 github.com/google/uuid v1.3.0 github.com/prometheus/client_golang v1.15.1 github.com/robfig/cron/v3 v3.0.1 github.com/spf13/cobra v1.7.0 github.com/stretchr/testify v1.8.2 + go.uber.org/mock v0.3.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.24.0 golang.org/x/exp v0.0.0-20230307190834-24139beb5833 @@ -113,7 +113,7 @@ require ( go.starlark.net v0.0.0-20230103143115-09991d3a103e // indirect go.uber.org/atomic v1.10.0 // indirect golang.org/x/crypto v0.5.0 // indirect - golang.org/x/mod v0.7.0 // indirect + golang.org/x/mod v0.11.0 // indirect golang.org/x/net v0.7.0 // indirect golang.org/x/oauth2 v0.5.0 // indirect golang.org/x/sync v0.1.0 // indirect diff --git a/go.sum b/go.sum index b13882b0..72cb41ad 100644 --- a/go.sum +++ b/go.sum @@ -178,8 +178,6 @@ github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= -github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= -github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -458,6 +456,8 @@ go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= +go.uber.org/mock v0.3.0 h1:3mUxI1No2/60yUYax92Pt8eNOEecx2D3lcXZh2NEZJo= +go.uber.org/mock v0.3.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= @@ -510,8 +510,8 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.7.0 h1:LapD9S96VoQRhi/GrNTqeBJFrUjs5UHCAtTlgwA5oZA= -golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU= +golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -685,7 +685,6 @@ golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.5.0 h1:+bSpV5HIeWkuvgaMfI3UmKRThoTA5ODJTUd8T17NO+4= diff --git a/tools.go b/tools.go index 19aaeed9..4fdb622e 100644 --- a/tools.go +++ b/tools.go @@ -11,7 +11,7 @@ import ( // To have Kustomize updated via Renovate. _ "sigs.k8s.io/kustomize/kustomize/v5" // To generate mocks - _ "github.com/golang/mock/mockgen" + _ "go.uber.org/mock/mockgen" // To have Kind updated via Renovate _ "sigs.k8s.io/kind" )