Signed-off-by: iosmanthus <myosmanthustree@gmail.com>
This commit is contained in:
iosmanthus 2024-06-06 16:44:43 +08:00
parent b0e9f7cc99
commit 535d345446
No known key found for this signature in database
GPG key ID: DEE5BAABFE092169

View file

@ -242,8 +242,8 @@ func recurseSecretKey(format FormatType, keys map[string]interface{}, wantedKey
if !ok {
return "", fmt.Errorf("the key '%s' cannot be found", keyUntilNow)
}
var valWithWrongType map[interface{}]interface{}
valWithWrongType, ok = val.(map[interface{}]interface{})
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)
}
@ -474,7 +474,7 @@ func (app *appContext) validateSopsFile(s *secret, file *secretFile) error {
if app.checkMode != Manifest && (s.Format != Binary && s.Format != Dotenv && s.Format != Ini) {
_, err := recurseSecretKey(s.Format, file.keys, s.Key)
if err != nil {
return fmt.Errorf("secret %s in %s is not valid: %w (format: %s)", s.Name, s.SopsFile, err, s.Format)
return fmt.Errorf("secret %s in %s is not valid: %w", s.Name, s.SopsFile, err)
}
}
return nil