Skip to content

Commit 3caa692

Browse files
committed
Merge branch 'main' into dean/proxy-derp-map
2 parents e4a3008 + 022372d commit 3caa692

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+2229
-600
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343

4444
# Check for any typos!
4545
- name: Check for typos
46-
uses: crate-ci/typos@v1.14.10
46+
uses: crate-ci/typos@v1.14.11
4747
with:
4848
config: .github/workflows/typos.toml
4949
- name: Fix the typos

coderd/apidoc/docs.go

Lines changed: 71 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/apidoc/swagger.json

Lines changed: 69 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/coderd.go

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ type Options struct {
128128
// AppSecurityKey is the crypto key used to sign and encrypt tokens related to
129129
// workspace applications. It consists of both a signing and encryption key.
130130
AppSecurityKey workspaceapps.SecurityKey
131-
HealthcheckFunc func(ctx context.Context) (*healthcheck.Report, error)
131+
HealthcheckFunc func(ctx context.Context, apiKey string) (*healthcheck.Report, error)
132132
HealthcheckTimeout time.Duration
133133
HealthcheckRefresh time.Duration
134134

@@ -254,12 +254,6 @@ func New(options *Options) *API {
254254
v := schedule.NewAGPLTemplateScheduleStore()
255255
options.TemplateScheduleStore.Store(&v)
256256
}
257-
if options.HealthcheckTimeout == 0 {
258-
options.HealthcheckTimeout = 30 * time.Second
259-
}
260-
if options.HealthcheckRefresh == 0 {
261-
options.HealthcheckRefresh = 10 * time.Minute
262-
}
263257

264258
siteCacheDir := options.CacheDir
265259
if siteCacheDir != "" {
@@ -321,13 +315,20 @@ func New(options *Options) *API {
321315
healthCheckGroup: &singleflight.Group[string, *healthcheck.Report]{},
322316
}
323317
if options.HealthcheckFunc == nil {
324-
options.HealthcheckFunc = func(ctx context.Context) (*healthcheck.Report, error) {
318+
options.HealthcheckFunc = func(ctx context.Context, apiKey string) (*healthcheck.Report, error) {
325319
return healthcheck.Run(ctx, &healthcheck.ReportOptions{
326320
AccessURL: options.AccessURL,
327321
DERPMap: api.DERPMap().Clone(),
322+
APIKey: apiKey,
328323
})
329324
}
330325
}
326+
if options.HealthcheckTimeout == 0 {
327+
options.HealthcheckTimeout = 30 * time.Second
328+
}
329+
if options.HealthcheckRefresh == 0 {
330+
options.HealthcheckRefresh = 10 * time.Minute
331+
}
331332
if options.UpdateCheckOptions != nil {
332333
api.updateChecker = updatecheck.New(
333334
options.Database,
@@ -786,6 +787,7 @@ func New(options *Options) *API {
786787

787788
r.Get("/coordinator", api.debugCoordinator)
788789
r.Get("/health", api.debugDeploymentHealth)
790+
r.Get("/ws", (&healthcheck.WebsocketEchoServer{}).ServeHTTP)
789791
})
790792
})
791793

@@ -875,6 +877,7 @@ type API struct {
875877
Experiments codersdk.Experiments
876878

877879
healthCheckGroup *singleflight.Group[string, *healthcheck.Report]
880+
healthCheckCache atomic.Pointer[healthcheck.Report]
878881
}
879882

880883
// Close waits for all WebSocket connections to drain before returning.

coderd/coderdtest/coderdtest.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ type Options struct {
107107
TrialGenerator func(context.Context, string) error
108108
TemplateScheduleStore schedule.TemplateScheduleStore
109109

110-
HealthcheckFunc func(ctx context.Context) (*healthcheck.Report, error)
110+
HealthcheckFunc func(ctx context.Context, apiKey string) (*healthcheck.Report, error)
111111
HealthcheckTimeout time.Duration
112112
HealthcheckRefresh time.Duration
113113

0 commit comments

Comments
 (0)