Update garm-provider-common
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
parent
fc4bd863aa
commit
8d10dd4716
10 changed files with 32 additions and 14 deletions
|
|
@ -119,6 +119,7 @@ type ScaleSet struct {
|
|||
OSArch commonParams.OSArch
|
||||
Enabled bool
|
||||
LastMessageID int64
|
||||
DesiredRunnerCount int64
|
||||
// ExtraSpecs is an opaque json that gets sent to the provider
|
||||
// as part of the bootstrap params for instances. It can contain
|
||||
// any kind of data needed by providers.
|
||||
|
|
|
|||
|
|
@ -391,3 +391,15 @@ func (s *sqlDatabase) SetScaleSetLastMessageID(ctx context.Context, scaleSetID u
|
|||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *sqlDatabase) SetScaleSetDesiredRunnerCount(ctx context.Context, scaleSetID uint, desiredRunnerCount int64) error {
|
||||
if err := s.conn.Transaction(func(tx *gorm.DB) error {
|
||||
if q := tx.Model(&ScaleSet{}).Where("id = ?", scaleSetID).Update("desired_runner_count", desiredRunnerCount); q.Error != nil {
|
||||
return errors.Wrap(q.Error, "saving database entry")
|
||||
}
|
||||
return nil
|
||||
}); err != nil {
|
||||
return errors.Wrap(err, "setting desired runner count")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -310,6 +310,7 @@ func (s *sqlDatabase) sqlToCommonScaleSet(scaleSet ScaleSet) (params.ScaleSet, e
|
|||
State: scaleSet.State,
|
||||
ExtendedState: scaleSet.ExtendedState,
|
||||
LastMessageID: scaleSet.LastMessageID,
|
||||
DesiredRunnerCount: scaleSet.DesiredRunnerCount,
|
||||
}
|
||||
|
||||
if scaleSet.RepoID != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue