Skip to content

Commit

Permalink
Add getProviderBaseParams function in basePoolManager
Browse files Browse the repository at this point in the history
  • Loading branch information
fabi200123 committed Sep 2, 2024
1 parent 7074f01 commit 5e30530
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions runner/pool/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,16 @@ type basePoolManager struct {
keyMux *keyMutex
}

func (r *basePoolManager) getProviderBaseParams(pool params.Pool) common.ProviderBaseParams {
r.mux.Lock()
defer r.mux.Unlock()

return common.ProviderBaseParams{
PoolInfo: pool,
ControllerInfo: r.controllerInfo,
}
}

func (r *basePoolManager) HandleWorkflowJob(job params.WorkflowJob) error {
if err := r.ValidateOwner(job); err != nil {
return errors.Wrap(err, "validating owner")
Expand Down Expand Up @@ -591,10 +601,7 @@ func (r *basePoolManager) cleanupOrphanedGithubRunners(runners []*github.Runner)
"pool_id", pool.ID)
listInstancesParams := common.ListInstancesParams{
ListInstancesV011: common.ListInstancesV011Params{
ProviderBaseParams: common.ProviderBaseParams{
PoolInfo: pool,
ControllerInfo: r.controllerInfo,
},
ProviderBaseParams: r.getProviderBaseParams(pool),
},
}
poolInstances, err = provider.ListInstances(r.ctx, pool.ID, listInstancesParams)
Expand Down

0 comments on commit 5e30530

Please sign in to comment.