Make all secrets case insensitive by formatting them to uppercase (#470)

* Uppercase secrets, print error when secret with same name already exists

* Test lower-to-upper case formatting for secrets
This commit is contained in:
Cat™
2021-01-12 17:54:53 +00:00
committed by GitHub
parent 1b38d5c4d9
commit 2811101dea
3 changed files with 15 additions and 0 deletions

View File

@@ -61,6 +61,9 @@ type expressionEvaluator struct {
}
func (ee *expressionEvaluator) Evaluate(in string) (string, bool, error) {
if strings.HasPrefix(in, `secrets.`){
in = `secrets.`+strings.ToUpper(strings.SplitN(in, `.`, 2)[1])
}
re := ee.Rewrite(in)
if re != in {
log.Debugf("Evaluating '%s' instead of '%s'", re, in)