mirror of
https://github.com/coder/coder.git
synced 2026-09-21 12:44:32 +08:00
feat: enable PG Coordinator as experiment (#8144)
Signed-off-by: Spike Curtis <spike@coder.com>
This commit is contained in:
Generated
+4
-2
@@ -7389,11 +7389,13 @@ const docTemplate = `{
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"moons",
|
||||
"workspace_actions"
|
||||
"workspace_actions",
|
||||
"tailnet_pg_coordinator"
|
||||
],
|
||||
"x-enum-varnames": [
|
||||
"ExperimentMoons",
|
||||
"ExperimentWorkspaceActions"
|
||||
"ExperimentWorkspaceActions",
|
||||
"ExperimentTailnetPGCoordinator"
|
||||
]
|
||||
},
|
||||
"codersdk.Feature": {
|
||||
|
||||
Generated
+6
-2
@@ -6612,8 +6612,12 @@
|
||||
},
|
||||
"codersdk.Experiment": {
|
||||
"type": "string",
|
||||
"enum": ["moons", "workspace_actions"],
|
||||
"x-enum-varnames": ["ExperimentMoons", "ExperimentWorkspaceActions"]
|
||||
"enum": ["moons", "workspace_actions", "tailnet_pg_coordinator"],
|
||||
"x-enum-varnames": [
|
||||
"ExperimentMoons",
|
||||
"ExperimentWorkspaceActions",
|
||||
"ExperimentTailnetPGCoordinator"
|
||||
]
|
||||
},
|
||||
"codersdk.Feature": {
|
||||
"type": "object",
|
||||
|
||||
@@ -1729,6 +1729,10 @@ const (
|
||||
// https://github.com/coder/coder/milestone/19
|
||||
ExperimentWorkspaceActions Experiment = "workspace_actions"
|
||||
|
||||
// ExperimentTailnetPGCoordinator enables the PGCoord in favor of the pubsub-
|
||||
// only Coordinator
|
||||
ExperimentTailnetPGCoordinator Experiment = "tailnet_pg_coordinator"
|
||||
|
||||
// Add new experiments here!
|
||||
// ExperimentExample Experiment = "example"
|
||||
)
|
||||
|
||||
+5
-4
@@ -2495,10 +2495,11 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
|
||||
|
||||
#### Enumerated Values
|
||||
|
||||
| Value |
|
||||
| ------------------- |
|
||||
| `moons` |
|
||||
| `workspace_actions` |
|
||||
| Value |
|
||||
| ------------------------ |
|
||||
| `moons` |
|
||||
| `workspace_actions` |
|
||||
| `tailnet_pg_coordinator` |
|
||||
|
||||
## codersdk.Feature
|
||||
|
||||
|
||||
@@ -414,7 +414,12 @@ func (api *API) updateEntitlements(ctx context.Context) error {
|
||||
if changed, enabled := featureChanged(codersdk.FeatureHighAvailability); changed {
|
||||
coordinator := agpltailnet.NewCoordinator(api.Logger)
|
||||
if enabled {
|
||||
haCoordinator, err := tailnet.NewCoordinator(api.Logger, api.Pubsub)
|
||||
var haCoordinator agpltailnet.Coordinator
|
||||
if api.AGPL.Experiments.Enabled(codersdk.ExperimentTailnetPGCoordinator) {
|
||||
haCoordinator, err = tailnet.NewPGCoord(ctx, api.Logger, api.Pubsub, api.Database)
|
||||
} else {
|
||||
haCoordinator, err = tailnet.NewCoordinator(api.Logger, api.Pubsub)
|
||||
}
|
||||
if err != nil {
|
||||
api.Logger.Error(ctx, "unable to set up high availability coordinator", slog.Error(err))
|
||||
// If we try to setup the HA coordinator and it fails, nothing
|
||||
|
||||
@@ -1346,8 +1346,15 @@ export const Entitlements: Entitlement[] = [
|
||||
]
|
||||
|
||||
// From codersdk/deployment.go
|
||||
export type Experiment = "moons" | "workspace_actions"
|
||||
export const Experiments: Experiment[] = ["moons", "workspace_actions"]
|
||||
export type Experiment =
|
||||
| "moons"
|
||||
| "tailnet_pg_coordinator"
|
||||
| "workspace_actions"
|
||||
export const Experiments: Experiment[] = [
|
||||
"moons",
|
||||
"tailnet_pg_coordinator",
|
||||
"workspace_actions",
|
||||
]
|
||||
|
||||
// From codersdk/deployment.go
|
||||
export type FeatureName =
|
||||
|
||||
Reference in New Issue
Block a user