system test t12_api sends empty keyRef string, making gpg fail

This commit is contained in:
Ales Bregar
2025-08-11 15:08:11 +02:00
committed by André Roth
parent 8e739524b0
commit aa030e3f36

View File

@@ -35,11 +35,14 @@ func (g *GpgSigner) SetBatch(batch bool) {
// SetKey sets key ID to use when signing files
func (g *GpgSigner) SetKey(keyRef string) {
if g.keyRefs == nil {
g.keyRefs = []string{strings.TrimSpace(keyRef)}
} else {
g.keyRefs = append(g.keyRefs, strings.TrimSpace(keyRef))
}
keyRef = strings.TrimSpace(keyRef)
if keyRef != "" {
if g.keyRefs == nil {
g.keyRefs = []string{keyRef}
} else {
g.keyRefs = append(g.keyRefs, keyRef)
}
}
}
// SetKeyRing allows to set custom keyring and secretkeyring