Merge pull request #13420 from iPraveenParihar/api/csi-config-map
csi: use ceph-csi exposed csi config map API
This commit is contained in:
10 files changed
+263
-182
No files matched your search
@@ -20,6 +20,7 @@ package cluster
|
||||
import (
|
||||
"context"
|
||||
|
||||
cephcsi "github.com/ceph/ceph-csi/api/deploy/kubernetes"
|
||||
"github.com/pkg/errors"
|
||||
cephv1 "github.com/rook/rook/pkg/apis/ceph.rook.io/v1"
|
||||
"github.com/rook/rook/pkg/clusterd"
|
||||
@@ -129,7 +130,13 @@ func (c *ClusterController) configureExternalCephCluster(cluster *cluster) error
|
||||
|
||||
// Save CSI configmap
|
||||
monEndpoints := csi.MonEndpoints(cluster.ClusterInfo.Monitors, cluster.Spec.RequireMsgr2())
|
||||
err = csi.SaveClusterConfig(c.context.Clientset, c.namespacedName.Namespace, cluster.ClusterInfo, &csi.CsiClusterConfigEntry{Namespace: cluster.ClusterInfo.Namespace, Monitors: monEndpoints})
|
||||
csiConfigEntry := &csi.CSIClusterConfigEntry{
|
||||
Namespace: cluster.ClusterInfo.Namespace,
|
||||
ClusterInfo: cephcsi.ClusterInfo{
|
||||
Monitors: monEndpoints,
|
||||
},
|
||||
}
|
||||
err = csi.SaveClusterConfig(c.context.Clientset, c.namespacedName.Namespace, cluster.ClusterInfo, csiConfigEntry)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "failed to update csi cluster config")
|
||||
}
|
||||
|
||||
@@ -49,6 +49,8 @@ import (
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/apimachinery/pkg/util/sets"
|
||||
"k8s.io/apimachinery/pkg/util/wait"
|
||||
|
||||
cephcsi "github.com/ceph/ceph-csi/api/deploy/kubernetes"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -1104,7 +1106,13 @@ func (c *Cluster) saveMonConfig() error {
|
||||
}
|
||||
|
||||
monEndpoints := csi.MonEndpoints(c.ClusterInfo.Monitors, c.spec.RequireMsgr2())
|
||||
if err := csi.SaveClusterConfig(c.context.Clientset, c.Namespace, c.ClusterInfo, &csi.CsiClusterConfigEntry{Namespace: c.ClusterInfo.Namespace, Monitors: monEndpoints}); err != nil {
|
||||
csiConfigEntry := &csi.CSIClusterConfigEntry{
|
||||
Namespace: c.ClusterInfo.Namespace,
|
||||
ClusterInfo: cephcsi.ClusterInfo{
|
||||
Monitors: monEndpoints,
|
||||
},
|
||||
}
|
||||
if err := csi.SaveClusterConfig(c.context.Clientset, c.Namespace, c.ClusterInfo, csiConfigEntry); err != nil {
|
||||
return errors.Wrap(err, "failed to update csi cluster config")
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user