From 7be89e175ed325a932eb238fda75c7d15d8ede05 Mon Sep 17 00:00:00 2001 From: zychen5186 Date: Fri, 31 May 2024 20:51:01 -0700 Subject: [PATCH] regenerate mock Signed-off-by: zychen5186 --- flyteadmin/pkg/manager/mocks/project.go | 9 ++++ .../ext/mocks/admin_fetcher_ext_interface.go | 41 +++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/flyteadmin/pkg/manager/mocks/project.go b/flyteadmin/pkg/manager/mocks/project.go index e86cdde4d54..5bcfa9fc479 100644 --- a/flyteadmin/pkg/manager/mocks/project.go +++ b/flyteadmin/pkg/manager/mocks/project.go @@ -6,12 +6,14 @@ import ( "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" ) +type GetDomainsFunc func(ctx context.Context, request admin.GetDomainRequest) *admin.Domains type CreateProjectFunc func(ctx context.Context, request admin.ProjectRegisterRequest) (*admin.ProjectRegisterResponse, error) type ListProjectFunc func(ctx context.Context, request admin.ProjectListRequest) (*admin.Projects, error) type UpdateProjectFunc func(ctx context.Context, request admin.Project) (*admin.ProjectUpdateResponse, error) type GetProjectFunc func(ctx context.Context, request admin.ProjectGetRequest) (*admin.Project, error) type MockProjectManager struct { + getDomainsFunc GetDomainsFunc listProjectFunc ListProjectFunc createProjectFunc CreateProjectFunc updateProjectFunc UpdateProjectFunc @@ -22,6 +24,13 @@ func (m *MockProjectManager) SetCreateProject(createProjectFunc CreateProjectFun m.createProjectFunc = createProjectFunc } +func (manager *MockProjectManager) GetDomains(ctx context.Context, request admin.GetDomainRequest) *admin.Domains { + if manager.getDomainsFunc != nil { + return manager.getDomainsFunc(ctx, request) + } + return nil +} + func (m *MockProjectManager) CreateProject(ctx context.Context, request admin.ProjectRegisterRequest) (*admin.ProjectRegisterResponse, error) { if m.createProjectFunc != nil { return m.createProjectFunc(ctx, request) diff --git a/flytectl/pkg/ext/mocks/admin_fetcher_ext_interface.go b/flytectl/pkg/ext/mocks/admin_fetcher_ext_interface.go index 07771f53251..2e52e12d4e0 100644 --- a/flytectl/pkg/ext/mocks/admin_fetcher_ext_interface.go +++ b/flytectl/pkg/ext/mocks/admin_fetcher_ext_interface.go @@ -750,6 +750,47 @@ func (_m *AdminFetcherExtInterface) FetchWorkflowVersion(ctx context.Context, na return r0, r1 } +type AdminFetcherExtInterface_GetDomain struct { + *mock.Call +} + +func (_m AdminFetcherExtInterface_GetDomain) Return(_a0 *admin.Domains, _a1 error) *AdminFetcherExtInterface_GetDomain { + return &AdminFetcherExtInterface_GetDomain{Call: _m.Call.Return(_a0, _a1)} +} + +func (_m *AdminFetcherExtInterface) OnGetDomain(ctx context.Context) *AdminFetcherExtInterface_GetDomain { + c_call := _m.On("GetDomain", ctx) + return &AdminFetcherExtInterface_GetDomain{Call: c_call} +} + +func (_m *AdminFetcherExtInterface) OnGetDomainMatch(matchers ...interface{}) *AdminFetcherExtInterface_GetDomain { + c_call := _m.On("GetDomain", matchers...) + return &AdminFetcherExtInterface_GetDomain{Call: c_call} +} + +// GetDomain provides a mock function with given fields: ctx +func (_m *AdminFetcherExtInterface) GetDomain(ctx context.Context) (*admin.Domains, error) { + ret := _m.Called(ctx) + + var r0 *admin.Domains + if rf, ok := ret.Get(0).(func(context.Context) *admin.Domains); ok { + r0 = rf(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*admin.Domains) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + type AdminFetcherExtInterface_GetProjectByID struct { *mock.Call }