Move URLs from default section of config to DB
This change moves the callback_url, metadata_url and webhooks_url from the config to the database. The goal is to move as much as possible from the config to the DB, in preparation for a potential refactor that will allow GARM to scale out. This would allow multiple nodes to share a single source of truth. Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
parent
7ee235aeb0
commit
9748aa47af
22 changed files with 1067 additions and 177 deletions
|
|
@ -129,6 +129,12 @@ type EntityPools interface {
|
|||
ListEntityInstances(ctx context.Context, entity params.GithubEntity) ([]params.Instance, error)
|
||||
}
|
||||
|
||||
type ControllerStore interface {
|
||||
ControllerInfo() (params.ControllerInfo, error)
|
||||
InitController() (params.ControllerInfo, error)
|
||||
UpdateController(info params.UpdateControllerParams) (params.ControllerInfo, error)
|
||||
}
|
||||
|
||||
//go:generate mockery --name=Store
|
||||
type Store interface {
|
||||
RepoStore
|
||||
|
|
@ -141,7 +147,5 @@ type Store interface {
|
|||
EntityPools
|
||||
GithubEndpointStore
|
||||
GithubCredentialsStore
|
||||
|
||||
ControllerInfo() (params.ControllerInfo, error)
|
||||
InitController() (params.ControllerInfo, error)
|
||||
ControllerStore
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1516,6 +1516,34 @@ func (_m *Store) UnlockJob(ctx context.Context, jobID int64, entityID string) er
|
|||
return r0
|
||||
}
|
||||
|
||||
// UpdateController provides a mock function with given fields: info
|
||||
func (_m *Store) UpdateController(info params.UpdateControllerParams) (params.ControllerInfo, error) {
|
||||
ret := _m.Called(info)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UpdateController")
|
||||
}
|
||||
|
||||
var r0 params.ControllerInfo
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(params.UpdateControllerParams) (params.ControllerInfo, error)); ok {
|
||||
return rf(info)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(params.UpdateControllerParams) params.ControllerInfo); ok {
|
||||
r0 = rf(info)
|
||||
} else {
|
||||
r0 = ret.Get(0).(params.ControllerInfo)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(params.UpdateControllerParams) error); ok {
|
||||
r1 = rf(info)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// UpdateEnterprise provides a mock function with given fields: ctx, enterpriseID, param
|
||||
func (_m *Store) UpdateEnterprise(ctx context.Context, enterpriseID string, param params.UpdateEntityParams) (params.Enterprise, error) {
|
||||
ret := _m.Called(ctx, enterpriseID, param)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue