csi: test skip updating rook-ceph-csi-config cm

When the csi-operator is enabled no need to update
the cm rook-ceph-csi-config configmap.
Otherwise operator will complain about the error
```yaml
ceph-cluster-controller: failed to reconcile CephCluster "rook-ceph/rook-ceph". failed to reconcile cluster "rook-ceph": failed to configure local ceph cluster: failed to create cluster: failed to start ceph monitors: failed to initialize ceph cluster info: failed to save mons: failed to update csi cluster config: waiting for CSI config map to be created: configmaps "rook-ceph-csi-config" not found
```

Signed-off-by: subhamkrai <srai@redhat.com>
This commit is contained in:
subhamkrai
2025-06-24 15:09:16 +05:30
parent 8a6afe7d6a
commit b4e7fd3926
+9
View File
@@ -314,6 +314,10 @@ func updateCsiConfigMapOwnerRefs(ctx context.Context, namespace string, clientse
// CephFilesystemSubVolumeGroup) or for other supplementary entries, the clusterID should be unique
// and different from the namespace so as not to disrupt CephCluster configurations.
func SaveClusterConfig(clientset kubernetes.Interface, clusterID, clusterNamespace string, clusterInfo *cephclient.ClusterInfo, newCsiClusterConfigEntry *CSIClusterConfigEntry) error {
if EnableCSIOperator() {
logger.Debugf("csi-operator is enabled no need to save/update csi config in configmap %q", configName)
return nil
}
// csi is deployed into the same namespace as the operator
csiNamespace := os.Getenv(k8sutil.PodNamespaceEnvVar)
if csiNamespace == "" {
@@ -391,6 +395,11 @@ func updateCSIDriverOptions(curr, clusterKey string,
// SaveCSIDriverOptions, similar to SaveClusterConfig, updates the config map used by ceph-csi
// with CSI driver options such as read affinity, kernel mount options and fuse mount options.
func SaveCSIDriverOptions(clientset kubernetes.Interface, clusterNamespace string, clusterInfo *cephclient.ClusterInfo) error {
if EnableCSIOperator() {
logger.Debugf("csi-operator is enabled no need to save/update csi config in configmap %q", configName)
return nil
}
// csi is deployed into the same namespace as the operator
csiNamespace := os.Getenv(k8sutil.PodNamespaceEnvVar)
if csiNamespace == "" {