Skip to content

Commit

Permalink
add ROOK_OBC_PROVISIONER_NAME_PREFIX to Rook Config
Browse files Browse the repository at this point in the history
Similar to CSI_DRIVER_NAME_PREFIX for obc provisioner so that the
obc provisioner always checks for storageclass with name
 `openshift-storage.ceph.rook.io/bucket`

Signed-off-by: Jiffin Tony Thottan <[email protected]>
  • Loading branch information
thotz committed Mar 15, 2024
1 parent 6aa944d commit 98a17f0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion controllers/storagecluster/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func generateNameForSnapshotClass(initData *ocsv1.StorageCluster, snapshotType S
}

func generateNameForSnapshotClassDriver(snapshotType SnapshotterType) string {
return fmt.Sprintf("%s.%s.csi.ceph.com", csiDriverNamePrefix, snapshotType)
return fmt.Sprintf("%s.%s.csi.ceph.com", storageclassDriverNamePrefix, snapshotType)
}

func generateNameForSnapshotClassSecret(instance *ocsv1.StorageCluster, snapshotType SnapshotterType) string {
Expand Down
14 changes: 7 additions & 7 deletions controllers/storagecluster/storageclasses.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"encoding/json"
"fmt"
"os"
"reflect"
"strings"

Expand All @@ -27,14 +26,15 @@ const (
storageClassSkippedError = "some StorageClasses were skipped while waiting for pre-requisites to be met"
defaultStorageClassAnnotation = "storageclass.kubernetes.io/is-default-class"

//csi driver name prefix
csiDriverNamePrefix = "openshift-storage"
//storage class driver name prefix
storageclassDriverNamePrefix = "openshift-storage"
)

var (
rbdDriverName = csiDriverNamePrefix + ".rbd.csi.ceph.com"
cephFSDriverName = csiDriverNamePrefix + ".cephfs.csi.ceph.com"
nfsDriverName = csiDriverNamePrefix + ".nfs.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"
)

// StorageClassConfiguration provides configuration options for a StorageClass.
Expand Down Expand Up @@ -426,7 +426,7 @@ func newCephOBCStorageClassConfiguration(initData *ocsv1.StorageCluster) Storage
"description": "Provides Object Bucket Claims (OBCs)",
},
},
Provisioner: fmt.Sprintf("%s.ceph.rook.io/bucket", os.Getenv(util.OperatorNamespaceEnvVar)),
Provisioner: obcDriverName,
ReclaimPolicy: &reclaimPolicy,
Parameters: map[string]string{
"objectStoreNamespace": initData.Namespace,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3247,6 +3247,8 @@ spec:
fieldPath: metadata.namespace
- name: ROOK_OBC_WATCH_OPERATOR_NAMESPACE
value: "true"
- name: ROOK_OBC_PROVISIONER_NAME_PREFIX
value: openshift-storage
image: docker.io/rook/ceph:v1.13.0-beta.0.41.g1647c2afc
name: rook-ceph-operator
resources: {}
Expand Down
4 changes: 4 additions & 0 deletions tools/csv-merger/csv-merger.go
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,10 @@ func unmarshalCSV(filePath string) *csvv1.ClusterServiceVersion {
Name: "ROOK_OBC_WATCH_OPERATOR_NAMESPACE",
Value: "true",
},
{
Name: "ROOK_OBC_PROVISIONER_NAME_PREFIX",
Value: "openshift-storage",
},
}

if *rookCsiCephImage != "" {
Expand Down

0 comments on commit 98a17f0

Please sign in to comment.