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:
@@ -1762,6 +1762,19 @@ type LinkConfig struct {
|
||||
Icon string `json:"icon" yaml:"icon"`
|
||||
}
|
||||
|
||||
// DeploymentOptionsWithoutSecrets returns a copy of the OptionSet with secret values omitted.
|
||||
func DeploymentOptionsWithoutSecrets(set clibase.OptionSet) clibase.OptionSet {
|
||||
cpy := make(clibase.OptionSet, 0, len(set))
|
||||
for _, opt := range set {
|
||||
cpyOpt := opt
|
||||
if IsSecretDeploymentOption(cpyOpt) {
|
||||
cpyOpt.Value = nil
|
||||
}
|
||||
cpy = append(cpy, cpyOpt)
|
||||
}
|
||||
return cpy
|
||||
}
|
||||
|
||||
// WithoutSecrets returns a copy of the config without secret values.
|
||||
func (c *DeploymentValues) WithoutSecrets() (*DeploymentValues, error) {
|
||||
var ff DeploymentValues
|
||||
|
||||
Reference in New Issue
Block a user