Skip to content

Conversation

sravotto
Copy link
Collaborator

Introduce internal/store/s3.go with an S3-backed Store implementation:

  • Constructed via S3FromEnv using AWS-style environment variables.
  • Supports alternates (path-style, skip checksum, skip TLS) with a safe baseline first.
  • Probes connectivity by writing, reading, and deleting a _blobcheck object.

@sravotto sravotto marked this pull request as ready for review August 21, 2025 22:43
@sravotto sravotto requested a review from BramGruneir August 21, 2025 22:43
Copy link
Collaborator

@BramGruneir BramGruneir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with some minor comments.

)

const (
// AccountParam is the AWS access key ID.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These comments are pointless.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some of these are required by the linter.

Obfuscated = "******"
)

// ErrMissingParam is returned when required parameters are missing.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unneeded comment

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

required by linter.

// candidateConfigs provides a set of candidate configurations for the S3 store.
func (s *s3Store) candidateConfigs() iter.Seq[Store] {
return func(yield func(Store) bool) {
combos := [][]string{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why redefine this here and not put it in the outer function, or even on the top level?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point. Adding a comment for now.

Key: aws.String(probeKey),
})
if err != nil {
// we were able to write this object, it must exists.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But there was still an error? so I'm a little confused by workflow here

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update the comment. This workflow is just to verify that we can write, read, delete, list an object.

}
}
}

// Store represents a destination to perform a backup/restore.
type Store interface {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you rename store. Since that usually means a hard drive. ExternalStorage or something like that perhaps?

Introduce `internal/store/s3.go` with an S3-backed Store implementation:

- Constructed via `S3FromEnv` using AWS-style environment variables.
- Supports alternates (path-style, skip checksum, skip TLS) with a safe baseline first.
- Probes connectivity by writing, reading, and deleting a `_blobcheck` object.
@sravotto sravotto merged commit 83b8299 into main Aug 22, 2025
5 checks passed
@sravotto sravotto deleted the sr8_s3 branch August 22, 2025 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants