Skip to content

Commit

Permalink
edb-connect: fix edb default host and allow caller to set it
Browse files Browse the repository at this point in the history
  • Loading branch information
BedrockSquirrel committed Dec 18, 2024
1 parent ea3bf07 commit a50c14f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tools/edbconnect/main/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ import (
)

func main() {
// optionally set edbHost from cli flag, default to obscuronode-edgelessdb-0
edbHost := "obscuronode-edgelessdb-0"
if len(os.Args) > 1 {
edbHost = os.Args[1]
}

fmt.Println("Retrieving Edgeless DB credentials...")
creds, found, err := edgelessdb.LoadCredentialsFromFile()
if err != nil {
Expand All @@ -29,9 +35,9 @@ func main() {
}
fmt.Println("TLS config created. Connecting to Edgeless DB...")
testlog.SetupSysOut()
db, err := edgelessdb.ConnectToEdgelessDB("obscuronode-edgelessdb", cfg, testlog.Logger())
db, err := edgelessdb.ConnectToEdgelessDB(edbHost, cfg, testlog.Logger())
if err != nil {
fmt.Println("Error connecting to Edgeless DB:", err)
fmt.Printf("Error connecting to Edgeless DB at %s: %v\n", edbHost, err)
panic(err)
}
fmt.Println("Connected to Edgeless DB.")
Expand Down

0 comments on commit a50c14f

Please sign in to comment.