Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lots of code in different stores can be consolidated #106

Closed
discentem opened this issue May 23, 2023 · 3 comments
Closed

Lots of code in different stores can be consolidated #106

discentem opened this issue May 23, 2023 · 3 comments
Labels
AWS S3 FR/Bugs related to AWS S3 store implementation enhancement New feature or request Google Cloud Storage FR/Bugs related to GCS store implementation

Comments

@discentem
Copy link
Owner

https://github.com/discentem/cavorite/blob/main/internal/stores/s3.go#L120-L153

and

https://github.com/discentem/cavorite/blob/main/internal/stores/gcs.go#L69-L92

are identical. Instead maintaining this code in each of the store providers (and future providers), we should abstract this out.

@discentem discentem added enhancement New feature or request Google Cloud Storage FR/Bugs related to GCS store implementation AWS S3 FR/Bugs related to AWS S3 store implementation labels May 23, 2023
@discentem discentem changed the title Lots of in different stores can be consolidated Lots of code in different stores can be consolidated May 23, 2023
@discentem
Copy link
Owner Author

@natewalck do you feel that this issue is resolved by #111?

@natewalck
Copy link
Collaborator

natewalck commented May 28, 2023

Not entirely.

#111 still does config checking within the store. (Specifically, checking for the metadata extension config to exist)

If a config is required for cavorite to run, we should be checking it and bailing (or set a default) in the code that is reading the config. This should live here: https://github.com/discentem/cavorite/blob/main/internal/cli/init.go#L72

The config code should own the config validation, if that makes sense.

@discentem
Copy link
Owner Author

Closing this. Opened #113 to keep track of the config validation changes @natewalck is requesting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AWS S3 FR/Bugs related to AWS S3 store implementation enhancement New feature or request Google Cloud Storage FR/Bugs related to GCS store implementation
Projects
None yet
Development

No branches or pull requests

2 participants