From 2ac43272a746664a89e829d775c425a77a8bc646 Mon Sep 17 00:00:00 2001 From: Shaun Davis Date: Tue, 2 Jul 2024 11:25:22 -0500 Subject: [PATCH] Bug fix --- cmd/start/main.go | 8 ++++++++ internal/flypg/node.go | 4 ---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/cmd/start/main.go b/cmd/start/main.go index b3cb3fbf..9dda20d3 100644 --- a/cmd/start/main.go +++ b/cmd/start/main.go @@ -55,6 +55,14 @@ func main() { return } + // TODO - Find a better way to handle this + if os.Getenv("BARMAN_ENABLED") != "" || os.Getenv("BARMAN_REMOTE_RESTORE") != "" { + if err := os.Setenv("AWS_SHARED_CREDENTIALS_FILE", "/data/.aws/credentials"); err != nil { + panicHandler(err) + return + } + } + node, err := flypg.NewNode() if err != nil { panicHandler(err) diff --git a/internal/flypg/node.go b/internal/flypg/node.go index 3e40fb17..62722848 100644 --- a/internal/flypg/node.go +++ b/internal/flypg/node.go @@ -145,10 +145,6 @@ func (n *Node) Init(ctx context.Context) error { if err := writeS3Credentials(ctx, s3AuthDir); err != nil { return fmt.Errorf("failed to write s3 credentials: %s", err) } - - if err := os.Setenv("AWS_SHARED_CREDENTIALS_FILE", "/data/.aws/credentials"); err != nil { - return fmt.Errorf("failed to set aws credentials path: %s", err) - } } store, err := state.NewStore()