chore: color value_source for deployment values (#9922)

* chore: Return populated options vs a blank
* Strip secret values
This commit is contained in:
Steven Masley
2023-09-29 12:04:28 -05:00
committed by GitHub
parent 87ebe6c2c2
commit 92308bec3b
12 changed files with 410 additions and 34 deletions
+13
View File
@@ -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