Skip to content

Conversation

@serdarozerr
Copy link
Contributor

@serdarozerr serdarozerr commented Nov 27, 2025

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.

- 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
- 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
@serdarozerr serdarozerr marked this pull request as ready for review November 27, 2025 14:51
@rkoster rkoster requested a review from Copilot November 27, 2025 15:43
@beyhan beyhan requested review from a-hassanin, aramprice, beyhan and rkoster and removed request for Copilot November 27, 2025 15:44
@beyhan beyhan moved this from Inbox to Pending Review | Discussion in Foundational Infrastructure Working Group Nov 27, 2025
- 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
Copy link
Member

@beyhan beyhan left a 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.
Copy link

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.

Copy link
Contributor Author

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.

Copy link

@johha johha left a comment

Choose a reason for hiding this comment

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

LGTM

@github-project-automation github-project-automation bot moved this from Pending Review | Discussion to Pending Merge | Prioritized in Foundational Infrastructure Working Group Dec 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Pending Merge | Prioritized

Development

Successfully merging this pull request may close these issues.

3 participants