Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
PR comments
  • Loading branch information
kylecarbs committed Nov 16, 2022
commit ea94e1b82aa25f8418b84162dd81c8380c8b24a9
2 changes: 1 addition & 1 deletion coderd/coderd.go
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ func (api *API) CreateInMemoryProvisionerDaemon(ctx context.Context, debounce ti
CreatedAt: database.Now(),
Name: name,
Provisioners: []database.ProvisionerType{database.ProvisionerTypeEcho, database.ProvisionerTypeTerraform},
Tags: dbtype.Map{
Tags: dbtype.StringMap{
provisionerdserver.TagScope: provisionerdserver.ScopeOrganization,
},
})
Expand Down
6 changes: 3 additions & 3 deletions coderd/database/dbtype/dbtype.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"golang.org/x/xerrors"
)

type Map map[string]string
type StringMap map[string]string

func (m *Map) Scan(src interface{}) error {
func (m *StringMap) Scan(src interface{}) error {
if src == nil {
return nil
}
Expand All @@ -25,6 +25,6 @@ func (m *Map) Scan(src interface{}) error {
return nil
}

func (m Map) Value() (driver.Value, error) {
func (m StringMap) Value() (driver.Value, error) {
return json.Marshal(m)
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
ALTER TABLE provisioner_daemons DROP COLUMN auth_token;
ALTER TABLE provisioner_daemons DROP COLUMN tags;
ALTER TABLE provisioner_jobs DROP COLUMN tags;
4 changes: 2 additions & 2 deletions coderd/database/models.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions coderd/database/queries.sql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion coderd/database/queries/provisionerjobs.sql
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ WHERE
AND nested.completed_at IS NULL
AND nested.provisioner = ANY(@types :: provisioner_type [ ])
-- Ensure the caller satisfies all job tags.
AND @tags :: jsonb @> nested.tags
AND nested.tags <@ @tags :: jsonb
ORDER BY
nested.created_at FOR
UPDATE
Expand Down
4 changes: 2 additions & 2 deletions coderd/database/sqlc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ packages:

overrides:
- column: "provisioner_daemons.tags"
go_type: "github.com/coder/coder/coderd/database/dbtype.Map"
go_type: "github.com/coder/coder/coderd/database/dbtype.StringMap"
- column: "provisioner_jobs.tags"
go_type: "github.com/coder/coder/coderd/database/dbtype.Map"
go_type: "github.com/coder/coder/coderd/database/dbtype.StringMap"
- column: "users.rbac_roles"
go_type: "github.com/lib/pq.StringArray"
- column: "templates.user_acl"
Expand Down