Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit893169c

Browse files
authored
fix: duplicate tags map in mutation to resolve race (#14047)
* fix: duplicate tags map in mutation to resolve raceSee:https://github.com/coder/coder/actions/runs/10149619748/job/28064952716?pr=14046* Fix deployment values race
1 parent3209c86 commit893169c

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

‎enterprise/cli/create_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ func TestEnterpriseCreate(t *testing.T) {
3434
secondTemplates []string
3535
}
3636

37-
dv:=coderdtest.DeploymentValues(t)
38-
dv.Experiments= []string{string(codersdk.ExperimentMultiOrganization)}
3937
// setupMultipleOrganizations creates an extra organization, assigns a member
4038
// both organizations, and optionally creates templates in each organization.
4139
setupMultipleOrganizations:=func(t*testing.T,argssetupArgs)setupData {
40+
dv:=coderdtest.DeploymentValues(t)
41+
dv.Experiments= []string{string(codersdk.ExperimentMultiOrganization)}
4242
ownerClient,first:=coderdenttest.New(t,&coderdenttest.Options{
4343
Options:&coderdtest.Options{
4444
DeploymentValues:dv,

‎provisionersdk/provisionertags.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ const (
1818
// NOTE: "owner" must NEVER be nil. Otherwise it will end up being
1919
// duplicated in the database, as idx_provisioner_daemons_name_owner_key
2020
// is a partial unique index that includes a JSON field.
21-
funcMutateTags(userID uuid.UUID,tagsmap[string]string)map[string]string {
22-
iftags==nil {
23-
tags=map[string]string{}
21+
funcMutateTags(userID uuid.UUID,providedmap[string]string)map[string]string {
22+
tags:=map[string]string{}
23+
fork,v:=rangeprovided {
24+
tags[k]=v
2425
}
2526
_,ok:=tags[TagScope]
2627
if!ok {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp