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 ec195aad47
commit 49cb084c8f
+8 -5
View File
@@ -35,11 +35,14 @@ func (g *GpgSigner) SetBatch(batch bool) {
// SetKey sets key ID to use when signing files // SetKey sets key ID to use when signing files
func (g *GpgSigner) SetKey(keyRef string) { func (g *GpgSigner) SetKey(keyRef string) {
if g.keyRefs == nil { keyRef = strings.TrimSpace(keyRef)
g.keyRefs = []string{strings.TrimSpace(keyRef)} if keyRef != "" {
} else { if g.keyRefs == nil {
g.keyRefs = append(g.keyRefs, strings.TrimSpace(keyRef)) g.keyRefs = []string{keyRef}
} } else {
g.keyRefs = append(g.keyRefs, keyRef)
}
}
} }
// SetKeyRing allows to set custom keyring and secretkeyring // SetKeyRing allows to set custom keyring and secretkeyring