1
0
Fork 0
mirror of https://github.com/Mic92/sops-nix.git synced 2025-04-09 02:14:08 +00:00

Merge pull request #145 from Mic92/feat/replace-separator

Replace separator for nested keys for consistency
This commit is contained in:
Jörg Thalheim 2021-11-29 12:24:22 +00:00 committed by GitHub
commit 0e0dcc74ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -228,7 +228,7 @@ func recurseSecretKey(keys map[string]interface{}, wantedKey string) (string, er
val, ok = currentData[currentKey]
if !ok {
if keyUntilNow != "" {
keyUntilNow += "."
keyUntilNow += "/"
}
return "", fmt.Errorf("The key '%s%s' cannot be found", keyUntilNow, currentKey)
}
@ -238,7 +238,7 @@ func recurseSecretKey(keys map[string]interface{}, wantedKey string) (string, er
if keyUntilNow == "" {
keyUntilNow = thisKey
} else {
keyUntilNow += "." + thisKey
keyUntilNow += "/" + thisKey
}
currentKey = currentKey[(slashIndex + 1):]
val, ok = currentData[thisKey]