fix: switch to context.Background() for adminctx

Signed-off-by: Mario Constanti <mario.constanti@mercedes-benz.com>
This commit is contained in:
Mario Constanti 2024-02-20 16:42:10 +01:00
parent 2a3e4d6563
commit b1cbfac08a
5 changed files with 6 additions and 6 deletions

View file

@ -37,7 +37,7 @@ import (
)
func NewAPIController(r *runner.Runner, authenticator *auth.Authenticator, hub *wsWriter.Hub) (*APIController, error) {
controllerInfo, err := r.GetControllerInfo(auth.GetAdminContext(context.TODO()))
controllerInfo, err := r.GetControllerInfo(auth.GetAdminContext(context.Background()))
if err != nil {
return nil, errors.Wrap(err, "failed to get controller info")
}

View file

@ -60,7 +60,7 @@ type EnterpriseTestSuite struct {
}
func (s *EnterpriseTestSuite) SetupTest() {
adminCtx := auth.GetAdminContext(context.TODO())
adminCtx := auth.GetAdminContext(context.Background())
// create testing sqlite database
dbCfg := garmTesting.GetTestSqliteDBConfig(s.T())

View file

@ -60,7 +60,7 @@ type OrgTestSuite struct {
}
func (s *OrgTestSuite) SetupTest() {
adminCtx := auth.GetAdminContext(context.TODO())
adminCtx := auth.GetAdminContext(context.Background())
// create testing sqlite database
dbCfg := garmTesting.GetTestSqliteDBConfig(s.T())

View file

@ -47,7 +47,7 @@ type PoolTestSuite struct {
}
func (s *PoolTestSuite) SetupTest() {
adminCtx := auth.GetAdminContext(context.TODO())
adminCtx := auth.GetAdminContext(context.Background())
// create testing sqlite database
dbCfg := garmTesting.GetTestSqliteDBConfig(s.T())

View file

@ -59,7 +59,7 @@ type RepoTestSuite struct {
}
func (s *RepoTestSuite) SetupTest() {
adminCtx := auth.GetAdminContext(context.TODO())
adminCtx := auth.GetAdminContext(context.Background())
// create testing sqlite database
dbCfg := garmTesting.GetTestSqliteDBConfig(s.T())
@ -90,7 +90,7 @@ func (s *RepoTestSuite) SetupTest() {
var minIdleRunners uint = 20
providerMock := runnerCommonMocks.NewProvider(s.T())
fixtures := &RepoTestFixtures{
AdminContext: auth.GetAdminContext(context.TODO()),
AdminContext: auth.GetAdminContext(context.Background()),
Store: db,
StoreRepos: repos,
Providers: map[string]common.Provider{