mirror of
https://github.com/actions/actions-runner-controller.git
synced 2025-12-10 19:50:30 +00:00
* feat: Repository-wide RunnerDeployment Autoscaling This adds `maxReplicas` and `minReplicas` to the RunnerDeploymentSpec. If and only if both fields are set, the controller computes and sets desired `replicas` automatically depending on the demand. The number of demanded runner replicas is computed by `queued workflow runs + in_progress workflow runs` for the repository. The support for organizational runners is not included. Ref https://github.com/summerwind/actions-runner-controller/issues/10
29 lines
500 B
Go
29 lines
500 B
Go
package fake
|
|
|
|
type FixedResponses struct {
|
|
listRepositoryWorkflowRuns FixedResponse
|
|
}
|
|
|
|
type FixedResponse struct {
|
|
Status int
|
|
Body string
|
|
}
|
|
|
|
func (r FixedResponse) handler() handler {
|
|
return handler{
|
|
Status: r.Status,
|
|
Body: r.Body,
|
|
}
|
|
}
|
|
|
|
type Option func(responses *FixedResponses)
|
|
|
|
func WithListRepositoryWorkflowRunsResponse(status int, body string) Option {
|
|
return func(r *FixedResponses) {
|
|
r.listRepositoryWorkflowRuns = FixedResponse{
|
|
Status: status,
|
|
Body: body,
|
|
}
|
|
}
|
|
}
|