mirror of
https://github.com/helmfile/helmfile.git
synced 2026-10-18 05:54:40 +02:00
Feature/support env hcl and interpolations (#1423)
* support HCL language for env variables Signed-off-by: xtphate <65117176+XT-Phate@users.noreply.github.com>
This commit is contained in:
@@ -354,6 +354,22 @@ func (helm *execer) DecryptSecret(context HelmContext, name string, flags ...str
|
||||
return "", err
|
||||
}
|
||||
|
||||
// When the source encrypted file is not a yaml file AND helm secrets < 4
|
||||
// secrets plugin returns a yaml file with all the content in a yaml `data` key
|
||||
// which isn't parsable from an hcl perspective
|
||||
if strings.HasSuffix(name, ".hcl") && pluginVersion.Major() < 4 {
|
||||
type helmSecretDataV3 struct {
|
||||
Data string `yaml:"data"`
|
||||
}
|
||||
var data helmSecretDataV3
|
||||
err := yaml.Unmarshal(secretBytes, &data)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("Could not unmarshall helm secret plugin V3 decrypted file to a yaml string\n"+
|
||||
"You may consider upgrading your helm secrets plugin to >4.0.\n %s", err.Error())
|
||||
}
|
||||
secretBytes = []byte(data.Data)
|
||||
}
|
||||
|
||||
secret.bytes = secretBytes
|
||||
} else {
|
||||
// Cache hit
|
||||
|
||||
Reference in New Issue
Block a user