ceph: add support for update() from lib-bucket-provisioner
Recently lib-bucket-provisioner add support for update() API. Include that on the obc implementation since it can be used to update quota for OBC. Fixes: #7146 Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
This commit is contained in:
1 parent
67acab94dd
commit
f4bb47e440
6 files changed
+104
-10
No files matched your search
@@ -53,6 +53,10 @@ func (b *BucketOperation) DeleteObc(obcName string, storageClassName string, buc
|
||||
return b.k8sh.ResourceOperation("delete", b.manifests.GetOBC(obcName, storageClassName, bucketName, maxObject, createBucket))
|
||||
}
|
||||
|
||||
func (b *BucketOperation) UpdateObc(obcName string, storageClassName string, bucketName string, maxObject string, createBucket bool) error {
|
||||
return b.k8sh.ResourceOperation("apply", b.manifests.GetOBC(obcName, storageClassName, bucketName, maxObject, createBucket))
|
||||
}
|
||||
|
||||
// CheckOBC, returns true if the obc, secret and configmap are all in the "check" state,
|
||||
// and returns false if any of these resources are not in the "check" state.
|
||||
// Check state values:
|
||||
@@ -123,3 +127,10 @@ func (b *BucketOperation) GetSecretKey(obcName string) (string, error) {
|
||||
return string(decode), nil
|
||||
|
||||
}
|
||||
|
||||
// Checks whether MaxObject is updated for ob
|
||||
func (b *BucketOperation) CheckOBMaxObject(obcName, maxobject string) bool {
|
||||
obName, _ := b.k8sh.GetResource("obc", obcName, "--output", "jsonpath={.spec.objectBucketName}")
|
||||
fetchMaxObject, _ := b.k8sh.GetResource("ob", obName, "--output", "jsonpath={.spec.endpoint.additionalConfig.maxObjects}")
|
||||
return maxobject == fetchMaxObject
|
||||
}
|
||||
Reference in new issue
Block a user