Skip to content

Commit

Permalink
Merge pull request #2876 from parth-gr/ux-device-class
Browse files Browse the repository at this point in the history
ux: add a new expandStorage handler
  • Loading branch information
openshift-merge-bot[bot] authored Nov 12, 2024
2 parents 199e115 + 4f6be38 commit 99fdb66
Show file tree
Hide file tree
Showing 8 changed files with 350 additions and 7 deletions.
6 changes: 6 additions & 0 deletions config/rbac/oauth_proxy_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,9 @@ rules:
resources:
- subjectaccessreviews
verbs: ["create"]
- apiGroups:
- storage.k8s.io
resources:
- storageclasses
verbs:
- create
14 changes: 7 additions & 7 deletions controllers/storagecluster/storageclasses.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ const (
)

var (
rbdDriverName = storageclassDriverNamePrefix + ".rbd.csi.ceph.com"
cephFSDriverName = storageclassDriverNamePrefix + ".cephfs.csi.ceph.com"
RbdDriverName = storageclassDriverNamePrefix + ".rbd.csi.ceph.com"
CephFSDriverName = storageclassDriverNamePrefix + ".cephfs.csi.ceph.com"
nfsDriverName = storageclassDriverNamePrefix + ".nfs.csi.ceph.com"
obcDriverName = storageclassDriverNamePrefix + ".ceph.rook.io/bucket"
)
Expand Down Expand Up @@ -108,7 +108,7 @@ func (r *StorageClusterReconciler) createStorageClasses(sccs []StorageClassConfi
sc := scc.storageClass

switch {
case (strings.Contains(sc.Name, "-ceph-rbd") || (strings.Contains(sc.Provisioner, rbdDriverName)) && !strings.Contains(sc.Name, "-ceph-non-resilient-rbd")) && !scc.isClusterExternal:
case (strings.Contains(sc.Name, "-ceph-rbd") || (strings.Contains(sc.Provisioner, RbdDriverName)) && !strings.Contains(sc.Name, "-ceph-non-resilient-rbd")) && !scc.isClusterExternal:
// wait for CephBlockPool to be ready
cephBlockPool := cephv1.CephBlockPool{}
key := types.NamespacedName{Name: sc.Parameters["pool"], Namespace: namespace}
Expand Down Expand Up @@ -170,7 +170,7 @@ func (r *StorageClusterReconciler) createStorageClasses(sccs []StorageClassConfi
skippedSC = append(skippedSC, sc.Name)
continue
}
case (strings.Contains(sc.Name, "-cephfs") || strings.Contains(sc.Provisioner, cephFSDriverName)) && !scc.isClusterExternal:
case (strings.Contains(sc.Name, "-cephfs") || strings.Contains(sc.Provisioner, CephFSDriverName)) && !scc.isClusterExternal:
// wait for CephFilesystem to be ready
cephFilesystem := cephv1.CephFilesystem{}
key := types.NamespacedName{Name: sc.Parameters["fsName"], Namespace: namespace}
Expand Down Expand Up @@ -254,7 +254,7 @@ func newCephFilesystemStorageClassConfiguration(initData *ocsv1.StorageCluster)
"description": "Provides RWO and RWX Filesystem volumes",
},
},
Provisioner: cephFSDriverName,
Provisioner: CephFSDriverName,
ReclaimPolicy: &persistentVolumeReclaimDelete,
// AllowVolumeExpansion is set to true to enable expansion of OCS backed Volumes
AllowVolumeExpansion: &allowVolumeExpansion,
Expand Down Expand Up @@ -289,7 +289,7 @@ func newCephBlockPoolStorageClassConfiguration(initData *ocsv1.StorageCluster) S
"reclaimspace.csiaddons.openshift.io/schedule": "@weekly",
},
},
Provisioner: rbdDriverName,
Provisioner: RbdDriverName,
ReclaimPolicy: &persistentVolumeReclaimDelete,
// AllowVolumeExpansion is set to true to enable expansion of OCS backed Volumes
AllowVolumeExpansion: &allowVolumeExpansion,
Expand Down Expand Up @@ -345,7 +345,7 @@ func newNonResilientCephBlockPoolStorageClassConfiguration(initData *ocsv1.Stora
"reclaimspace.csiaddons.openshift.io/schedule": "@weekly",
},
},
Provisioner: rbdDriverName,
Provisioner: RbdDriverName,
ReclaimPolicy: &persistentVolumeReclaimDelete,
VolumeBindingMode: &volumeBindingWaitForFirstConsumer,
// AllowVolumeExpansion is set to true to enable expansion of OCS backed Volumes
Expand Down
6 changes: 6 additions & 0 deletions deploy/csv-templates/ocs-operator.csv.yaml.in
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,12 @@ spec:
- subjectaccessreviews
verbs:
- create
- apiGroups:
- storage.k8s.io
resources:
- storageclasses
verbs:
- create
serviceAccountName: ux-backend-server
deployments:
- name: ocs-operator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,12 @@ spec:
- subjectaccessreviews
verbs:
- create
- apiGroups:
- storage.k8s.io
resources:
- storageclasses
verbs:
- create
serviceAccountName: ux-backend-server
deployments:
- name: ocs-operator
Expand Down
7 changes: 7 additions & 0 deletions deploy/ocs-operator/manifests/ux_backend_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,10 @@ rules:
verbs:
- get
- list
- update
- apiGroups:
- ceph.rook.io
resources:
- cephblockpools
verbs:
- create
7 changes: 7 additions & 0 deletions rbac/ux_backend_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,10 @@ rules:
verbs:
- get
- list
- update
- apiGroups:
- ceph.rook.io
resources:
- cephblockpools
verbs:
- create
Loading

0 comments on commit 99fdb66

Please sign in to comment.