Skip to content

Commit

Permalink
Ensure credentials are written before performing restore
Browse files Browse the repository at this point in the history
  • Loading branch information
davissp14 committed Jul 8, 2024
1 parent eba2343 commit dcd5858
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions internal/flypg/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,18 +133,18 @@ func (n *Node) Init(ctx context.Context) error {
return fmt.Errorf("failed initialize cluster state store: %s", err)
}

// Determine if we are performing a remote restore.
if err := n.handleRemoteRestore(ctx, store); err != nil {
return fmt.Errorf("failed to handle remote restore: %s", err)
}

// Ensure we have the required s3 credentials set.
if os.Getenv("S3_ARCHIVE_CONFIG") != "" || os.Getenv("S3_ARCHIVE_REMOTE_RESTORE_CONFIG") != "" {
if err := writeS3Credentials(ctx, s3AuthDir); err != nil {
return fmt.Errorf("failed to write s3 credentials: %s", err)
}
}

// Determine if we are performing a remote restore.
if err := n.handleRemoteRestore(ctx, store); err != nil {
return fmt.Errorf("failed to handle remote restore: %s", err)
}

// Verify whether we are a booting zombie.
if ZombieLockExists() {
if err := handleZombieLock(ctx, n); err != nil {
Expand Down

0 comments on commit dcd5858

Please sign in to comment.