Skip to content

Latest commit

 

History

History
20 lines (18 loc) · 2.27 KB

new_cp_support.md

File metadata and controls

20 lines (18 loc) · 2.27 KB

Adding support for a new object store provider

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.

  1. Add the provider identifier constant in pkg/snapstore/types.go.
  2. Add implementation for the SnapStore from pkg/snapstore/types.go interface to pkg/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.
  3. Import the required SDK and any other libraries for provider using GO111MODULE=on go get <provider-sdk>. This will update the dependency in go.mod and go.sum.
  4. Run make revendor to download the dependency library to vendor directory.
  5. Update the LICENSE.md with license details of newly added dependencies.
  6. Update the GetSnapstore method in pkg/snapstore/utils.go to add a new case in switch block to support creation of the new provider implementation object.
  7. Add the fake implementation of provider SDK calls under pkg/snapstore/provider_snapstore_test.go for unit testing the provider implementation.
  8. 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.
  9. Update the documentation to provide info about passing provider credentials.
  10. Update the helm chart with provider details.
    • Update the values.yaml with configuration for provider.
  11. Refer this commit to for one of the already added provider support.
  12. Finally test your code using make verify. And raise a PR for review. 😄