mirror of
https://github.com/Mic92/sops-nix.git
synced 2025-12-28 15:24:59 +08:00
test
Signed-off-by: iosmanthus <myosmanthustree@gmail.com>
This commit is contained in:
parent
535d345446
commit
16c8f81400
1 changed files with 20 additions and 8 deletions
|
|
@ -242,14 +242,26 @@ func recurseSecretKey(format FormatType, keys map[string]interface{}, wantedKey
|
|||
if !ok {
|
||||
return "", fmt.Errorf("the key '%s' cannot be found", keyUntilNow)
|
||||
}
|
||||
var valWithWrongType map[string]interface{}
|
||||
valWithWrongType, ok = val.(map[string]interface{})
|
||||
if !ok {
|
||||
return "", fmt.Errorf("key '%s' does not refer to a dictionary", keyUntilNow)
|
||||
}
|
||||
currentData = make(map[string]interface{})
|
||||
for key, value := range valWithWrongType {
|
||||
currentData[fmt.Sprintf("%v", key)] = value
|
||||
if format == JSON {
|
||||
var valWithWrongType map[string]interface{}
|
||||
valWithWrongType, ok = val.(map[string]interface{})
|
||||
if !ok {
|
||||
return "", fmt.Errorf("key '%s' does not refer to a dictionary", keyUntilNow)
|
||||
}
|
||||
currentData = make(map[string]interface{})
|
||||
for key, value := range valWithWrongType {
|
||||
currentData[fmt.Sprintf("%v", key)] = value
|
||||
}
|
||||
} else {
|
||||
var valWithWrongType map[interface{}]interface{}
|
||||
valWithWrongType, ok = val.(map[interface{}]interface{})
|
||||
if !ok {
|
||||
return "", fmt.Errorf("key '%s' does not refer to a dictionary", keyUntilNow)
|
||||
}
|
||||
currentData = make(map[string]interface{})
|
||||
for key, value := range valWithWrongType {
|
||||
currentData[fmt.Sprintf("%v", key)] = value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue