@@ -25,10 +25,10 @@ import (
25
25
"time"
26
26
27
27
objectdriverv1alpha1 "github.com/IBM/ibm-object-csi-driver-operator/api/v1alpha1"
28
+ "github.com/IBM/ibm-object-csi-driver-operator/controllers/constants"
28
29
crutils "github.com/IBM/ibm-object-csi-driver-operator/controllers/internal/crutils"
29
30
clustersyncer "github.com/IBM/ibm-object-csi-driver-operator/controllers/syncer"
30
31
"github.com/IBM/ibm-object-csi-driver-operator/controllers/util/common"
31
- oconfig "github.com/IBM/ibm-object-csi-driver-operator/pkg/config"
32
32
oversion "github.com/IBM/ibm-object-csi-driver-operator/version"
33
33
"github.com/go-logr/logr"
34
34
"github.com/presslabs/controller-util/pkg/syncer"
@@ -279,7 +279,7 @@ func (r *IBMObjectCSIReconciler) isNodeReady(node *appsv1.DaemonSet) bool {
279
279
func (r * IBMObjectCSIReconciler ) getNodeDaemonSet (instance * crutils.IBMObjectCSI ) (* appsv1.DaemonSet , error ) {
280
280
node := & appsv1.DaemonSet {}
281
281
err := r .Get (context .TODO (), types.NamespacedName {
282
- Name : oconfig . GetNameForResource ( oconfig .CSINode , oconfig . DriverPrefix ),
282
+ Name : constants . GetResourceName ( constants .CSINode ),
283
283
Namespace : instance .Namespace ,
284
284
}, node )
285
285
return node , err
@@ -288,7 +288,7 @@ func (r *IBMObjectCSIReconciler) getNodeDaemonSet(instance *crutils.IBMObjectCSI
288
288
func (r * IBMObjectCSIReconciler ) getControllerDeployment (instance * crutils.IBMObjectCSI ) (* appsv1.Deployment , error ) {
289
289
controllerDeployment := & appsv1.Deployment {}
290
290
err := r .Get (context .TODO (), types.NamespacedName {
291
- Name : oconfig . GetNameForResource ( oconfig .CSIController , oconfig . DriverPrefix ),
291
+ Name : constants . GetResourceName ( constants .CSIController ),
292
292
Namespace : instance .Namespace ,
293
293
}, controllerDeployment )
294
294
return controllerDeployment , err
@@ -315,8 +315,8 @@ func (r *IBMObjectCSIReconciler) reconcileServiceAccount(instance *crutils.IBMOb
315
315
controller := instance .GenerateControllerServiceAccount ()
316
316
node := instance .GenerateNodeServiceAccount ()
317
317
318
- controllerServiceAccountName := oconfig . GetNameForResource ( oconfig .CSIControllerServiceAccount , oconfig . DriverPrefix )
319
- nodeServiceAccountName := oconfig . GetNameForResource ( oconfig .CSINodeServiceAccount , oconfig . DriverPrefix )
318
+ controllerServiceAccountName := constants . GetResourceName ( constants .CSIControllerServiceAccount )
319
+ nodeServiceAccountName := constants . GetResourceName ( constants .CSINodeServiceAccount )
320
320
321
321
for _ , sa := range []* corev1.ServiceAccount {
322
322
controller ,
@@ -370,7 +370,7 @@ func (r *IBMObjectCSIReconciler) reconcileServiceAccount(instance *crutils.IBMOb
370
370
}
371
371
372
372
func (r * IBMObjectCSIReconciler ) rolloutRestartNode (node * appsv1.DaemonSet ) error {
373
- restartedAt := fmt .Sprintf ("%s/restartedAt" , oconfig .APIGroup )
373
+ restartedAt := fmt .Sprintf ("%s/restartedAt" , constants .APIGroup )
374
374
timestamp := time .Now ().String ()
375
375
node .Spec .Template .ObjectMeta .Annotations [restartedAt ] = timestamp
376
376
return r .Update (context .TODO (), node )
@@ -469,11 +469,11 @@ func (r *IBMObjectCSIReconciler) getClusterRoleBindings(instance *crutils.IBMObj
469
469
}
470
470
471
471
func (r * IBMObjectCSIReconciler ) getStorageClasses (instance * crutils.IBMObjectCSI ) []* storagev1.StorageClass {
472
- rcloneRetainSC := instance .GenerateRcloneSC (oconfig .RcloneRetainStorageClass , corev1 .PersistentVolumeReclaimRetain )
473
- rcloneSC := instance .GenerateRcloneSC (oconfig .RcloneStorageClass , corev1 .PersistentVolumeReclaimDelete )
472
+ rcloneRetainSC := instance .GenerateRcloneSC (constants .RcloneRetainStorageClass , corev1 .PersistentVolumeReclaimRetain )
473
+ rcloneSC := instance .GenerateRcloneSC (constants .RcloneStorageClass , corev1 .PersistentVolumeReclaimDelete )
474
474
475
- s3fsRetainSC := instance .GenerateS3fsSC (oconfig .S3fsRetainStorageClass , corev1 .PersistentVolumeReclaimRetain )
476
- s3fsSC := instance .GenerateS3fsSC (oconfig .S3fsStorageClass , corev1 .PersistentVolumeReclaimDelete )
475
+ s3fsRetainSC := instance .GenerateS3fsSC (constants .S3fsRetainStorageClass , corev1 .PersistentVolumeReclaimRetain )
476
+ s3fsSC := instance .GenerateS3fsSC (constants .S3fsStorageClass , corev1 .PersistentVolumeReclaimDelete )
477
477
478
478
return []* storagev1.StorageClass {
479
479
rcloneRetainSC ,
0 commit comments