From b4e7fd3926a1170336bec652cccad8188fea9a3b Mon Sep 17 00:00:00 2001 From: subhamkrai Date: Mon, 23 Jun 2025 17:02:32 +0530 Subject: [PATCH] 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 --- pkg/operator/ceph/csi/cluster_config.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkg/operator/ceph/csi/cluster_config.go b/pkg/operator/ceph/csi/cluster_config.go index 76c958a22..b4531ff6f 100644 --- a/pkg/operator/ceph/csi/cluster_config.go +++ b/pkg/operator/ceph/csi/cluster_config.go @@ -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 == "" {