Skip to content

Commit 3b3095c

Browse files
Scale sets are unique within a runner group
You can have multiple scale sets with the same name, as long as they live in different runner groups. Signed-off-by: Gabriel Adrian Samfira <[email protected]>
1 parent 77895d9 commit 3b3095c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

database/sql/models.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,10 @@ type ScaleSet struct {
9898
// the scale set was ceated in GARM but has not yet been created in GitHub.
9999
// The scale set ID is also not globally unique. It is only unique within the context
100100
// of an entity.
101-
ScaleSetID int `gorm:"index:idx_scale_set"`
102-
Name string `gorm:"index:idx_name"`
103-
DisableUpdate bool
101+
ScaleSetID int `gorm:"index:idx_scale_set"`
102+
Name string `gorm:"unique_index:idx_name"`
103+
GitHubRunnerGroup string `gorm:"unique_index:idx_name"`
104+
DisableUpdate bool
104105

105106
// State stores the provisioning state of the scale set in GitHub
106107
State params.ScaleSetState
@@ -123,8 +124,7 @@ type ScaleSet struct {
123124
// ExtraSpecs is an opaque json that gets sent to the provider
124125
// as part of the bootstrap params for instances. It can contain
125126
// any kind of data needed by providers.
126-
ExtraSpecs datatypes.JSON
127-
GitHubRunnerGroup string
127+
ExtraSpecs datatypes.JSON
128128

129129
RepoID *uuid.UUID `gorm:"index"`
130130
Repository Repository `gorm:"foreignKey:RepoID;"`

0 commit comments

Comments
 (0)