-
Notifications
You must be signed in to change notification settings - Fork 1
One Main #13
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
base: main
Are you sure you want to change the base?
One Main #13
Conversation
- Factory function created for object creation - Commands migrated to strategy module - Common interface is created - Each client implemeted common interface alioss, azurebs, gcs, s3 - Test are refactored based on common interface - Dav client still not integrated into main since it has different implementation
925681d to
64982c8
Compare
- sign action converted to lower to handle variations - Nonflagargs condition fixed to be 1, with new commands it can be only command name like; list, ensure-storage-exists
- dav/app used as proxy to be compatible with existing storager interface - dav/main deleted - config reader created for dav - defer close added to main for config file
- factory refactored to write tests easly.
- ExecuteCommand refactored to return errors. - Logging function moved to main
- command(put,delete...) from nonFlagArgs extracted and only arguments for that command being send into the ExecuteCommand function
beyhan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We discussed this PR during yesterday's FI WG meeting. We think it makes sense to try integrating one of the storage provider options (like Azure or S3) into Director, Agent, and BOSH CLI as a POC, with the goal of verifying that this approach will work for the BOSH components.
|
|
||
| ## Configuration | ||
| The command line tool expects a JSON configuration file. Run `storage-cli-gcs --help` for details. | ||
| The GCS client requires a JSON configuration file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice to have a configuration example here as well similar to the others. But as this not present in bosh-gcscli this can be added later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, once i have an example config will add.
johha
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Context
Object creation and command handling were duplicated across clients. Each backend (alioss, azurebs, gcs, s3) had its own entrypoint and build workflow, creating extra maintenance overhead.
Solution
This update introduces a unified architecture to reduce duplication and streamline maintenance across all storage clients. A factory function now handles object creation, and command logic has been moved into a dedicated strategy module. A common interface was added and implemented by alioss, azurebs, gcs, and s3, ensuring consistent behavior across clients. Tests were refactored to target this shared interface. With the latest changes, the DAV client has also been integrated into the new main: its app package is used as a proxy to conform to the shared interface, its standalone main was removed.