mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: move proxy settings page to deployment options (#8246)
* feat: Move workspace proxy page to deployment options Workspace proxy settings page is now an admin feature * WorkspaceProxy response extends region
This commit is contained in:
@@ -171,6 +171,11 @@ func (p *ProxyHealth) ForceUpdate(ctx context.Context) error {
|
||||
// HealthStatus returns the current health status of all proxies stored in the
|
||||
// cache.
|
||||
func (p *ProxyHealth) HealthStatus() map[uuid.UUID]ProxyStatus {
|
||||
if p == nil {
|
||||
// This can happen because workspace proxies are still an experiment.
|
||||
// For the /regions endpoint, this will be nil in those cases.
|
||||
return map[uuid.UUID]ProxyStatus{}
|
||||
}
|
||||
ptr := p.cache.Load()
|
||||
if ptr == nil {
|
||||
return map[uuid.UUID]ProxyStatus{}
|
||||
|
||||
@@ -36,6 +36,14 @@ func insertProxy(t *testing.T, db database.Store, url string) database.Workspace
|
||||
return proxy
|
||||
}
|
||||
|
||||
// Test the nil guard for experiment off cases.
|
||||
func TestProxyHealth_Nil(t *testing.T) {
|
||||
t.Parallel()
|
||||
var ph *proxyhealth.ProxyHealth
|
||||
|
||||
require.NotNil(t, ph.HealthStatus())
|
||||
}
|
||||
|
||||
func TestProxyHealth_Unregistered(t *testing.T) {
|
||||
t.Parallel()
|
||||
db := dbfake.New()
|
||||
|
||||
Reference in New Issue
Block a user