Skip to content

Commit

Permalink
fix: pass context.TODO by getting admin context
Browse files Browse the repository at this point in the history
fix linter warnings

Signed-off-by: Mario Constanti <mario.constanti@mercedes-benz.com>
  • Loading branch information
bavarianbidi committed Feb 20, 2024
1 parent 0a53b8f commit 2a3e4d6
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion apiserver/controllers/controllers.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import (
)

func NewAPIController(r *runner.Runner, authenticator *auth.Authenticator, hub *wsWriter.Hub) (*APIController, error) {
controllerInfo, err := r.GetControllerInfo(auth.GetAdminContext(nil))
controllerInfo, err := r.GetControllerInfo(auth.GetAdminContext(context.TODO()))
if err != nil {
return nil, errors.Wrap(err, "failed to get controller info")
}
Expand Down
2 changes: 1 addition & 1 deletion runner/enterprises_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ type EnterpriseTestSuite struct {
}

func (s *EnterpriseTestSuite) SetupTest() {
adminCtx := auth.GetAdminContext(nil)
adminCtx := auth.GetAdminContext(context.TODO())

// create testing sqlite database
dbCfg := garmTesting.GetTestSqliteDBConfig(s.T())
Expand Down
2 changes: 1 addition & 1 deletion runner/organizations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ type OrgTestSuite struct {
}

func (s *OrgTestSuite) SetupTest() {
adminCtx := auth.GetAdminContext(nil)
adminCtx := auth.GetAdminContext(context.TODO())

// create testing sqlite database
dbCfg := garmTesting.GetTestSqliteDBConfig(s.T())
Expand Down
2 changes: 1 addition & 1 deletion runner/pools_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ type PoolTestSuite struct {
}

func (s *PoolTestSuite) SetupTest() {
adminCtx := auth.GetAdminContext(nil)
adminCtx := auth.GetAdminContext(context.TODO())

// create testing sqlite database
dbCfg := garmTesting.GetTestSqliteDBConfig(s.T())
Expand Down
4 changes: 2 additions & 2 deletions runner/repositories_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ type RepoTestSuite struct {
}

func (s *RepoTestSuite) SetupTest() {
adminCtx := auth.GetAdminContext(nil)
adminCtx := auth.GetAdminContext(context.TODO())

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

0 comments on commit 2a3e4d6

Please sign in to comment.