Skip to content

Commit

Permalink
label ceph svg correctly if datapool name is empty
Browse files Browse the repository at this point in the history
Signed-off-by: Leela Venkaiah G <[email protected]>
  • Loading branch information
leelavg committed Mar 25, 2024
1 parent b2c8236 commit 06dddb6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,11 @@ func (r *StorageClassRequestReconciler) reconcileCephFilesystemSubVolumeGroup()
// This label is required to set the dataPool on the CephFS
// storageclass so that each PVC created from CephFS storageclass can
// use correct dataPool backed by deviceclass.
addLabel(r.cephFilesystemSubVolumeGroup, v1alpha1.CephFileSystemDataPoolLabel, fmt.Sprintf("%s-%s", cephFilesystem.Name, dataPool.Name))
labelValue := cephFilesystem.Name
if dataPool.Name != "" {
labelValue = fmt.Sprintf("%s-%s", labelValue, dataPool.Name)
}
addLabel(r.cephFilesystemSubVolumeGroup, v1alpha1.CephFileSystemDataPoolLabel, labelValue)

r.cephFilesystemSubVolumeGroup.Spec = rookCephv1.CephFilesystemSubVolumeGroupSpec{
FilesystemName: cephFilesystem.Name,
Expand Down
1 change: 1 addition & 0 deletions deploy/ocs-operator/manifests/provider-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ rules:
- ceph.rook.io
resources:
- cephfilesystemsubvolumegroups
- cephblockpoolradosnamespaces
verbs:
- get
- list
Expand Down
1 change: 1 addition & 0 deletions rbac/provider-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ rules:
- ceph.rook.io
resources:
- cephfilesystemsubvolumegroups
- cephblockpoolradosnamespaces
verbs:
- get
- list
Expand Down

0 comments on commit 06dddb6

Please sign in to comment.