Implement some common logic for pool creation

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
Gabriel Adrian Samfira 2024-03-28 10:08:19 +00:00
parent 72501aee0f
commit 0152b21529
15 changed files with 201 additions and 254 deletions

View file

@ -1725,10 +1725,6 @@ func (r *basePoolManager) WebhookSecret() string {
return r.entity.WebhookSecret
}
func (r *basePoolManager) GithubRunnerRegistrationToken() (string, error) {
return r.GetGithubRegistrationToken()
}
func (r *basePoolManager) ID() string {
return r.entity.ID
}
@ -2095,7 +2091,7 @@ func (r *basePoolManager) GetRunnerInfoFromWorkflow(job params.WorkflowJob) (par
return params.RunnerInfo{}, fmt.Errorf("failed to find runner name from workflow")
}
func (r *basePoolManager) GetGithubRegistrationToken() (string, error) {
func (r *basePoolManager) GithubRunnerRegistrationToken() (string, error) {
tk, ghResp, err := r.ghcli.CreateEntityRegistrationToken(r.ctx)
if err != nil {
if ghResp != nil && ghResp.StatusCode == http.StatusUnauthorized {