mirror of
https://github.com/coder/coder.git
synced 2026-06-03 04:58:23 +00:00
fix: allow coderd to start with an empty DERP map when built-in DERP is disabled (#24544)
Allow coderd to start with an empty base DERP map when built-in DERP is disabled and no static DERP map is configured, so DERP can come from workspace proxies after startup. Also add a DERP healthcheck warning when no DERP servers are currently available at runtime. Related to: https://linear.app/codercom/issue/PLAT-43/bug-coderd-unable-to-be-started-if-built-in-derp-server-disabled-and Related to: https://github.com/coder/coder/issues/22324
This commit is contained in:
@@ -560,12 +560,19 @@ func NewOptions(t testing.TB, options *Options) (func(http.Handler), context.Can
|
||||
if !options.DeploymentValues.DERP.Server.Enable.Value() {
|
||||
region = nil
|
||||
}
|
||||
derpMap, err := tailnet.NewDERPMap(ctx, region, stunAddresses,
|
||||
options.DeploymentValues.DERP.Config.URL.Value(),
|
||||
options.DeploymentValues.DERP.Config.Path.Value(),
|
||||
options.DeploymentValues.DERP.Config.BlockDirect.Value(),
|
||||
)
|
||||
require.NoError(t, err)
|
||||
derpConfigURL := options.DeploymentValues.DERP.Config.URL.Value()
|
||||
derpConfigPath := options.DeploymentValues.DERP.Config.Path.Value()
|
||||
var derpMap *tailcfg.DERPMap
|
||||
if region == nil && derpConfigURL == "" && derpConfigPath == "" {
|
||||
derpMap = &tailcfg.DERPMap{Regions: map[int]*tailcfg.DERPRegion{}}
|
||||
} else {
|
||||
derpMap, err = tailnet.NewDERPMap(
|
||||
ctx, region, stunAddresses,
|
||||
derpConfigURL, derpConfigPath,
|
||||
options.DeploymentValues.DERP.Config.BlockDirect.Value(),
|
||||
)
|
||||
require.NoError(t, err)
|
||||
}
|
||||
|
||||
return func(h http.Handler) {
|
||||
mutex.Lock()
|
||||
|
||||
Reference in New Issue
Block a user