Skip to content

Commit

Permalink
Merge pull request #1670 from openshift-cherrypick-robot/cherry-pick-…
Browse files Browse the repository at this point in the history
…1661-to-release-4.11

Bug 2083993: [release-4.11] ocs-to-ocs: create/delete subvolumegroup in consumer side
  • Loading branch information
openshift-ci[bot] committed May 12, 2022
2 parents ae9e0e8 + fb8cb2f commit f284ed1
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions controllers/storageclassclaim/storageclassclaim_controller.go
Expand Up @@ -291,6 +291,24 @@ func (r *StorageClassClaimReconciler) reconcileConsumerPhases() (reconcile.Resul
if err != nil {
return reconcile.Result{}, fmt.Errorf("failed to create or update secret %v: %s", secret, err)
}
case "CephFilesystemSubVolumeGroup":
subVolumeGroup := &rookCephv1.CephFilesystemSubVolumeGroup{ObjectMeta: metav1.ObjectMeta{
Name: resource.Name,
Namespace: r.storageClassClaim.Namespace,
}}
_, err = ctrl.CreateOrUpdate(context.TODO(), r.Client, subVolumeGroup, func() error {
if err := r.own(subVolumeGroup); err != nil {
return err
}
subVolumeGroup.Spec = rookCephv1.CephFilesystemSubVolumeGroupSpec{
FilesystemName: data["filesystemName"],
}
return nil
})
if err != nil {
r.log.Error(err, "Could not create CephFilesystemSubVolumeGroup.", "CephFilesystemSubVolumeGroup", klog.KRef(subVolumeGroup.Namespace, subVolumeGroup.Name))
return reconcile.Result{}, err
}
case "StorageClass":
var storageClass *storagev1.StorageClass
data["csi.storage.k8s.io/provisioner-secret-namespace"] = r.storageClassClaim.Namespace
Expand Down

0 comments on commit f284ed1

Please sign in to comment.