Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions mantle/platform/qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import (
"path/filepath"
"strconv"
"strings"
"sync"
"syscall"
"time"

Expand Down Expand Up @@ -758,11 +759,20 @@ func (builder *QemuBuilder) SetSecureExecution(gpgkey string, hostkey string, co
return nil
}

// When running kola secex tests with '--parallel=auto', this function fails with:
//
// kola: retryloop: failed to bring up machines: encrypting ignition_crypted.1234: exit status 2
//
// Use mutex to protect `gpg --encrypt`
var gpgMutex sync.Mutex

func (builder *QemuBuilder) encryptIgnitionConfig() error {
crypted, err := builder.TempFile("ignition_crypted.*")
if err != nil {
return fmt.Errorf("creating crypted config: %v", err)
}
gpgMutex.Lock()
defer gpgMutex.Unlock()
c := exec.Command("gpg", "--recipient-file", builder.ignitionPubKey, "--yes", "--output", crypted.Name(), "--armor", "--encrypt", builder.ConfigFile)
if err := c.Run(); err != nil {
return fmt.Errorf("encrypting %s: %v", crypted.Name(), err)
Expand Down
Loading