feat: allow to configure the runner name

This commit is contained in:
Michael Kuhnt 2022-12-19 20:56:16 +01:00
parent b2a22e1e79
commit 6af3025743
No known key found for this signature in database
GPG key ID: 088DC1E2EDC5A631
19 changed files with 571 additions and 5 deletions

View file

@ -21,6 +21,8 @@ import (
"garm/runner/providers/common"
)
const DefaultRunnerPrefix = "garm"
type InstanceRequest struct {
Name string `json:"name"`
OSType config.OSType `json:"os_type"`
@ -102,10 +104,18 @@ type UpdatePoolParams struct {
RunnerBootstrapTimeout *uint `json:"runner_bootstrap_timeout,omitempty"`
Image string `json:"image"`
Flavor string `json:"flavor"`
RunnerPrefix string `json:"runner_prefix"`
OSType config.OSType `json:"os_type"`
OSArch config.OSArch `json:"os_arch"`
}
func (p *UpdatePoolParams) GetRunnerPrefix() string {
if p.RunnerPrefix == "" {
p.RunnerPrefix = DefaultRunnerPrefix
}
return p.RunnerPrefix
}
type CreateInstanceParams struct {
Name string
OSType config.OSType
@ -119,6 +129,7 @@ type CreateInstanceParams struct {
type CreatePoolParams struct {
ProviderName string `json:"provider_name"`
RunnerPrefix string `json:"runner_prefix"`
MaxRunners uint `json:"max_runners"`
MinIdleRunners uint `json:"min_idle_runners"`
Image string `json:"image"`