Currently the code design only allows in-tree support for different providers. Our roadmap includes the change to code design to allow out-of-tree support for different providers. For adding support for a new object store provider, follow the steps described below. Replace provider
with your provider-name.
- Add the provider identifier constant in
pkg/snapstore/types.go
. - Add implementation for the
SnapStore
frompkg/snapstore/types.go
interface topkg/snapstore/provider_snapstore.go
.⚠️ Please use environment variable(s) to pass the object store credentials.- Provide the factory method to create provider implementation object by loading required access credentials from environment variable(s).
- Avoid introducing new command line flags for provider.
- Import the required SDK and any other libraries for provider using
go get <provider-sdk>
. This will update the dependency in go.mod and go.sum. - Run
make revendor
to download the dependency library to vendor directory. - Update the LICENSE with license details of newly added dependencies.
- Update the
GetSnapstore
method inpkg/snapstore/utils.go
to add a new case in switch block to support creation of the new provider implementation object. - Add the fake implementation of provider SDK calls under
pkg/snapstore/provider_snapstore_test.go
for unit testing the provider implementation. - Register the provider implementation object for testing at the appropriate place under
pkg/snapstore/snapstore_test.go
. This will run generic test against provider implementation. - Update the documentation to provide info about passing provider credentials.
- Update the helm chart with provider details.
- Update the values.yaml with configuration for provider.
- Refer this commit to for one of the already added provider support.
- Finally test your code using
make verify
. And raise a PR for review. 😄