cosi.go 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. package clients
  2. import (
  3. "github.com/rook/rook/tests/framework/installer"
  4. "github.com/rook/rook/tests/framework/utils"
  5. )
  6. type COSIOperation struct {
  7. k8sh *utils.K8sHelper
  8. manifests installer.CephManifests
  9. }
  10. func CreateCOSIOperation(k8sh *utils.K8sHelper, manifests installer.CephManifests) *COSIOperation {
  11. return &COSIOperation{k8sh, manifests}
  12. }
  13. func (c *COSIOperation) CreateCOSI() error {
  14. return c.k8sh.ResourceOperation("create", c.manifests.GetCOSIDriver())
  15. }
  16. func (c *COSIOperation) DeleteCOSI() error {
  17. return c.k8sh.ResourceOperation("delete", c.manifests.GetCOSIDriver())
  18. }
  19. func (c *COSIOperation) CreateBucketClass(name, objectStoreUserSecretName, deletionPolicy string) error {
  20. return c.k8sh.ResourceOperation("create", c.manifests.GetBucketClass(name, objectStoreUserSecretName, deletionPolicy))
  21. }
  22. func (c *COSIOperation) DeleteBucketClass(name, objectStoreUserSecretName, deletionPolicy string) error {
  23. return c.k8sh.ResourceOperation("delete", c.manifests.GetBucketClass(name, objectStoreUserSecretName, deletionPolicy))
  24. }
  25. func (c *COSIOperation) CreateBucketClaim(name, bucketClassName string) error {
  26. return c.k8sh.ResourceOperation("create", c.manifests.GetBucketClaim(name, bucketClassName))
  27. }
  28. func (c *COSIOperation) DeleteBucketClaim(name, bucketClassName string) error {
  29. return c.k8sh.ResourceOperation("delete", c.manifests.GetBucketClaim(name, bucketClassName))
  30. }