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

Commitdaccf42

Browse files
committed
fixup comment
1 parenta13d333 commitdaccf42

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

‎cli/server.go

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -944,12 +944,18 @@ func (r *RootCmd) Server(newAPI func(context.Context, *coderd.Options) (*coderd.
944944
varprovisionerdWaitGroup sync.WaitGroup
945945
deferprovisionerdWaitGroup.Wait()
946946
provisionerdMetrics:=provisionerd.NewMetrics(options.PrometheusRegistry)
947-
// Create a list of daemon types. The length is the total number of built in provisioners, and
948-
// the slice value is the type for each.
949-
daemons:=append(
950-
fill(make([]codersdk.ProvisionerType,vals.Provisioner.DaemonsTerraform.Value()),codersdk.ProvisionerTypeTerraform),
951-
fill(make([]codersdk.ProvisionerType,vals.Provisioner.DaemonsEcho.Value()),codersdk.ProvisionerTypeEcho)...,
952-
)
947+
948+
// Create a list of daemon types. The length is the total number of built-in provisioners, and
949+
// the slice value is the type for each. This is just an easy way to pass the types
950+
// to a single loop. Ensuring each provisioner has a unique suffix with their index.
951+
daemons:=make([]codersdk.ProvisionerType,0)
952+
fori:=int64(0);i<vals.Provisioner.DaemonsTerraform.Value();i++ {
953+
daemons=append(daemons,codersdk.ProvisionerTypeTerraform)
954+
}
955+
fori:=int64(0);i<vals.Provisioner.DaemonsTerraform.Value();i++ {
956+
daemons=append(daemons,codersdk.ProvisionerTypeEcho)
957+
}
958+
953959
fori,provisionerType:=rangedaemons {
954960
suffix:=fmt.Sprintf("%d",i)
955961
// The suffix is added to the hostname, so we may need to trim to fit into
@@ -2584,11 +2590,3 @@ func getPostgresDB(ctx context.Context, logger slog.Logger, postgresURL string,
25842590

25852591
returnsqlDB,dbURL,nil
25862592
}
2587-
2588-
// fill will fill the src with the value 'v'
2589-
funcfill[Tany](src []T,vT) []T {
2590-
fori:=rangesrc {
2591-
src[i]=v
2592-
}
2593-
returnsrc
2594-
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp