forked from rook/rook
Adding CephCOSIDriver CRD and controller. The controller will bring up the ceph cosi driver when first object store is created in the rook operator namespace. Then admin can defined COSI CRDs like BucketClass and BucketAccessClass for different object stores deployed via Rook. Using the BucketClass and BucketAccessClass, user can define BucketAccess for backend bucket in the RGW. The CephCOSIDriver CRD defines configuration options for ceph cosi driver. In the first version its usability is minimal. Even if it is not defined Rook will bring up the ceph cosi driver with default values. Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
40 lines
1.4 KiB
Go
40 lines
1.4 KiB
Go
package clients
|
|
|
|
import (
|
|
"github.com/rook/rook/tests/framework/installer"
|
|
"github.com/rook/rook/tests/framework/utils"
|
|
)
|
|
|
|
type COSIOperation struct {
|
|
k8sh *utils.K8sHelper
|
|
manifests installer.CephManifests
|
|
}
|
|
|
|
func CreateCOSIOperation(k8sh *utils.K8sHelper, manifests installer.CephManifests) *COSIOperation {
|
|
return &COSIOperation{k8sh, manifests}
|
|
}
|
|
|
|
func (c *COSIOperation) CreateCOSI() error {
|
|
return c.k8sh.ResourceOperation("create", c.manifests.GetCOSIDriver())
|
|
}
|
|
|
|
func (c *COSIOperation) DeleteCOSI() error {
|
|
return c.k8sh.ResourceOperation("delete", c.manifests.GetCOSIDriver())
|
|
}
|
|
|
|
func (c *COSIOperation) CreateBucketClass(name, objectStoreUserSecretName, deletionPolicy string) error {
|
|
return c.k8sh.ResourceOperation("create", c.manifests.GetBucketClass(name, objectStoreUserSecretName, deletionPolicy))
|
|
}
|
|
|
|
func (c *COSIOperation) DeleteBucketClass(name, objectStoreUserSecretName, deletionPolicy string) error {
|
|
return c.k8sh.ResourceOperation("delete", c.manifests.GetBucketClass(name, objectStoreUserSecretName, deletionPolicy))
|
|
}
|
|
|
|
func (c *COSIOperation) CreateBucketClaim(name, bucketClassName string) error {
|
|
return c.k8sh.ResourceOperation("create", c.manifests.GetBucketClaim(name, bucketClassName))
|
|
}
|
|
|
|
func (c *COSIOperation) DeleteBucketClaim(name, bucketClassName string) error {
|
|
return c.k8sh.ResourceOperation("delete", c.manifests.GetBucketClaim(name, bucketClassName))
|
|
}
|