Skip to content

Commit

Permalink
Merge pull request #9 from Amnesic-Systems/ignore-setup-err
Browse files Browse the repository at this point in the history
Ignore error if the interface already exists.
  • Loading branch information
NullHypothesis authored Oct 28, 2024
2 parents 6a732e4 + cdab573 commit c8d7862
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion internal/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"crypto/sha256"
"crypto/tls"
"errors"
"io/fs"
"log"
"net"
"net/http"
Expand Down Expand Up @@ -98,7 +99,12 @@ func setupSystem(config *config.Config) (err error) {
if err := system.SeedRandomness(); err != nil {
return err
}
return system.SetupLo()
// When running unit tests inside a Nitro Enclave, the loopback interface
// may already exist, in which case we ignore the error.
if err := system.SetupLo(); err != nil && !errors.Is(err, fs.ErrExist) {
return err
}
return nil
}

func startAllWebSrvs(
Expand Down

0 comments on commit c8d7862

Please sign in to comment.