mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: add experiment toggle for terraform workspace caching (#20559)
Experiments passed to provisioners to determine behavior. This adds `--experiments` flag to provisioner daemons. Prior to this, provisioners had no method to turn on/off experiments.
This commit is contained in:
@@ -23,6 +23,7 @@ import (
|
||||
"github.com/coder/coder/v2/cli/clilog"
|
||||
"github.com/coder/coder/v2/cli/cliui"
|
||||
"github.com/coder/coder/v2/cli/cliutil"
|
||||
"github.com/coder/coder/v2/coderd"
|
||||
"github.com/coder/coder/v2/coderd/database"
|
||||
"github.com/coder/coder/v2/codersdk"
|
||||
"github.com/coder/coder/v2/codersdk/drpcsdk"
|
||||
@@ -48,6 +49,7 @@ func (r *RootCmd) provisionerDaemonStart() *serpent.Command {
|
||||
preSharedKey string
|
||||
provisionerKey string
|
||||
verbose bool
|
||||
experiments []string
|
||||
|
||||
prometheusEnable bool
|
||||
prometheusAddress string
|
||||
@@ -186,6 +188,7 @@ func (r *RootCmd) provisionerDaemonStart() *serpent.Command {
|
||||
Listener: terraformServer,
|
||||
Logger: logger.Named("terraform"),
|
||||
WorkDirectory: tempDir,
|
||||
Experiments: coderd.ReadExperiments(logger, experiments),
|
||||
},
|
||||
CachePath: cacheDir,
|
||||
})
|
||||
@@ -378,6 +381,14 @@ func (r *RootCmd) provisionerDaemonStart() *serpent.Command {
|
||||
Value: serpent.StringOf(&prometheusAddress),
|
||||
Default: "127.0.0.1:2112",
|
||||
},
|
||||
{
|
||||
Name: "Experiments",
|
||||
Description: "Enable one or more experiments. These are not ready for production. Separate multiple experiments with commas, or enter '*' to opt-in to all available experiments.",
|
||||
Flag: "experiments",
|
||||
Env: "CODER_EXPERIMENTS",
|
||||
Value: serpent.StringArrayOf(&experiments),
|
||||
YAML: "experiments",
|
||||
},
|
||||
}
|
||||
orgContext.AttachOptions(cmd)
|
||||
|
||||
|
||||
@@ -6,6 +6,11 @@ USAGE:
|
||||
Run a provisioner daemon
|
||||
|
||||
OPTIONS:
|
||||
--experiments string-array, $CODER_EXPERIMENTS
|
||||
Enable one or more experiments. These are not ready for production.
|
||||
Separate multiple experiments with commas, or enter '*' to opt-in to
|
||||
all available experiments.
|
||||
|
||||
-O, --org string, $CODER_ORGANIZATION
|
||||
Select which organization (uuid or name) to use.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user