Add runner group to the scale set list output

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
Gabriel Adrian Samfira 2025-05-08 08:09:54 +00:00
parent 52007f4ffa
commit a38d72a01c
6 changed files with 9 additions and 10 deletions

View file

@ -436,7 +436,7 @@ func formatScaleSets(scaleSets []params.ScaleSet) {
return return
} }
t := table.NewWriter() t := table.NewWriter()
header := table.Row{"ID", "Scale Set Name", "Image", "Flavor", "Belongs to", "Level", "Enabled", "Runner Prefix", "Provider"} header := table.Row{"ID", "Scale Set Name", "Image", "Flavor", "Belongs to", "Level", "Runner Group", "Enabled", "Runner Prefix", "Provider"}
t.AppendHeader(header) t.AppendHeader(header)
for _, scaleSet := range scaleSets { for _, scaleSet := range scaleSets {
@ -454,7 +454,7 @@ func formatScaleSets(scaleSets []params.ScaleSet) {
belongsTo = scaleSet.EnterpriseName belongsTo = scaleSet.EnterpriseName
level = entityTypeEnterprise level = entityTypeEnterprise
} }
t.AppendRow(table.Row{scaleSet.ID, scaleSet.Name, scaleSet.Image, scaleSet.Flavor, belongsTo, level, scaleSet.Enabled, scaleSet.GetRunnerPrefix(), scaleSet.ProviderName}) t.AppendRow(table.Row{scaleSet.ID, scaleSet.Name, scaleSet.Image, scaleSet.Flavor, belongsTo, level, scaleSet.GitHubRunnerGroup, scaleSet.Enabled, scaleSet.GetRunnerPrefix(), scaleSet.ProviderName})
t.AppendSeparator() t.AppendSeparator()
} }
fmt.Println(t.Render()) fmt.Println(t.Render())

2
go.mod
View file

@ -36,7 +36,7 @@ require (
gorm.io/datatypes v1.2.5 gorm.io/datatypes v1.2.5
gorm.io/driver/mysql v1.5.7 gorm.io/driver/mysql v1.5.7
gorm.io/driver/sqlite v1.5.7 gorm.io/driver/sqlite v1.5.7
gorm.io/gorm v1.26.0 gorm.io/gorm v1.26.1
) )
require ( require (

4
go.sum
View file

@ -229,5 +229,5 @@ gorm.io/driver/sqlite v1.5.7/go.mod h1:U+J8craQU6Fzkcvu8oLeAQmi50TkwPEhHDEjQZXDa
gorm.io/driver/sqlserver v1.5.4 h1:xA+Y1KDNspv79q43bPyjDMUgHoYHLhXYmdFcYPobg8g= gorm.io/driver/sqlserver v1.5.4 h1:xA+Y1KDNspv79q43bPyjDMUgHoYHLhXYmdFcYPobg8g=
gorm.io/driver/sqlserver v1.5.4/go.mod h1:+frZ/qYmuna11zHPlh5oc2O6ZA/lS88Keb0XSH1Zh/g= gorm.io/driver/sqlserver v1.5.4/go.mod h1:+frZ/qYmuna11zHPlh5oc2O6ZA/lS88Keb0XSH1Zh/g=
gorm.io/gorm v1.25.7/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8= gorm.io/gorm v1.25.7/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8=
gorm.io/gorm v1.26.0 h1:9lqQVPG5aNNS6AyHdRiwScAVnXHg/L/Srzx55G5fOgs= gorm.io/gorm v1.26.1 h1:ghB2gUI9FkS46luZtn6DLZ0f6ooBJ5IbVej2ENFDjRw=
gorm.io/gorm v1.26.0/go.mod h1:8Z33v652h4//uMA76KjeDH8mJXPm1QNCYrMeatR0DOE= gorm.io/gorm v1.26.1/go.mod h1:8Z33v652h4//uMA76KjeDH8mJXPm1QNCYrMeatR0DOE=

4
vendor/gorm.io/gorm/gorm.go generated vendored
View file

@ -110,8 +110,6 @@ type DB struct {
type Session struct { type Session struct {
DryRun bool DryRun bool
PrepareStmt bool PrepareStmt bool
PrepareStmtMaxSize int
PrepareStmtTTL time.Duration
NewDB bool NewDB bool
Initialized bool Initialized bool
SkipHooks bool SkipHooks bool
@ -275,7 +273,7 @@ func (db *DB) Session(config *Session) *DB {
if v, ok := db.cacheStore.Load(preparedStmtDBKey); ok { if v, ok := db.cacheStore.Load(preparedStmtDBKey); ok {
preparedStmt = v.(*PreparedStmtDB) preparedStmt = v.(*PreparedStmtDB)
} else { } else {
preparedStmt = NewPreparedStmtDB(db.ConnPool, config.PrepareStmtMaxSize, config.PrepareStmtTTL) preparedStmt = NewPreparedStmtDB(db.ConnPool, db.PrepareStmtMaxSize, db.PrepareStmtTTL)
db.cacheStore.Store(preparedStmtDBKey, preparedStmt) db.cacheStore.Store(preparedStmtDBKey, preparedStmt)
} }

View file

@ -3,6 +3,7 @@ package stmt_store
import ( import (
"context" "context"
"database/sql" "database/sql"
"math"
"sync" "sync"
"time" "time"
@ -73,7 +74,7 @@ type Store interface {
// the cache can theoretically store as many elements as possible. // the cache can theoretically store as many elements as possible.
// (1 << 63) - 1 is the maximum value that an int64 type can represent. // (1 << 63) - 1 is the maximum value that an int64 type can represent.
const ( const (
defaultMaxSize = (1 << 63) - 1 defaultMaxSize = math.MaxInt
// defaultTTL defines the default time-to-live (TTL) for each cache entry. // defaultTTL defines the default time-to-live (TTL) for each cache entry.
// When the TTL for cache entries is not specified, each cache entry will expire after 24 hours. // When the TTL for cache entries is not specified, each cache entry will expire after 24 hours.
defaultTTL = time.Hour * 24 defaultTTL = time.Hour * 24

2
vendor/modules.txt vendored
View file

@ -362,7 +362,7 @@ gorm.io/driver/mysql
# gorm.io/driver/sqlite v1.5.7 # gorm.io/driver/sqlite v1.5.7
## explicit; go 1.20 ## explicit; go 1.20
gorm.io/driver/sqlite gorm.io/driver/sqlite
# gorm.io/gorm v1.26.0 # gorm.io/gorm v1.26.1
## explicit; go 1.18 ## explicit; go 1.18
gorm.io/gorm gorm.io/gorm
gorm.io/gorm/callbacks gorm.io/gorm/callbacks