mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: color value_source for deployment values (#9922)
* chore: Return populated options vs a blank * Strip secret values
This commit is contained in:
+7
-1
@@ -40,6 +40,7 @@ import (
|
||||
|
||||
"cdr.dev/slog"
|
||||
"github.com/coder/coder/v2/buildinfo"
|
||||
"github.com/coder/coder/v2/cli/clibase"
|
||||
"github.com/coder/coder/v2/coderd/audit"
|
||||
"github.com/coder/coder/v2/coderd/awsidentity"
|
||||
"github.com/coder/coder/v2/coderd/batchstats"
|
||||
@@ -152,7 +153,12 @@ type Options struct {
|
||||
MetricsCacheRefreshInterval time.Duration
|
||||
AgentStatsRefreshInterval time.Duration
|
||||
DeploymentValues *codersdk.DeploymentValues
|
||||
UpdateCheckOptions *updatecheck.Options // Set non-nil to enable update checking.
|
||||
// DeploymentOptions do contain the copy of DeploymentValues, and contain
|
||||
// contextual information about how the values were set.
|
||||
// Do not use DeploymentOptions to retrieve values, use DeploymentValues instead.
|
||||
// All secrets values are stripped.
|
||||
DeploymentOptions clibase.OptionSet
|
||||
UpdateCheckOptions *updatecheck.Options // Set non-nil to enable update checking.
|
||||
|
||||
// SSHConfig is the response clients use to configure config-ssh locally.
|
||||
SSHConfig codersdk.SSHConfigResponse
|
||||
|
||||
@@ -417,6 +417,7 @@ func NewOptions(t testing.TB, options *Options) (func(http.Handler), context.Can
|
||||
MetricsCacheRefreshInterval: options.MetricsCacheRefreshInterval,
|
||||
AgentStatsRefreshInterval: options.AgentStatsRefreshInterval,
|
||||
DeploymentValues: options.DeploymentValues,
|
||||
DeploymentOptions: codersdk.DeploymentOptionsWithoutSecrets(options.DeploymentValues.Options()),
|
||||
UpdateCheckOptions: options.UpdateCheckOptions,
|
||||
SwaggerEndpoint: options.SwaggerEndpoint,
|
||||
AppSecurityKey: AppSecurityKey,
|
||||
|
||||
@@ -33,7 +33,7 @@ func (api *API) deploymentValues(rw http.ResponseWriter, r *http.Request) {
|
||||
r.Context(), rw, http.StatusOK,
|
||||
codersdk.DeploymentConfig{
|
||||
Values: values,
|
||||
Options: values.Options(),
|
||||
Options: api.DeploymentOptions,
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user