Some cleanup and safety checks

* Add logging middleware
  * Remove some noise from logs
  * Add some safety checks when managing runners
This commit is contained in:
Gabriel Adrian Samfira 2022-12-29 16:49:50 +00:00
parent 5bc2bec991
commit 3a92a5be0e
15 changed files with 384 additions and 198 deletions

View file

@ -16,6 +16,7 @@ package sql
import (
"garm/config"
"garm/params"
"garm/runner/providers/common"
"time"
@ -118,7 +119,9 @@ type Address struct {
type InstanceStatusUpdate struct {
Base
Message string `gorm:"type:text"`
EventType params.EventType `gorm:"index:eventType"`
EventLevel params.EventLevel
Message string `gorm:"type:text"`
InstanceID uuid.UUID
Instance Instance `gorm:"foreignKey:InstanceID"`