Make runner-bootstrap-timeout optional
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
parent
874506e539
commit
280cad96e4
4 changed files with 9 additions and 9 deletions
|
|
@ -254,7 +254,7 @@ explicitly remove them using the runner delete command.
|
|||
}
|
||||
|
||||
if cmd.Flags().Changed("runner-bootstrap-timeout") {
|
||||
poolUpdateParams.RunnerBootstrapTimeout = poolRunnerBootstrapTimeout
|
||||
poolUpdateParams.RunnerBootstrapTimeout = &poolRunnerBootstrapTimeout
|
||||
}
|
||||
|
||||
pool, err := cli.UpdatePoolByID(args[0], poolUpdateParams)
|
||||
|
|
|
|||
|
|
@ -210,8 +210,8 @@ func (s *sqlDatabase) updatePool(pool Pool, param params.UpdatePoolParams) (para
|
|||
pool.OSType = param.OSType
|
||||
}
|
||||
|
||||
if param.RunnerBootstrapTimeout > 0 {
|
||||
pool.RunnerBootstrapTimeout = param.RunnerBootstrapTimeout
|
||||
if param.RunnerBootstrapTimeout != nil && *param.RunnerBootstrapTimeout > 0 {
|
||||
pool.RunnerBootstrapTimeout = *param.RunnerBootstrapTimeout
|
||||
}
|
||||
|
||||
if q := s.conn.Save(&pool); q.Error != nil {
|
||||
|
|
|
|||
|
|
@ -78,11 +78,11 @@ type NewUserParams struct {
|
|||
}
|
||||
|
||||
type UpdatePoolParams struct {
|
||||
Tags []string `json:"tags"`
|
||||
Enabled *bool `json:"enabled"`
|
||||
MaxRunners *uint `json:"max_runners"`
|
||||
MinIdleRunners *uint `json:"min_idle_runners"`
|
||||
RunnerBootstrapTimeout uint `json:"runner_bootstrap_timeout"`
|
||||
Tags []string `json:"tags,omitempty"`
|
||||
Enabled *bool `json:"enabled,omitempty"`
|
||||
MaxRunners *uint `json:"max_runners,omitempty"`
|
||||
MinIdleRunners *uint `json:"min_idle_runners,omitempty"`
|
||||
RunnerBootstrapTimeout *uint `json:"runner_bootstrap_timeout,omitempty"`
|
||||
Image string `json:"image"`
|
||||
Flavor string `json:"flavor"`
|
||||
OSType config.OSType `json:"os_type"`
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ func (r *Runner) UpdatePoolByID(ctx context.Context, poolID string, param params
|
|||
minIdleRunners = *param.MinIdleRunners
|
||||
}
|
||||
|
||||
if param.RunnerBootstrapTimeout == 0 {
|
||||
if param.RunnerBootstrapTimeout != nil && *param.RunnerBootstrapTimeout == 0 {
|
||||
return params.Pool{}, runnerErrors.NewBadRequestError("runner_bootstrap_timeout cannot be 0")
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue