Limit instances to one runner token
This commit is contained in:
parent
3a92a5be0e
commit
a91f64331e
12 changed files with 116 additions and 93 deletions
|
|
@ -218,6 +218,10 @@ func (s *sqlDatabase) UpdateInstance(ctx context.Context, instanceID string, par
|
|||
instance.CreateAttempt = param.CreateAttempt
|
||||
}
|
||||
|
||||
if param.TokenFetched != nil {
|
||||
instance.TokenFetched = *param.TokenFetched
|
||||
}
|
||||
|
||||
instance.ProviderFault = param.ProviderFault
|
||||
|
||||
q := s.conn.Save(&instance)
|
||||
|
|
|
|||
|
|
@ -144,6 +144,7 @@ type Instance struct {
|
|||
MetadataURL string
|
||||
ProviderFault []byte `gorm:"type:longblob"`
|
||||
CreateAttempt int
|
||||
TokenFetched bool
|
||||
|
||||
PoolID uuid.UUID
|
||||
Pool Pool `gorm:"foreignKey:PoolID"`
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ func (s *sqlDatabase) sqlToParamsInstance(instance Instance) params.Instance {
|
|||
StatusMessages: []params.StatusMessage{},
|
||||
CreateAttempt: instance.CreateAttempt,
|
||||
UpdatedAt: instance.UpdatedAt,
|
||||
TokenFetched: instance.TokenFetched,
|
||||
}
|
||||
|
||||
if len(instance.ProviderFault) > 0 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue